studiograph 1.3.20 → 1.3.22
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/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/auth-api.d.ts +1 -1
- package/dist/server/routes/auth-api.js +2 -1
- package/dist/server/routes/auth-api.js.map +1 -1
- package/dist/server/routes/insights-api.d.ts +7 -0
- package/dist/server/routes/insights-api.js +47 -0
- package/dist/server/routes/insights-api.js.map +1 -0
- package/dist/services/insights.d.ts +31 -0
- package/dist/services/insights.js +174 -0
- package/dist/services/insights.js.map +1 -0
- package/dist/web/_app/immutable/assets/{AppShell.DVyh4lcT.css → AppShell.DFQamTEo.css} +1 -1
- package/dist/web/_app/immutable/chunks/{BXo5rIdU.js → 2BuoqS97.js} +2 -2
- package/dist/web/_app/immutable/chunks/{wnPynj2h.js → 5Q3iZDZU.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CGoS23Dn.js → BJlvZ6_w.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DP5Y1V5j.js → BODLxJgV.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DbczE2vm.js → BONf5_Rr.js} +1 -1
- package/dist/web/_app/immutable/chunks/{1YZNbPuF.js → BYMNYbod.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DZnk0U6X.js → Bl-KiNAn.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DJumtN6X.js → C6O5NX2h.js} +2 -2
- package/dist/web/_app/immutable/chunks/{DDuM5_bq.js → CBPCy2wh.js} +1 -1
- package/dist/web/_app/immutable/chunks/CTpBBS5W.js +2 -0
- package/dist/web/_app/immutable/chunks/{Cd2AAfar.js → CbWA7IDo.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BWbpPmKt.js → D2e_f7WK.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DZ7uBozP.js → D7wFh3Y6.js} +23 -23
- package/dist/web/_app/immutable/chunks/{BBKhbmnU.js → Da6P0VJZ.js} +1 -1
- package/dist/web/_app/immutable/chunks/{SzjCv9g2.js → DbMgkTYM.js} +1 -1
- package/dist/web/_app/immutable/chunks/DkBrGIdc.js +1 -0
- package/dist/web/_app/immutable/chunks/VncLXI-e.js +1 -0
- package/dist/web/_app/immutable/chunks/kW-E0CmU.js +1 -0
- package/dist/web/_app/immutable/chunks/uZSxhCI4.js +1 -0
- package/dist/web/_app/immutable/entry/app.CaQFD8Sp.js +2 -0
- package/dist/web/_app/immutable/entry/start.DXYjdKxA.js +1 -0
- package/dist/web/_app/immutable/nodes/0.BFYFTPQZ.js +10 -0
- package/dist/web/_app/immutable/nodes/{1.Bc1MepEl.js → 1.DSUtECoD.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.Dr5HuxKS.js → 2.FUuVOvKB.js} +1 -1
- package/dist/web/_app/immutable/nodes/3.CgL6-2JW.js +11 -0
- package/dist/web/_app/immutable/nodes/4.D4dn7z-O.js +4 -0
- package/dist/web/_app/immutable/nodes/5.B_Ktfrhu.js +2 -0
- package/dist/web/_app/immutable/nodes/6.OeYr_YON.js +1 -0
- package/dist/web/_app/immutable/nodes/7.VbcWnkhD.js +2 -0
- package/dist/web/_app/immutable/nodes/8.rD4JJv28.js +1 -0
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +10 -10
- package/package.json +1 -1
- package/dist/web/_app/immutable/chunks/BAoPZe8v.js +0 -1
- package/dist/web/_app/immutable/chunks/C5Jg9_3k.js +0 -1
- package/dist/web/_app/immutable/chunks/CkwRiDze.js +0 -1
- package/dist/web/_app/immutable/chunks/VEgGCdut.js +0 -2
- package/dist/web/_app/immutable/entry/app.CYqJAlgF.js +0 -2
- package/dist/web/_app/immutable/entry/start.B54V0Wim.js +0 -1
- package/dist/web/_app/immutable/nodes/0.Co4P2A7g.js +0 -10
- package/dist/web/_app/immutable/nodes/3.BsRqdsFZ.js +0 -11
- package/dist/web/_app/immutable/nodes/4.DMp14d8b.js +0 -4
- package/dist/web/_app/immutable/nodes/5.DG8tGegE.js +0 -2
- package/dist/web/_app/immutable/nodes/6.C_Uuh3Y1.js +0 -1
- package/dist/web/_app/immutable/nodes/7.D6ZnjxHd.js +0 -2
- package/dist/web/_app/immutable/nodes/8.CXi6tI0R.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./
|
|
2
|
-
import{p as Vo,a as g,s as
|
|
3
|
-
`,Zo="/",Yo="*",Jn="",Fc="comment",Nc="declaration";function Lc(n,e){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];e=e||{};var t=1,s=1;function r(v){var y=v.match(Ec);y&&(t+=y.length);var C=v.lastIndexOf(Dc);s=~C?v.length-C:s+v.length}function a(){var v={line:t,column:s};return function(y){return y.position=new o(v),d(),y}}function o(v){this.start=v,this.end={line:t,column:s},this.source=e.source}o.prototype.content=n;function c(v){var y=new Error(e.source+":"+t+":"+s+": "+v);if(y.reason=v,y.filename=e.source,y.line=t,y.column=s,y.source=n,!e.silent)throw y}function l(v){var y=v.exec(n);if(y){var C=y[0];return r(C),n=n.slice(C.length),y}}function d(){l(Oc)}function h(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=a();if(!(Zo!=n.charAt(0)||Yo!=n.charAt(1))){for(var y=2;Jn!=n.charAt(y)&&(Yo!=n.charAt(y)||Zo!=n.charAt(y+1));)++y;if(y+=2,Jn===n.charAt(y-1))return c("End of comment missing");var C=n.slice(2,y-2);return s+=2,r(C),n=n.slice(y),s+=2,v({type:Fc,comment:C})}}function u(){var v=a(),y=l(zc);if(y){if(f(),!l(Rc))return c("property missing ':'");var C=l(Mc),E=v({type:Nc,property:Go(y[0].replace(qo,Jn)),value:C?Go(C[0].replace(qo,Jn)):Jn});return l(Ic),E}}function p(){var v=[];h(v);for(var y;y=u();)y!==!1&&(v.push(y),h(v));return v}return d(),p()}function Go(n){return n?n.replace($c,Jn):Jn}function Bc(n,e){let t=null;if(!n||typeof n!="string")return t;const s=Lc(n),r=typeof e=="function";return s.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:c}=a;r?e(o,c,a):c&&(t=t||{},t[o]=c)}),t}var Hc=ue("<title> </title>"),Vc=ue('<svg><!><path d="M29,27.5859l-7.5521-7.5521a11.0177,11.0177,0,1,0-1.4141,1.4141L27.5859,29ZM4,13a9,9,0,1,1,9,9A9.01,9.01,0,0,1,4,13Z"></path></svg>');function za(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Vc();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Hc(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var Wc=ue("<title> </title>"),Kc=ue('<svg><!><path d="M17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"></path></svg>');function vs(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Kc();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Wc(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var jc=ue("<title> </title>"),Uc=ue('<svg><!><path d="M22 16 12 26 10.6 24.6 19.2 16 10.6 7.4 12 6z"></path></svg>');function Xr(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Uc();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=jc(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var qc=ue("<title> </title>"),Zc=ue('<svg><!><path d="M16 22 6 12 7.4 10.6 16 19.2 24.6 10.6 26 12z"></path></svg>');function Qr(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Zc();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=qc(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var Yc=ue("<title> </title>"),Gc=ue('<svg><!><path d="M6,30H18a2.0023,2.0023,0,0,0,2-2V25H18v3H6V4H18V7h2V4a2.0023,2.0023,0,0,0-2-2H6A2.0023,2.0023,0,0,0,4,4V28A2.0023,2.0023,0,0,0,6,30Z"></path><path d="M20.586 20.586 24.172 17 10 17 10 15 24.172 15 20.586 11.414 22 10 28 16 22 22 20.586 20.586z"></path></svg>');function Xc(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Gc();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Yc(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(2),k(l),g(n,l),N()}const Qc={project:"#5a70b0",organization:"#89a8ab",person:"#c09088",meeting:"#b5c090",deal:"#78d098",deliverable:"#e05050",decision:"#2a38a0",dataset:"#9090c0",process:"#b09890",deck:"#4a60a0",doc:"#a0c0d8",document:"#d8a0c0",note:"#707068",publication:"#d87070",reference:"#208850",task:"#b86058",role:"#484060","practice-area":"#7a7a98","case-study":"#2a4a3a",standard:"#dada98"};function dr(n){return n?Qc[n]??"#5c5c66":"#5c5c66"}const Jc={person:"people","practice-area":"practice-areas","case-study":"case-studies",process:"processes"};function eu(n){return Jc[n]??n+"s"}var tu=ue("<title> </title>"),nu=ue('<svg><!><path d="M17 15 17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z"></path></svg>');function Xo(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=nu();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=tu(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var ru=ue("<title> </title>"),su=ue('<svg><!><path d="M30.94,15.66A16.69,16.69,0,0,0,16,5,16.69,16.69,0,0,0,1.06,15.66a1,1,0,0,0,0,.68A16.69,16.69,0,0,0,16,27,16.69,16.69,0,0,0,30.94,16.34,1,1,0,0,0,30.94,15.66ZM16,25c-5.3,0-10.9-3.93-12.93-9C5.1,10.93,10.7,7,16,7s10.9,3.93,12.93,9C26.9,21.07,21.3,25,16,25Z"></path><path d="M16,10a6,6,0,1,0,6,6A6,6,0,0,0,16,10Zm0,10a4,4,0,1,1,4-4A4,4,0,0,1,16,20Z"></path></svg>');function iu(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=su();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=ru(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(2),k(l),g(n,l),N()}var ou=ue("<title> </title>"),au=ue('<svg><!><path d="M5.24,22.51l1.43-1.42A14.06,14.06,0,0,1,3.07,16C5.1,10.93,10.7,7,16,7a12.38,12.38,0,0,1,4,.72l1.55-1.56A14.72,14.72,0,0,0,16,5,16.69,16.69,0,0,0,1.06,15.66a1,1,0,0,0,0,.68A16,16,0,0,0,5.24,22.51Z"></path><path d="M12,15.73a4,4,0,0,1,3.7-3.7l1.81-1.82a6,6,0,0,0-7.33,7.33Z"></path><path d="M30.94,15.66A16.4,16.4,0,0,0,25.2,8.22L30,3.41,28.59,2,2,28.59,3.41,30l5.1-5.1A15.29,15.29,0,0,0,16,27,16.69,16.69,0,0,0,30.94,16.34,1,1,0,0,0,30.94,15.66ZM20,16a4,4,0,0,1-6,3.44L19.44,14A4,4,0,0,1,20,16Zm-4,9a13.05,13.05,0,0,1-6-1.58l2.54-2.54a6,6,0,0,0,8.35-8.35l2.87-2.87A14.54,14.54,0,0,1,28.93,16C26.9,21.07,21.3,25,16,25Z"></path></svg>');function ni(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=au();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=ou(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(3),k(l),g(n,l),N()}var lu=ue("<title> </title>"),cu=ue('<svg><!><path d="M12 12H14V24H12z"></path><path d="M18 12H20V24H18z"></path><path d="M4,6V8H6V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8h2V6ZM8,28V8H24V28Z"></path><path d="M12 2H20V4H12z"></path></svg>');function $r(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=cu();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=lu(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(4),k(l),g(n,l),N()}var uu=ue("<title> </title>"),du=ue('<svg><!><path d="M27,16.76c0-.25,0-.5,0-.76s0-.51,0-.77l1.92-1.68A2,2,0,0,0,29.3,11L26.94,7a2,2,0,0,0-1.73-1,2,2,0,0,0-.64.1l-2.43.82a11.35,11.35,0,0,0-1.31-.75l-.51-2.52a2,2,0,0,0-2-1.61H13.64a2,2,0,0,0-2,1.61l-.51,2.52a11.48,11.48,0,0,0-1.32.75L7.43,6.06A2,2,0,0,0,6.79,6,2,2,0,0,0,5.06,7L2.7,11a2,2,0,0,0,.41,2.51L5,15.24c0,.25,0,.5,0,.76s0,.51,0,.77L3.11,18.45A2,2,0,0,0,2.7,21L5.06,25a2,2,0,0,0,1.73,1,2,2,0,0,0,.64-.1l2.43-.82a11.35,11.35,0,0,0,1.31.75l.51,2.52a2,2,0,0,0,2,1.61h4.72a2,2,0,0,0,2-1.61l.51-2.52a11.48,11.48,0,0,0,1.32-.75l2.42.82a2,2,0,0,0,.64.1,2,2,0,0,0,1.73-1L29.3,21a2,2,0,0,0-.41-2.51ZM25.21,24l-3.43-1.16a8.86,8.86,0,0,1-2.71,1.57L18.36,28H13.64l-.71-3.55a9.36,9.36,0,0,1-2.7-1.57L6.79,24,4.43,20l2.72-2.4a8.9,8.9,0,0,1,0-3.13L4.43,12,6.79,8l3.43,1.16a8.86,8.86,0,0,1,2.71-1.57L13.64,4h4.72l.71,3.55a9.36,9.36,0,0,1,2.7,1.57L25.21,8,27.57,12l-2.72,2.4a8.9,8.9,0,0,1,0,3.13L27.57,20Z"></path><path d="M16,22a6,6,0,1,1,6-6A5.94,5.94,0,0,1,16,22Zm0-10a3.91,3.91,0,0,0-4,4,3.91,3.91,0,0,0,4,4,3.91,3.91,0,0,0,4-4A3.91,3.91,0,0,0,16,12Z"></path></svg>');function fu(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=du();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=uu(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(2),k(l),g(n,l),N()}var hu=ue("<title> </title>"),pu=ue('<svg><!><path d="M12,10H6.78A11,11,0,0,1,27,16h2A13,13,0,0,0,6,7.68V4H4v8h8Z"></path><path d="M20,22h5.22A11,11,0,0,1,5,16H3a13,13,0,0,0,23,8.32V28h2V20H20Z"></path></svg>');function Qo(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=pu();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=hu(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(2),k(l),g(n,l),N()}var gu=ue("<title> </title>"),vu=ue('<svg><!><circle cx="8" cy="16" r="2"></circle><circle cx="16" cy="16" r="2"></circle><circle cx="24" cy="16" r="2"></circle></svg>');function Jr(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=vu();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=gu(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(3),k(l),g(n,l),N()}var mu=ue("<title> </title>"),bu=ue('<svg><!><path d="M2 26H30V28H2z"></path><path d="M25.4,9c0.8-0.8,0.8-2,0-2.8c0,0,0,0,0,0l-3.6-3.6c-0.8-0.8-2-0.8-2.8,0c0,0,0,0,0,0l-15,15V24h6.4L25.4,9z M20.4,4L24,7.6 l-3,3L17.4,7L20.4,4z M6,22v-3.6l10-10l3.6,3.6l-10,10H6z"></path></svg>');function Ra(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=bu();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=mu(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(2),k(l),g(n,l),N()}var yu=ue("<title> </title>"),wu=ue('<svg><!><path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"></path><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"></path></svg>');function Jo(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=wu();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=yu(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(2),k(l),g(n,l),N()}function xu(n){return typeof n=="function"}function Vr(n){return n!==null&&typeof n=="object"}const _u=["string","number","bigint","boolean"];function ui(n){return n==null||_u.includes(typeof n)?!0:Array.isArray(n)?n.every(e=>ui(e)):typeof n=="object"?Object.getPrototypeOf(n)===Object.prototype:!1}const gr=Symbol("box"),Fs=Symbol("is-writable");function M(n,e){const t=x(n);return e?{[gr]:!0,[Fs]:!0,get current(){return i(t)},set current(s){e(s)}}:{[gr]:!0,get current(){return n()}}}function Wr(n){return Vr(n)&&gr in n}function Si(n){return Wr(n)&&Fs in n}function Ma(n){return Wr(n)?n:xu(n)?M(n):Sn(n)}function ku(n){return Object.entries(n).reduce((e,[t,s])=>Wr(s)?(Si(s)?Object.defineProperty(e,t,{get(){return s.current},set(r){s.current=r}}):Object.defineProperty(e,t,{get(){return s.current}}),e):Object.assign(e,{[t]:s}),{})}function Su(n){return Si(n)?{[gr]:!0,get current(){return n.current}}:n}function Sn(n){let e=L(en(n));return{[gr]:!0,[Fs]:!0,get current(){return i(e)},set current(t){m(e,t,!0)}}}function or(n){let e=L(en(n));return{[gr]:!0,[Fs]:!0,get current(){return i(e)},set current(t){m(e,t,!0)}}}or.from=Ma;or.with=M;or.flatten=ku;or.readonly=Su;or.isBox=Wr;or.isWritableBox=Si;function Ia(...n){return function(e){for(const t of n)if(t){if(e.defaultPrevented)return;typeof t=="function"?t.call(this,e):t.current?.call(this,e)}}}const Au=/\d/,Pu=["-","_","/","."];function Cu(n=""){if(!Au.test(n))return n!==n.toLowerCase()}function Tu(n){const e=[];let t="",s,r;for(const a of n){const o=Pu.includes(a);if(o===!0){e.push(t),t="",s=void 0;continue}const c=Cu(a);if(r===!1){if(s===!1&&c===!0){e.push(t),t=a,s=c;continue}if(s===!0&&c===!1&&t.length>1){const l=t.at(-1);e.push(t.slice(0,Math.max(0,t.length-1))),t=l+a,s=c;continue}}t+=a,s=c,r=o}return e.push(t),e}function $a(n){return n?Tu(n).map(e=>Ou(e)).join(""):""}function Eu(n){return zu($a(n||""))}function Ou(n){return n?n[0].toUpperCase()+n.slice(1):""}function zu(n){return n?n[0].toLowerCase()+n.slice(1):""}function Dr(n){if(!n)return{};const e={};function t(s,r){if(s.startsWith("-moz-")||s.startsWith("-webkit-")||s.startsWith("-ms-")||s.startsWith("-o-")){e[$a(s)]=r;return}if(s.startsWith("--")){e[s]=r;return}e[Eu(s)]=r}return Bc(n,t),e}function nr(...n){return(...e)=>{for(const t of n)typeof t=="function"&&t(...e)}}function Ru(n,e){const t=RegExp(n,"g");return s=>{if(typeof s!="string")throw new TypeError(`expected an argument of type string, but got ${typeof s}`);return s.match(t)?s.replace(t,e):s}}const Mu=Ru(/[A-Z]/,n=>`-${n.toLowerCase()}`);function Iu(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(e=>`${Mu(e)}: ${n[e]};`).join(`
|
|
4
|
-
`)}function
|
|
5
|
-
`," ")}const
|
|
6
|
-
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const Fa=typeof window<"u"?window:void 0;function Nu(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Lu{#e;#t;constructor(e={}){const{window:t=Fa,document:s=t?.document}=e;t!==void 0&&(this.#e=s,this.#t=Ca(r=>{const a=_t(t,"focusin",r),o=_t(t,"focusout",r);return()=>{a(),o()}}))}get current(){return this.#t?.(),this.#e?Nu(this.#e):null}}new Lu;function Bu(n){return typeof n=="function"}class Fn{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return vc(this.#t)}get(){const e=Lr(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=Lr(this.#t);return t===void 0?e:t}set(e){return mc(this.#t,e)}}function Hu(n,e){switch(n){case"post":mt(e);break;case"pre":bc(e);break}}function Na(n,e,t,s={}){const{lazy:r=!1}=s;let a=!r,o=Array.isArray(n)?[]:void 0;Hu(e,()=>{const c=Array.isArray(n)?n.map(d=>d()):n();if(!a){a=!0,o=c;return}const l=li(()=>t(c,o));return o=c,l})}function Tt(n,e,t){Na(n,"post",e,t)}function Vu(n,e,t){Na(n,"pre",e,t)}Tt.pre=Vu;function ea(n){return Bu(n)?n():n}class Wu{#e={width:0,height:0};#t=!1;#n;#r;#s;#i=x(()=>(i(this.#o)?.(),this.getSize().width));#a=x(()=>(i(this.#o)?.(),this.getSize().height));#o=x(()=>{const e=ea(this.#r);if(e)return Ca(t=>{if(!this.#s)return;const s=new this.#s.ResizeObserver(r=>{this.#t=!0;for(const a of r){const o=this.#n.box==="content-box"?a.contentBoxSize:a.borderBoxSize,c=Array.isArray(o)?o:[o];this.#e.width=c.reduce((l,d)=>Math.max(l,d.inlineSize),0),this.#e.height=c.reduce((l,d)=>Math.max(l,d.blockSize),0)}t()});return s.observe(e),()=>{this.#t=!1,s.disconnect()}})});constructor(e,t={box:"border-box"}){this.#s=t.window??Fa,this.#n=t,this.#r=e,this.#e={width:0,height:0}}calculateSize(){const e=ea(this.#r);if(!e||!this.#s)return;const t=e.offsetWidth,s=e.offsetHeight;if(this.#n.box==="border-box")return{width:t,height:s};const r=this.#s.getComputedStyle(e),a=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),o=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),c=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth),l=parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),d=t-a-c,h=s-o-l;return{width:d,height:h}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return i(this.#o)?.(),this.getSize()}get width(){return i(this.#i)}get height(){return i(this.#a)}}function br(n){mt(()=>()=>{n()})}function La(n,e){return setTimeout(e,n)}function Rn(n){us().then(n)}const Ku=1,ju=9,Uu=11;function di(n){return Vr(n)&&n.nodeType===Ku&&typeof n.nodeName=="string"}function Ba(n){return Vr(n)&&n.nodeType===ju}function qu(n){return Vr(n)&&n.constructor?.name==="VisualViewport"}function Zu(n){return Vr(n)&&n.nodeType!==void 0}function Ha(n){return Zu(n)&&n.nodeType===Uu&&"host"in n}function Yu(n,e){if(!n||!e||!di(n)||!di(e))return!1;const t=e.getRootNode?.();if(n===e||n.contains(e))return!0;if(t&&Ha(t)){let s=e;for(;s;){if(n===s)return!0;s=s.parentNode||s.host}}return!1}function Kr(n){return Ba(n)?n:qu(n)?n.document:n?.ownerDocument??document}function Ai(n){return Ha(n)?Ai(n.host):Ba(n)?n.defaultView??window:di(n)?n.ownerDocument?.defaultView??window:window}function Gu(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Pi{element;#e=x(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return i(this.#e)}set root(e){m(this.#e,e)}constructor(e){typeof e=="function"?this.element=M(e):this.element=e}getDocument=()=>Kr(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Gu(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)}function Ft(n,e){return{[Pc()]:t=>Wr(n)?(n.current=t,li(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(n.current=null,e?.(null))}):(n(t),li(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(n(null),e?.(null))})}}function Ci(n){return n?"true":"false"}function jn(n){return n?"":void 0}function Xu(n){return n?!0:void 0}function Ti(n){return n?"open":"closed"}function g0(n,e){return e?"mixed":n?"true":"false"}class Qu{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(t=>[t,this.getAttr(t)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}}function Ei(n){const e=new Qu(n);return{...e.attrs,selector:e.selector,getAttr:e.getAttr}}const Br="ArrowDown",Oi="ArrowLeft",zi="ArrowRight",ms="ArrowUp",Va="End",jr="Enter",Ju="Escape",Wa="Home",ed="PageDown",td="PageUp",yr=" ",nd="Tab";function rd(n){return window.getComputedStyle(n).getPropertyValue("direction")}function sd(n="ltr",e="horizontal"){return{horizontal:n==="rtl"?Oi:zi,vertical:Br}[e]}function id(n="ltr",e="horizontal"){return{horizontal:n==="rtl"?zi:Oi,vertical:ms}[e]}function od(n="ltr",e="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(e)||(e="horizontal"),{nextKey:sd(n,e),prevKey:id(n,e)}}const Ka=typeof document<"u",ta=ad();function ad(){return Ka&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Mn(n){return n instanceof HTMLElement}function fi(n){return n instanceof Element}function ja(n){return n instanceof Element||n instanceof SVGElement}function ld(n){return n!==null}function cd(n){return n instanceof HTMLInputElement&&"select"in n}class Ua{#e;#t=or(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,s=!1){const r=this.#e.rootNode.current;if(!r||!e)return;const a=this.getCandidateNodes();if(!a.length)return;const o=a.indexOf(e),c=rd(r),{nextKey:l,prevKey:d}=od(c,this.#e.orientation.current),h=this.#e.loop.current,f={[l]:o+1,[d]:o-1,[Wa]:0,[Va]:a.length-1};if(s){const v=l===Br?zi:Br,y=d===ms?Oi:ms;f[v]=o+1,f[y]=o-1}let u=f[t.key];if(u===void 0)return;t.preventDefault(),u<0&&h?u=a.length-1:u===a.length&&h&&(u=0);const p=a[u];if(p)return p.focus(),this.#t.current=p.id,this.#e.onCandidateFocus?.(p),p}getTabIndex(e){const t=this.getCandidateNodes(),s=this.#t.current!==null;return e&&!s&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){const e=this.#t.current;if(!e)return;const t=this.#e.rootNode.current?.querySelector(`#${e}`);!t||!Mn(t)||t.focus()}}class ud{#e;#t=null;constructor(e){this.#e=e,br(()=>this.#n())}#n(){this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null)}run(e){this.#n();const t=this.#e.ref.current;if(t){if(typeof t.getAnimations!="function"){this.#r(e);return}this.#t=window.requestAnimationFrame(()=>{const s=t.getAnimations();if(s.length===0){this.#r(e);return}Promise.allSettled(s.map(r=>r.finished)).then(()=>{this.#r(e)})})}}#r(e){const t=()=>{e()};this.#e.afterTick?Rn(t):t()}}class hi{#e;#t;#n;#r=L(!1);constructor(e){this.#e=e,m(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new ud({ref:this.#e.ref,afterTick:this.#e.open}),Tt(()=>this.#e.open.current,t=>{t&&m(this.#r,!0),this.#t&&this.#n.run(()=>{t===this.#e.open.current&&(this.#e.open.current||m(this.#r,!1),this.#e.onComplete?.())})})}get shouldRender(){return i(this.#r)}}function Ve(){}function Gt(n,e){return`bits-${n}`}const dd=Ei({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),In=new Fn("Dialog.Root | AlertDialog.Root");class Ns{static create(e){const t=In.getOr(null);return In.set(new Ns(e,t))}opts;#e=L(null);get triggerNode(){return i(this.#e)}set triggerNode(e){m(this.#e,e,!0)}#t=L(null);get contentNode(){return i(this.#t)}set contentNode(e){m(this.#t,e,!0)}#n=L(null);get overlayNode(){return i(this.#n)}set overlayNode(e){m(this.#n,e,!0)}#r=L(null);get descriptionNode(){return i(this.#r)}set descriptionNode(e){m(this.#r,e,!0)}#s=L(void 0);get contentId(){return i(this.#s)}set contentId(e){m(this.#s,e,!0)}#i=L(void 0);get titleId(){return i(this.#i)}set titleId(e){m(this.#i,e,!0)}#a=L(void 0);get triggerId(){return i(this.#a)}set triggerId(e){m(this.#a,e,!0)}#o=L(void 0);get descriptionId(){return i(this.#o)}set descriptionId(e){m(this.#o,e,!0)}#l=L(null);get cancelNode(){return i(this.#l)}set cancelNode(e){m(this.#l,e,!0)}#u=L(0);get nestedOpenCount(){return i(this.#u)}set nestedOpenCount(e){m(this.#u,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new hi({ref:M(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new hi({ref:M(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Tt(()=>this.opts.open.current,s=>{this.parent&&(s?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),br(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>dd.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#c=x(()=>({"data-state":Ti(this.opts.open.current)}));get sharedProps(){return i(this.#c)}set sharedProps(e){m(this.#c,e)}}class Ri{static create(e){return new Ri(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===yr||e.key===jr)&&(e.preventDefault(),this.root.handleClose())}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Mi{static create(e){return new Mi(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(this.opts.ref)}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("action")]:"",...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Ii{static create(e){return new Ii(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=Ft(this.opts.ref),Tt.pre(()=>this.opts.id.current,s=>{this.root.titleId=s})}#e=x(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class $i{static create(e){return new $i(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=Ft(this.opts.ref,s=>{this.root.descriptionNode=s}),Tt.pre(()=>this.opts.id.current,s=>{this.root.descriptionId=s})}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Ls{static create(e){return new Ls(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(this.opts.ref,s=>{this.root.contentNode=s,this.root.contentId=s?.id})}#e=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return i(this.#e)}set snippetProps(e){m(this.#e,e)}#t=x(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":jn(this.root.nestedOpenCount>0),"data-nested":jn(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}}class Di{static create(e){return new Di(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(this.opts.ref,s=>this.root.overlayNode=s)}#e=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return i(this.#e)}set snippetProps(e){m(this.#e,e)}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":jn(this.root.nestedOpenCount>0),"data-nested":jn(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}}class Fi{static create(e){return new Fi(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(this.opts.ref,s=>this.root.cancelNode=s),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===yr||e.key===jr)&&(e.preventDefault(),this.root.handleClose())}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("cancel")]:"",onclick:this.onclick,onkeydown:this.onkeydown,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}function fd(n,e){F(e,!0);let t=w(e,"open",15,!1),s=w(e,"onOpenChange",3,Ve),r=w(e,"onOpenChangeComplete",3,Ve);Ns.create({variant:M(()=>"alert-dialog"),open:M(()=>t(),c=>{t(c),s()(c)}),onOpenChangeComplete:M(()=>r())});var a=I(),o=A(a);se(o,()=>e.children??Te),g(n,a),N()}var hd=T("<div><!></div>");function qa(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"level",3,2),o=Fe(e,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const c=Ii.create({id:M(()=>s()),level:M(()=>a()),ref:M(()=>r(),p=>r(p))}),l=x(()=>tt(o,c.props));var d=I(),h=A(d);{var f=p=>{var v=I(),y=A(v);se(y,()=>e.child,()=>({props:i(l)})),g(p,v)},u=p=>{var v=hd();ye(v,()=>({...i(l)}));var y=S(v);se(y,()=>e.children??Te),k(v),g(p,v)};O(h,p=>{e.child?p(f):p(u,!1)})}g(n,d),N()}var pd=T("<button><!></button>");function gd(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=Fe(e,["$$slots","$$events","$$legacy","children","child","id","ref"]);const o=Mi.create({id:M(()=>s()),ref:M(()=>r(),u=>r(u))}),c=x(()=>tt(a,o.props));var l=I(),d=A(l);{var h=u=>{var p=I(),v=A(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=pd();ye(p,()=>({...i(c)}));var v=S(p);se(v,()=>e.children??Te),k(p),g(u,p)};O(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),N()}var vd=T("<button><!></button>");function md(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"disabled",3,!1),o=Fe(e,["$$slots","$$events","$$legacy","id","ref","children","child","disabled"]);const c=Fi.create({id:M(()=>s()),ref:M(()=>r(),p=>r(p)),disabled:M(()=>!!a())}),l=x(()=>tt(o,c.props));var d=I(),h=A(d);{var f=p=>{var v=I(),y=A(v);se(y,()=>e.child,()=>({props:i(l)})),g(p,v)},u=p=>{var v=vd();ye(v,()=>({...i(l)}));var y=S(v);se(y,()=>e.children??Te),k(v),g(p,v)};O(h,p=>{e.child?p(f):p(u,!1)})}g(n,d),N()}function bd(n,e){var t=I(),s=A(t);Tc(s,()=>e.children,r=>{var a=I(),o=A(a);se(o,()=>e.children??Te),g(r,a)}),g(n,t)}const yd=new Fn("BitsConfig");function wd(){const n=new xd(null,{});return yd.getOr(n).opts}class xd{opts;constructor(e,t){const s=_d(e,t);this.opts={defaultPortalTo:s(r=>r.defaultPortalTo),defaultLocale:s(r=>r.defaultLocale)}}}function _d(n,e){return t=>M(()=>{const r=t(e)?.current;if(r!==void 0)return r;if(n!==null)return t(n.opts)?.current})}function kd(n,e){return t=>{const s=wd();return M(()=>{const r=t();if(r!==void 0)return r;const a=n(s).current;return a!==void 0?a:e})}}const Sd=kd(n=>n.defaultPortalTo,"body");function Ni(n,e){F(e,!0);const t=Sd(()=>e.to),s=yc();let r=x(a);function a(){if(!Ka||e.disabled)return null;let f=null;return typeof t.current=="string"?f=document.querySelector(t.current):f=t.current,f}let o;function c(){o&&(tc(o),o=null)}Tt([()=>i(r),()=>e.disabled],([f,u])=>{if(!f||u){c();return}return o=ec(bd,{target:f,props:{children:e.children},context:s}),()=>{c()}});var l=I(),d=A(l);{var h=f=>{var u=I(),p=A(u);se(p,()=>e.children??Te),g(f,u)};O(d,f=>{e.disabled&&f(h)})}g(n,l),N()}class Ad{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){const s=this.createEvent(t);return e.dispatchEvent(s),s}listen(e,t,s){const r=a=>{t(a)};return _t(e,this.eventName,r,s)}}function na(n,e=500){let t=null;const s=(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)};return s.destroy=()=>{t!==null&&(clearTimeout(t),t=null)},s}function Za(n,e){return n===e||n.contains(e)}function Ya(n){return n?.ownerDocument??document}function Pd(n,e){const{clientX:t,clientY:s}=n,r=e.getBoundingClientRect();return t<r.left||t>r.right||s<r.top||s>r.bottom}const Cd=[jr,yr],Td=[Br,td,Wa],Ga=[ms,ed,Va],Ed=[...Td,...Ga];function ra(n){return n.pointerType==="mouse"}function Od(n,{select:e=!1}={}){if(!n||!n.focus)return;const t=Kr(n);if(t.activeElement===n)return;const s=t.activeElement;n.focus({preventScroll:!0}),n!==s&&cd(n)&&e&&n.select()}function zd(n,{select:e=!1}={},t){const s=t();for(const r of n)if(Od(r,{select:e}),t()!==s)return!0}let Er=L(!1);class Kn{static _refs=0;static _cleanup;constructor(){mt(()=>(Kn._refs===0&&(Kn._cleanup=Ea(()=>{const e=[],t=r=>{m(Er,!1)},s=r=>{m(Er,!0)};return e.push(_t(document,"pointerdown",t,{capture:!0}),_t(document,"pointermove",t,{capture:!0}),_t(document,"keydown",s,{capture:!0})),nr(...e)})),Kn._refs++,()=>{Kn._refs--,Kn._refs===0&&(m(Er,!1),Kn._cleanup?.())}))}get current(){return i(Er)}set current(e){m(Er,e,!0)}}var Xa=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],bs=Xa.join(","),Qa=typeof Element>"u",rr=Qa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ys=!Qa&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},ws=function(e,t){var s;t===void 0&&(t=!0);var r=e==null||(s=e.getAttribute)===null||s===void 0?void 0:s.call(e,"inert"),a=r===""||r==="true",o=a||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ws(e.parentNode));return o},Rd=function(e){var t,s=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return s===""||s==="true"},Ja=function(e,t,s){if(ws(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(bs));return t&&rr.call(e,bs)&&r.unshift(e),r=r.filter(s),r},xs=function(e,t,s){for(var r=[],a=Array.from(e);a.length;){var o=a.shift();if(!ws(o,!1))if(o.tagName==="SLOT"){var c=o.assignedElements(),l=c.length?c:o.children,d=xs(l,!0,s);s.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else{var h=rr.call(o,bs);h&&s.filter(o)&&(t||!e.includes(o))&&r.push(o);var f=o.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(o),u=!ws(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(o));if(f&&u){var p=xs(f===!0?o.children:f.children,!0,s);s.flatten?r.push.apply(r,p):r.push({scopeParent:o,candidates:p})}else a.unshift.apply(a,o.children)}}return r},el=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tl=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Rd(e))&&!el(e)?0:e.tabIndex},Md=function(e,t){var s=tl(e);return s<0&&t&&!el(e)?0:s},Id=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},nl=function(e){return e.tagName==="INPUT"},$d=function(e){return nl(e)&&e.type==="hidden"},Dd=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(s){return s.tagName==="SUMMARY"});return t},Fd=function(e,t){for(var s=0;s<e.length;s++)if(e[s].checked&&e[s].form===t)return e[s]},Nd=function(e){if(!e.name)return!0;var t=e.form||ys(e),s=function(c){return t.querySelectorAll('input[type="radio"][name="'+c+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=s(window.CSS.escape(e.name));else try{r=s(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=Fd(r,e.form);return!a||a===e},Ld=function(e){return nl(e)&&e.type==="radio"},Bd=function(e){return Ld(e)&&!Nd(e)},Hd=function(e){var t,s=e&&ys(e),r=(t=s)===null||t===void 0?void 0:t.host,a=!1;if(s&&s!==e){var o,c,l;for(a=!!((o=r)!==null&&o!==void 0&&(c=o.ownerDocument)!==null&&c!==void 0&&c.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!a&&r;){var d,h,f;s=ys(r),r=(d=s)===null||d===void 0?void 0:d.host,a=!!((h=r)!==null&&h!==void 0&&(f=h.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return a},sa=function(e){var t=e.getBoundingClientRect(),s=t.width,r=t.height;return s===0&&r===0},Vd=function(e,t){var s=t.displayCheck,r=t.getShadowRoot;if(s==="full-native"&&"checkVisibility"in e){var a=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(e).visibility==="hidden")return!0;var o=rr.call(e,"details>summary:first-of-type"),c=o?e.parentElement:e;if(rr.call(c,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var d=e.parentElement,h=ys(e);if(d&&!d.shadowRoot&&r(d)===!0)return sa(e);e.assignedSlot?e=e.assignedSlot:!d&&h!==e.ownerDocument?e=h.host:e=d}e=l}if(Hd(e))return!e.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return sa(e);return!1},Wd=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var s=0;s<t.children.length;s++){var r=t.children.item(s);if(r.tagName==="LEGEND")return rr.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},_s=function(e,t){return!(t.disabled||$d(t)||Vd(t,e)||Dd(t)||Wd(t))},pi=function(e,t){return!(Bd(t)||tl(t)<0||!_s(e,t))},Kd=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},rl=function(e){var t=[],s=[];return e.forEach(function(r,a){var o=!!r.scopeParent,c=o?r.scopeParent:r,l=Md(c,o),d=o?rl(r.candidates):c;l===0?o?t.push.apply(t,d):t.push(c):s.push({documentOrder:a,tabIndex:l,item:r,isScope:o,content:d})}),s.sort(Id).reduce(function(r,a){return a.isScope?r.push.apply(r,a.content):r.push(a.content),r},[]).concat(t)},sl=function(e,t){t=t||{};var s;return t.getShadowRoot?s=xs([e],t.includeContainer,{filter:pi.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Kd}):s=Ja(e,t.includeContainer,pi.bind(null,t)),rl(s)},il=function(e,t){t=t||{};var s;return t.getShadowRoot?s=xs([e],t.includeContainer,{filter:_s.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):s=Ja(e,t.includeContainer,_s.bind(null,t)),s},Li=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return rr.call(e,bs)===!1?!1:pi(t,e)},jd=Xa.concat("iframe:not([inert]):not([inert] *)").join(","),ol=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return rr.call(e,jd)===!1?!1:_s(t,e)};function Nr(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Ud(n,e){if(!Li(n,Nr()))return qd(n,e);const t=Kr(n),s=sl(t.body,Nr());e==="prev"&&s.reverse();const r=s.indexOf(n);return r===-1?t.body:s.slice(r+1)[0]}function qd(n,e){const t=Kr(n);if(!ol(n,Nr()))return t.body;const s=il(t.body,Nr());e==="prev"&&s.reverse();const r=s.indexOf(n);return r===-1?t.body:s.slice(r+1).find(o=>Li(o,Nr()))??t.body}function Zd(n,e){return n.length!==e.length?!1:n.every((t,s)=>al(t,e[s]))}function al(n,e){return Number.isNaN(n)&&Number.isNaN(e)?!0:Array.isArray(n)&&Array.isArray(e)?Zd(n,e):typeof n=="object"&&typeof e=="object"?Yd(n,e):Object.is(n,e)}function Yd(n,e){if(typeof n!="object"||typeof e!="object"||n===null||e===null)return!1;const t=Object.keys(n),s=Object.keys(e);if(t.length!==s.length)return!1;for(const r of t)if(!s.includes(r)||!al(n[r],e[r]))return!1;return!0}function v0(n,e,t=!0){if(!(n.length===0||e<0||e>=n.length))return n.length===1&&e===0?n[0]:e===n.length-1?t?n[0]:void 0:n[e+1]}function m0(n,e,t=!0){if(!(n.length===0||e<0||e>=n.length))return n.length===1&&e===0?n[0]:e===0?t?n[n.length-1]:void 0:n[e-1]}function b0(n,e,t,s=!0){if(n.length===0||e<0||e>=n.length)return;let r=e+t;return s?r=(r%n.length+n.length)%n.length:r=Math.max(0,Math.min(r,n.length-1)),n[r]}function y0(n,e,t,s=!0){if(n.length===0||e<0||e>=n.length)return;let r=e-t;return s?r=(r%n.length+n.length)%n.length:r=Math.max(0,Math.min(r,n.length-1)),n[r]}function ll(n,e,t){const s=e.toLowerCase();if(s.endsWith(" ")){const f=s.slice(0,-1);if(n.filter(y=>y.toLowerCase().startsWith(f)).length<=1)return ll(n,f,t);const p=t?.toLowerCase();if(p&&p.startsWith(f)&&p.charAt(f.length)===" "&&e.trim()===f)return t;const v=n.filter(y=>y.toLowerCase().startsWith(s));if(v.length>0){const y=t?n.indexOf(t):-1;return ia(v,Math.max(y,0)).find($=>$!==t)||t}}const a=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,o=a.toLowerCase(),c=t?n.indexOf(t):-1;let l=ia(n,Math.max(c,0));a.length===1&&(l=l.filter(f=>f!==t));const h=l.find(f=>f?.toLowerCase().startsWith(o));return h!==t?h:void 0}function ia(n,e){return n.map((t,s)=>n[(e+s)%n.length])}const Gd={afterMs:1e4,onChange:Ve};function cl(n,e){const{afterMs:t,onChange:s,getWindow:r}={...Gd,...e};let a=null,o=L(en(n));function c(){return r().setTimeout(()=>{m(o,n,!0),s?.(n)},t)}return mt(()=>()=>{a&&r().clearTimeout(a)}),M(()=>i(o),l=>{m(o,l,!0),s?.(l),a&&r().clearTimeout(a),a=c()})}class Xd{#e;#t;#n=x(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#r=x(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=cl("",{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;const s=i(this.#r)(),r=t.find(l=>l===s)?.textContent?.trim()??"",a=t.map(l=>l.textContent?.trim()??""),o=ll(a,this.#t.current,r),c=t.find(l=>l.textContent?.trim()===o);return c&&i(this.#n)(c),c}resetTypeahead(){this.#t.current=""}get search(){return this.#t.current}}class Qd{#e;#t;#n;#r=L(null);constructor(e){this.#e=e,this.#t=x(()=>this.#e.enabled()),this.#n=cl(!1,{afterMs:e.transitTimeout??300,onChange:t=>{i(this.#t)&&this.#e.setIsPointerInTransit?.(t)},getWindow:()=>Ai(this.#e.triggerNode())}),Tt([e.triggerNode,e.contentNode,e.enabled],([t,s,r])=>{if(!t||!s||!r)return;const a=c=>{this.#i(c,s)},o=c=>{this.#i(c,t)};return nr(_t(t,"pointerleave",a),_t(s,"pointerleave",o))}),Tt(()=>i(this.#r),()=>{const t=r=>{if(!i(this.#r))return;const a=r.target;if(!fi(a))return;const o={x:r.clientX,y:r.clientY},c=e.triggerNode()?.contains(a)||e.contentNode()?.contains(a),l=!nf(o,i(this.#r));c?this.#s():l&&(this.#s(),e.onPointerExit())},s=Kr(e.triggerNode()??e.contentNode());if(s)return _t(s,"pointermove",t)})}#s(){m(this.#r,null),this.#n.current=!1}#i(e,t){const s=e.currentTarget;if(!Mn(s))return;const r={x:e.clientX,y:e.clientY},a=Jd(r,s.getBoundingClientRect()),o=ef(r,a),c=tf(t.getBoundingClientRect()),l=rf([...o,...c]);m(this.#r,l,!0),this.#n.current=!0}}function Jd(n,e){const t=Math.abs(e.top-n.y),s=Math.abs(e.bottom-n.y),r=Math.abs(e.right-n.x),a=Math.abs(e.left-n.x);switch(Math.min(t,s,r,a)){case a:return"left";case r:return"right";case t:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function ef(n,e,t=5){const s=t*1.5;switch(e){case"top":return[{x:n.x-t,y:n.y+t},{x:n.x,y:n.y-s},{x:n.x+t,y:n.y+t}];case"bottom":return[{x:n.x-t,y:n.y-t},{x:n.x,y:n.y+s},{x:n.x+t,y:n.y-t}];case"left":return[{x:n.x+t,y:n.y-t},{x:n.x-s,y:n.y},{x:n.x+t,y:n.y+t}];case"right":return[{x:n.x-t,y:n.y-t},{x:n.x+s,y:n.y},{x:n.x-t,y:n.y+t}]}}function tf(n){const{top:e,right:t,bottom:s,left:r}=n;return[{x:r,y:e},{x:t,y:e},{x:t,y:s},{x:r,y:s}]}function nf(n,e){const{x:t,y:s}=n;let r=!1;for(let a=0,o=e.length-1;a<e.length;o=a++){const c=e[a].x,l=e[a].y,d=e[o].x,h=e[o].y;l>s!=h>s&&t<(d-c)*(s-l)/(h-l)+c&&(r=!r)}return r}function rf(n){const e=n.slice();return e.sort((t,s)=>t.x<s.x?-1:t.x>s.x?1:t.y<s.y?-1:t.y>s.y?1:0),sf(e)}function sf(n){if(n.length<=1)return n.slice();const e=[];for(let s=0;s<n.length;s++){const r=n[s];for(;e.length>=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(r.y-o.y)>=(a.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let s=n.length-1;s>=0;s--){const r=n[s];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(r.y-o.y)>=(a.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}const of="data-context-menu-trigger",af="data-context-menu-content",ul=new Fn("Menu.Root"),Bi=new Fn("Menu.Root | Menu.Sub"),dl=new Fn("Menu.Content"),lf=new Ad("bitsmenuopen",{bubbles:!1,cancelable:!0}),cf=Ei({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class Hi{static create(e){const t=new Hi(e);return ul.set(t)}opts;isUsingKeyboard=new Kn;#e=L(!1);get ignoreCloseAutoFocus(){return i(this.#e)}set ignoreCloseAutoFocus(e){m(this.#e,e,!0)}#t=L(!1);get isPointerInTransit(){return i(this.#t)}set isPointerInTransit(e){m(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>cf.getAttr(e,this.opts.variant.current)}class Vi{static create(e,t){return Bi.set(new Vi(e,t,null))}opts;root;parentMenu;contentId=M(()=>"");#e=L(null);get contentNode(){return i(this.#e)}set contentNode(e){m(this.#e,e,!0)}contentPresence;#t=L(null);get triggerNode(){return i(this.#t)}set triggerNode(e){m(this.#t,e,!0)}constructor(e,t,s){this.opts=e,this.root=t,this.parentMenu=s,this.contentPresence=new hi({ref:M(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),s&&Tt(()=>s.opts.open.current,()=>{s.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class Wi{static create(e){return dl.set(new Wi(e,Bi.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=L("");get search(){return i(this.#e)}set search(e){m(this.#e,e,!0)}#t=0;#n;#r=L(!1);get mounted(){return i(this.#r)}set mounted(e){m(this.#r,e,!0)}#s;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new Pi(e.ref),this.attachment=Ft(this.opts.ref,s=>{this.parentMenu.contentNode!==s&&(this.parentMenu.contentNode=s)}),t.contentId=e.id,this.#s=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Qd({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:s=>{this.parentMenu.root.isPointerInTransit=s}}),this.#n=new Xd({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new Ua({rootNode:M(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:M(()=>"vertical")}),Tt(()=>this.parentMenu.contentNode,s=>{if(!s)return;const r=()=>{Rn(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return lf.listen(s,r)}),mt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#i(){const e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=e=>{this.opts.onCloseAutoFocus.current?.(e),!(e.defaultPrevented||this.#s)&&this.parentMenu.triggerNode&&Li(this.parentMenu.triggerNode)&&(e.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();const s=Ud(t.triggerNode,e.shiftKey?"prev":"next");s?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),Rn(()=>{s.focus(),Rn(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===nd){this.handleTabKeyDown(e);return}const t=e.target,s=e.currentTarget;if(!Mn(t)||!Mn(s))return;const r=t.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,a=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code==="Space")return;const l=this.#i();r&&!a&&o&&this.#n(e.key,l),e.target?.id===this.parentMenu.contentId.current&&Ed.includes(e.key)&&(e.preventDefault(),Ga.includes(e.key)&&l.reverse(),zd(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){fi(e.currentTarget)&&fi(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=""))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&Rn(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(e){if(e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(e){if(!ja(e.target))return;const t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}e.target.closest(`#${t}`)&&e.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#o=x(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return i(this.#o)}set snippetProps(e){m(this.#o,e)}#l=x(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Ti(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return i(this.#l)}set props(e){m(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}}class uf{opts;content;attachment;#e=L(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=Ft(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&ra(e))if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;const s=e.currentTarget;if(!Mn(s))return;s.focus()}}onpointerleave(e){e.defaultPrevented||ra(e)&&this.content.onItemLeave(e)}onfocus(e){Rn(()=>{e.defaultPrevented||this.opts.disabled.current||m(this.#e,!0)})}onblur(e){Rn(()=>{e.defaultPrevented||m(this.#e,!1)})}#t=x(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":Ci(this.opts.disabled.current),"data-disabled":jn(this.opts.disabled.current),"data-highlighted":i(this.#e)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}class Ki{static create(e){const t=new uf(e,dl.get());return new Ki(e,t)}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;const e=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){const t=this.item.content.search!=="";if(!(this.item.opts.disabled.current||t&&e.key===yr)&&Cd.includes(e.key)){if(!Mn(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!Mn(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#n=x(()=>tt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return i(this.#n)}set props(e){m(this.#n,e)}}class ji{static create(e){return new ji(e,ul.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(this.opts.ref)}#e=x(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Ui{static create(e){return new Ui(e,Bi.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=Ft(this.opts.ref,s=>this.parentMenu.triggerNode=s)}onclick=e=>{this.opts.disabled.current||e.detail!==0||(this.parentMenu.toggleOpen(),e.preventDefault())};onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType==="touch")return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType==="touch"&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===yr||e.key===jr){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===Br&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=x(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=x(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":Ci(this.parentMenu.opts.open.current),"aria-controls":i(this.#e),"data-disabled":jn(this.opts.disabled.current),"data-state":Ti(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}globalThis.bitsDismissableLayers??=new Map;class qi{static create(e){return new qi(e)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#s=!1;#i=void 0;#a;#o=Ve;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#a=e.onFocusOutside,mt(()=>{this.#i=Ya(this.opts.ref.current)});let t=Ve;const s=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};Tt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return La(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#u())}),s}),br(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#o(),t()})}#l=e=>{e.defaultPrevented||this.opts.ref.current&&Rn(()=>{!this.opts.ref.current||this.#v(e.target)||e.target&&!this.#s&&this.#a.current?.(e)})};#u(){return nr(_t(this.#i,"pointerdown",nr(this.#h,this.#g),{capture:!0}),_t(this.#i,"pointerdown",nr(this.#p,this.#d)),_t(this.#i,"focusin",this.#l))}#c=e=>{let t=e;t.defaultPrevented&&(t=oa(e)),this.#e.current(e)};#d=na(e=>{if(!this.opts.ref.current){this.#o();return}const t=this.opts.isValidEvent.current(e,this.opts.ref.current)||hf(e,this.opts.ref.current);if(!this.#r||this.#m()||!t){this.#o();return}let s=e;if(s.defaultPrevented&&(s=oa(s)),this.#t.current!=="close"&&this.#t.current!=="defer-otherwise-close"){this.#o();return}e.pointerType==="touch"?(this.#o(),this.#o=_t(this.#i,"click",this.#c,{once:!0})):this.#e.current(s)},10);#h=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#g=()=>{this.opts.ref.current&&(this.#r=ff(this.opts.ref.current))};#v=e=>this.opts.ref.current?Za(this.opts.ref.current,e):!1;#f=na(()=>{for(const e in this.#n)this.#n[e]=!1;this.#r=!1},20);#m(){return Object.values(this.#n).some(Boolean)}#b=()=>{this.#s=!0};#y=()=>{this.#s=!1};props={onfocuscapture:this.#b,onblurcapture:this.#y}}function df(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([e,{current:t}])=>t==="close"||t==="ignore")}function ff(n){const e=[...globalThis.bitsDismissableLayers],t=df(e);if(t)return t[0].opts.ref.current===n;const[s]=e[0];return s.opts.ref.current===n}function hf(n,e){const t=n.target;if(!ja(t))return!1;const s=!!t.closest(`[${of}]`);if("button"in n&&n.button>0&&!s)return!1;if("button"in n&&n.button===0&&s)return!0;const r=!!e.closest(`[${af}]`);return s&&r?!1:Ya(t).documentElement.contains(t)&&!Za(e,t)&&Pd(n,e)}function oa(n){const e=n.currentTarget,t=n.target;let s;n instanceof PointerEvent?s=new PointerEvent(n.type,n):s=new PointerEvent("pointerdown",n);let r=!1;return new Proxy(s,{get:(o,c)=>c==="currentTarget"?e:c==="target"?t:c==="preventDefault"?()=>{r=!0,typeof o.preventDefault=="function"&&o.preventDefault()}:c==="defaultPrevented"?r:c in o?o[c]:n[c]})}function Zi(n,e){F(e,!0);let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"onInteractOutside",3,Ve),r=w(e,"onFocusOutside",3,Ve),a=w(e,"isValidEvent",3,()=>!1);const o=qi.create({id:M(()=>e.id),interactOutsideBehavior:M(()=>t()),onInteractOutside:M(()=>s()),enabled:M(()=>e.enabled),onFocusOutside:M(()=>r()),isValidEvent:M(()=>a()),ref:e.ref});var c=I(),l=A(c);se(l,()=>e.children??Te,()=>({props:o.props})),g(n,c),N()}globalThis.bitsEscapeLayers??=new Map;class Yi{static create(e){return new Yi(e)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Pi(this.opts.ref);let t=Ve;Tt(()=>e.enabled.current,s=>(s&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>_t(this.domContext.getDocument(),"keydown",this.#t,{passive:!1});#t=e=>{if(e.key!==Ju||!pf(this))return;const t=new KeyboardEvent(e.type,e);e.preventDefault();const s=this.opts.escapeKeydownBehavior.current;s!=="close"&&s!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(t)}}function pf(n){const e=[...globalThis.bitsEscapeLayers],t=e.findLast(([r,{current:a}])=>a==="close"||a==="ignore");if(t)return t[0]===n;const[s]=e[0];return s===n}function Gi(n,e){F(e,!0);let t=w(e,"escapeKeydownBehavior",3,"close"),s=w(e,"onEscapeKeydown",3,Ve);Yi.create({escapeKeydownBehavior:M(()=>t()),onEscapeKeydown:M(()=>s()),enabled:M(()=>e.enabled),ref:e.ref});var r=I(),a=A(r);se(a,()=>e.children??Te),g(n,r),N()}class Xi{static instance;#e=Sn([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new Xi),this.instance}register(e){const t=this.getActive();t&&t!==e&&t.pause();const s=document.activeElement;s&&s!==document.body&&this.#n.set(e,s),this.#e.current=this.#e.current.filter(r=>r!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(s=>s!==e);const t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}}class Qi{#e=!1;#t=null;#n=Xi.getInstance();#r=[];#s;constructor(e){this.#s=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#i(){for(const e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#l(),this.#a()}unmount(){this.#t&&(this.#i(),this.#o(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#t=null)}#a(){if(!this.#t)return;const e=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#s.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;const t=this.#c();t?(t.focus(),this.#n.setFocusMemory(this,t)):this.#t.focus()})}#o(){const e=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#s.onCloseAutoFocus.current?.(e),!e.defaultPrevented){const t=this.#n.getPreFocusMemory(this);if(t&&document.contains(t))try{t.focus()}catch{document.body.focus()}}}#l(){if(!this.#t||!this.#s.trap.current)return;const e=this.#t,t=e.ownerDocument,s=o=>{if(this.#e||!this.#n.isActiveScope(this))return;const c=o.target;if(!c)return;if(e.contains(c))this.#n.setFocusMemory(this,c);else{const d=this.#n.getFocusMemory(this);if(d&&e.contains(d)&&ol(d))o.preventDefault(),d.focus();else{const h=this.#c(),f=this.#d()[0];(h||f||e).focus()}}},r=o=>{if(!this.#s.loop||this.#e||o.key!=="Tab"||!this.#n.isActiveScope(this))return;const c=this.#u();if(c.length===0)return;const l=c[0],d=c[c.length-1];!o.shiftKey&&t.activeElement===d?(o.preventDefault(),l.focus()):o.shiftKey&&t.activeElement===l&&(o.preventDefault(),d.focus())};this.#r.push(_t(t,"focusin",s,{capture:!0}),_t(e,"keydown",r));const a=new MutationObserver(()=>{const o=this.#n.getFocusMemory(this);if(o&&!e.contains(o)){const c=this.#c(),l=this.#d()[0],d=c||l;d?(d.focus(),this.#n.setFocusMemory(this,d)):e.focus()}});a.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>a.disconnect())}#u(){return this.#t?sl(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#c(){return this.#u()[0]||null}#d(){return this.#t?il(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(e){let t=null;return Tt([()=>e.ref.current,()=>e.enabled.current],([s,r])=>{s&&r?(t||(t=new Qi(e)),t.mount(s)):t&&(t.unmount(),t=null)}),br(()=>{t?.unmount()}),{get props(){return{tabindex:-1}}}}}function Ji(n,e){F(e,!0);let t=w(e,"enabled",3,!1),s=w(e,"trapFocus",3,!1),r=w(e,"loop",3,!1),a=w(e,"onCloseAutoFocus",3,Ve),o=w(e,"onOpenAutoFocus",3,Ve);const c=Qi.use({enabled:M(()=>t()),trap:M(()=>s()),loop:r(),onCloseAutoFocus:M(()=>a()),onOpenAutoFocus:M(()=>o()),ref:e.ref});var l=I(),d=A(l);se(d,()=>e.focusScope??Te,()=>({props:c.props})),g(n,l),N()}globalThis.bitsTextSelectionLayers??=new Map;class eo{static create(e){return new eo(e)}opts;domContext;#e=Ve;constructor(e){this.opts=e,this.domContext=new Pi(e.ref);let t=Ve;Tt(()=>this.opts.enabled.current,s=>(s&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#t()),()=>{t(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#t(){return nr(_t(this.domContext.getDocument(),"pointerdown",this.#n),_t(this.domContext.getDocument(),"pointerup",Ia(this.#r,this.opts.onPointerUp.current)))}#n=e=>{const t=this.opts.ref.current,s=e.target;!Mn(t)||!Mn(s)||!this.opts.enabled.current||!vf(this)||!Yu(t,s)||(this.opts.onPointerDown.current(e),!e.defaultPrevented&&(this.#e=gf(t,this.domContext.getDocument().body)))};#r=()=>{this.#e(),this.#e=Ve}}const aa=n=>n.style.userSelect||n.style.webkitUserSelect;function gf(n,e){const t=aa(e),s=aa(n);return es(e,"none"),es(n,"text"),()=>{es(e,t),es(n,s)}}function es(n,e){n.style.userSelect=e,n.style.webkitUserSelect=e}function vf(n){const e=[...globalThis.bitsTextSelectionLayers];if(!e.length)return!1;const t=e.at(-1);return t?t[0]===n:!1}function to(n,e){F(e,!0);let t=w(e,"preventOverflowTextSelection",3,!0),s=w(e,"onPointerDown",3,Ve),r=w(e,"onPointerUp",3,Ve);eo.create({id:M(()=>e.id),onPointerDown:M(()=>s()),onPointerUp:M(()=>r()),enabled:M(()=>e.enabled&&t()),ref:e.ref});var a=I(),o=A(a);se(o,()=>e.children??Te),g(n,a),N()}globalThis.bitsIdCounter??={current:0};function no(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}class mf{#e;#t=0;#n=L();#r;constructor(e){this.#e=e}#s(){this.#t-=1,this.#r&&this.#t<=0&&(this.#r(),m(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,i(this.#n)===void 0&&(this.#r=Ea(()=>{m(this.#n,this.#e(...e),!0)})),mt(()=>()=>{this.#s()}),i(this.#n)}}const hs=new ci;let ts=L(null),ri=null,Or=null,zr=!1;const la=M(()=>{for(const n of hs.values())if(n)return!0;return!1});let si=null;const bf=new mf(()=>{function n(){document.body.setAttribute("style",i(ts)??""),document.body.style.removeProperty("--scrollbar-width"),ta&&ri?.(),m(ts,null)}function e(){Or!==null&&(window.clearTimeout(Or),Or=null)}function t(r,a){e(),zr=!0,si=Date.now();const o=si,c=()=>{Or=null,si===o&&(fl(hs)?zr=!1:(zr=!1,a()))},l=r===null?24:r;Or=window.setTimeout(c,l)}function s(){i(ts)===null&&hs.size===0&&!zr&&m(ts,document.body.getAttribute("style"),!0)}return Tt(()=>la.current,()=>{if(!la.current)return;s(),zr=!1;const r=getComputedStyle(document.documentElement),a=getComputedStyle(document.body),o=r.scrollbarGutter?.includes("stable")||a.scrollbarGutter?.includes("stable"),c=window.innerWidth-document.documentElement.clientWidth,d={padding:Number.parseInt(a.paddingRight??"0",10)+c,margin:Number.parseInt(a.marginRight??"0",10)};c>0&&!o&&(document.body.style.paddingRight=`${d.padding}px`,document.body.style.marginRight=`${d.margin}px`,document.body.style.setProperty("--scrollbar-width",`${c}px`)),document.body.style.overflow="hidden",ta&&(ri=_t(document,"touchmove",h=>{h.target===document.documentElement&&(h.touches.length>1||h.preventDefault())},{passive:!1})),Rn(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),br(()=>()=>{ri?.()}),{get lockMap(){return hs},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:t,cancelPendingCleanup:e,ensureInitialStyleCaptured:s}});class yf{#e=no();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=bf.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=M(()=>this.#r.lockMap.get(this.#e)??!1,s=>this.#r.lockMap.set(this.#e,s)),br(()=>{if(this.#r.lockMap.delete(this.#e),fl(this.#r.lockMap))return;const s=this.#n();this.#r.scheduleCleanupIfNoNewLocks(s,()=>{this.#r.resetBodyStyle()})}))}}function fl(n){for(const[e,t]of n)if(t)return!0;return!1}function vr(n,e){F(e,!0);let t=w(e,"preventScroll",3,!0),s=w(e,"restoreScrollDelay",3,null);t()&&new yf(t(),()=>s()),N()}var wf=T("<!> <!>",1),xf=T("<!> <div><!></div>",1);function _f(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"forceMount",3,!1),o=w(e,"interactOutsideBehavior",3,"ignore"),c=w(e,"onCloseAutoFocus",3,Ve),l=w(e,"onEscapeKeydown",3,Ve),d=w(e,"onOpenAutoFocus",3,Ve),h=w(e,"onInteractOutside",3,Ve),f=w(e,"preventScroll",3,!0),u=w(e,"trapFocus",3,!0),p=w(e,"restoreScrollDelay",3,null),v=Fe(e,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","interactOutsideBehavior","onCloseAutoFocus","onEscapeKeydown","onOpenAutoFocus","onInteractOutside","preventScroll","trapFocus","restoreScrollDelay"]);const y=Ls.create({id:M(()=>s()),ref:M(()=>r(),P=>r(P))}),C=x(()=>tt(v,y.props));var E=I(),$=A(E);{var z=P=>{Ji(P,{get ref(){return y.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return y.root.opts.open.current},get onCloseAutoFocus(){return c()},onOpenAutoFocus:V=>{d()(V),!V.defaultPrevented&&(V.preventDefault(),La(0,()=>y.opts.ref.current?.focus()))},focusScope:(V,J)=>{let he=()=>J?.().props;Gi(V,ot(()=>i(C),{get enabled(){return y.root.opts.open.current},get ref(){return y.opts.ref},onEscapeKeydown:ee=>{l()(ee),!ee.defaultPrevented&&y.root.handleClose()},children:(ee,pe)=>{Zi(ee,ot(()=>i(C),{get ref(){return y.opts.ref},get enabled(){return y.root.opts.open.current},get interactOutsideBehavior(){return o()},onInteractOutside:te=>{h()(te),!te.defaultPrevented&&y.root.handleClose()},children:(te,ge)=>{to(te,ot(()=>i(C),{get ref(){return y.opts.ref},get enabled(){return y.root.opts.open.current},children:(U,G)=>{var j=I(),Y=A(j);{var we=Oe=>{var at=wf(),ft=A(at);{var kt=ve=>{vr(ve,{get preventScroll(){return f()},get restoreScrollDelay(){return p()}})};O(ft,ve=>{y.root.opts.open.current&&ve(kt)})}var X=D(ft,2);{let ve=x(()=>({props:tt(i(C),he()),...y.snippetProps}));se(X,()=>e.child,()=>i(ve))}g(Oe,at)},Se=Oe=>{var at=xf(),ft=A(at);vr(ft,{get preventScroll(){return f()}});var kt=D(ft,2);ye(kt,ve=>({...ve}),[()=>tt(i(C),he())]);var X=S(kt);se(X,()=>e.children??Te),k(kt),g(Oe,at)};O(Y,Oe=>{e.child?Oe(we):Oe(Se,!1)})}g(U,j)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};O($,P=>{(y.shouldRender||a())&&P(z)})}g(n,E),N()}var kf=T("<div><!></div>");function hl(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"forceMount",3,!1),a=w(e,"ref",15,null),o=Fe(e,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const c=Di.create({id:M(()=>s()),ref:M(()=>a(),u=>a(u))}),l=x(()=>tt(o,c.props));var d=I(),h=A(d);{var f=u=>{var p=I(),v=A(p);{var y=E=>{var $=I(),z=A($);{let P=x(()=>({props:tt(i(l)),...c.snippetProps}));se(z,()=>e.child,()=>i(P))}g(E,$)},C=E=>{var $=kf();ye($,P=>({...P}),[()=>tt(i(l))]);var z=S($);se(z,()=>e.children??Te,()=>c.snippetProps),k($),g(E,$)};O(v,E=>{e.child?E(y):E(C,!1)})}g(u,p)};O(h,u=>{(c.shouldRender||r())&&u(f)})}g(n,d),N()}var Sf=T("<div><!></div>");function pl(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=Fe(e,["$$slots","$$events","$$legacy","id","children","child","ref"]);const o=$i.create({id:M(()=>s()),ref:M(()=>r(),u=>r(u))}),c=x(()=>tt(a,o.props));var l=I(),d=A(l);{var h=u=>{var p=I(),v=A(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=Sf();ye(p,()=>({...i(c)}));var v=S(p);se(v,()=>e.children??Te),k(p),g(u,p)};O(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),N()}const Af=["top","right","bottom","left"],Un=Math.min,cn=Math.max,ks=Math.round,ns=Math.floor,Pn=n=>({x:n,y:n}),Pf={left:"right",right:"left",bottom:"top",top:"bottom"},Cf={start:"end",end:"start"};function gi(n,e,t){return cn(n,Un(e,t))}function $n(n,e){return typeof n=="function"?n(e):n}function Dn(n){return n.split("-")[0]}function wr(n){return n.split("-")[1]}function ro(n){return n==="x"?"y":"x"}function so(n){return n==="y"?"height":"width"}const Tf=new Set(["top","bottom"]);function An(n){return Tf.has(Dn(n))?"y":"x"}function io(n){return ro(An(n))}function Ef(n,e,t){t===void 0&&(t=!1);const s=wr(n),r=io(n),a=so(r);let o=r==="x"?s===(t?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=Ss(o)),[o,Ss(o)]}function Of(n){const e=Ss(n);return[vi(n),e,vi(e)]}function vi(n){return n.replace(/start|end/g,e=>Cf[e])}const ca=["left","right"],ua=["right","left"],zf=["top","bottom"],Rf=["bottom","top"];function Mf(n,e,t){switch(n){case"top":case"bottom":return t?e?ua:ca:e?ca:ua;case"left":case"right":return e?zf:Rf;default:return[]}}function If(n,e,t,s){const r=wr(n);let a=Mf(Dn(n),t==="start",s);return r&&(a=a.map(o=>o+"-"+r),e&&(a=a.concat(a.map(vi)))),a}function Ss(n){return n.replace(/left|right|bottom|top/g,e=>Pf[e])}function $f(n){return{top:0,right:0,bottom:0,left:0,...n}}function gl(n){return typeof n!="number"?$f(n):{top:n,right:n,bottom:n,left:n}}function As(n){const{x:e,y:t,width:s,height:r}=n;return{width:s,height:r,top:t,left:e,right:e+s,bottom:t+r,x:e,y:t}}function da(n,e,t){let{reference:s,floating:r}=n;const a=An(e),o=io(e),c=so(o),l=Dn(e),d=a==="y",h=s.x+s.width/2-r.width/2,f=s.y+s.height/2-r.height/2,u=s[c]/2-r[c]/2;let p;switch(l){case"top":p={x:h,y:s.y-r.height};break;case"bottom":p={x:h,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-r.width,y:f};break;default:p={x:s.x,y:s.y}}switch(wr(e)){case"start":p[o]-=u*(t&&d?-1:1);break;case"end":p[o]+=u*(t&&d?-1:1);break}return p}async function Df(n,e){var t;e===void 0&&(e={});const{x:s,y:r,platform:a,rects:o,elements:c,strategy:l}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=$n(e,n),v=gl(p),C=c[u?f==="floating"?"reference":"floating":f],E=As(await a.getClippingRect({element:(t=await(a.isElement==null?void 0:a.isElement(C)))==null||t?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:l})),$=f==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,z=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),P=await(a.isElement==null?void 0:a.isElement(z))?await(a.getScale==null?void 0:a.getScale(z))||{x:1,y:1}:{x:1,y:1},H=As(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:$,offsetParent:z,strategy:l}):$);return{top:(E.top-H.top+v.top)/P.y,bottom:(H.bottom-E.bottom+v.bottom)/P.y,left:(E.left-H.left+v.left)/P.x,right:(H.right-E.right+v.right)/P.x}}const Ff=async(n,e,t)=>{const{placement:s="bottom",strategy:r="absolute",middleware:a=[],platform:o}=t,c=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:n,floating:e,strategy:r}),{x:h,y:f}=da(d,s,l),u=s,p={},v=0;for(let C=0;C<c.length;C++){var y;const{name:E,fn:$}=c[C],{x:z,y:P,data:H,reset:V}=await $({x:h,y:f,initialPlacement:s,placement:u,strategy:r,middlewareData:p,rects:d,platform:{...o,detectOverflow:(y=o.detectOverflow)!=null?y:Df},elements:{reference:n,floating:e}});h=z??h,f=P??f,p={...p,[E]:{...p[E],...H}},V&&v<=50&&(v++,typeof V=="object"&&(V.placement&&(u=V.placement),V.rects&&(d=V.rects===!0?await o.getElementRects({reference:n,floating:e,strategy:r}):V.rects),{x:h,y:f}=da(d,u,l)),C=-1)}return{x:h,y:f,placement:u,strategy:r,middlewareData:p}},Nf=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:s,placement:r,rects:a,platform:o,elements:c,middlewareData:l}=e,{element:d,padding:h=0}=$n(n,e)||{};if(d==null)return{};const f=gl(h),u={x:t,y:s},p=io(r),v=so(p),y=await o.getDimensions(d),C=p==="y",E=C?"top":"left",$=C?"bottom":"right",z=C?"clientHeight":"clientWidth",P=a.reference[v]+a.reference[p]-u[p]-a.floating[v],H=u[p]-a.reference[p],V=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let J=V?V[z]:0;(!J||!await(o.isElement==null?void 0:o.isElement(V)))&&(J=c.floating[z]||a.floating[v]);const he=P/2-H/2,ee=J/2-y[v]/2-1,pe=Un(f[E],ee),te=Un(f[$],ee),ge=pe,U=J-y[v]-te,G=J/2-y[v]/2+he,j=gi(ge,G,U),Y=!l.arrow&&wr(r)!=null&&G!==j&&a.reference[v]/2-(G<ge?pe:te)-y[v]/2<0,we=Y?G<ge?G-ge:G-U:0;return{[p]:u[p]+we,data:{[p]:j,centerOffset:G-j-we,...Y&&{alignmentOffset:we}},reset:Y}}}),Lf=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,s;const{placement:r,middlewareData:a,rects:o,initialPlacement:c,platform:l,elements:d}=e,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...C}=$n(n,e);if((t=a.arrow)!=null&&t.alignmentOffset)return{};const E=Dn(r),$=An(c),z=Dn(c)===c,P=await(l.isRTL==null?void 0:l.isRTL(d.floating)),H=u||(z||!y?[Ss(c)]:Of(c)),V=v!=="none";!u&&V&&H.push(...If(c,y,v,P));const J=[c,...H],he=await l.detectOverflow(e,C),ee=[];let pe=((s=a.flip)==null?void 0:s.overflows)||[];if(h&&ee.push(he[E]),f){const G=Ef(r,o,P);ee.push(he[G[0]],he[G[1]])}if(pe=[...pe,{placement:r,overflows:ee}],!ee.every(G=>G<=0)){var te,ge;const G=(((te=a.flip)==null?void 0:te.index)||0)+1,j=J[G];if(j&&(!(f==="alignment"?$!==An(j):!1)||pe.every(Se=>An(Se.placement)===$?Se.overflows[0]>0:!0)))return{data:{index:G,overflows:pe},reset:{placement:j}};let Y=(ge=pe.filter(we=>we.overflows[0]<=0).sort((we,Se)=>we.overflows[1]-Se.overflows[1])[0])==null?void 0:ge.placement;if(!Y)switch(p){case"bestFit":{var U;const we=(U=pe.filter(Se=>{if(V){const Oe=An(Se.placement);return Oe===$||Oe==="y"}return!0}).map(Se=>[Se.placement,Se.overflows.filter(Oe=>Oe>0).reduce((Oe,at)=>Oe+at,0)]).sort((Se,Oe)=>Se[1]-Oe[1])[0])==null?void 0:U[0];we&&(Y=we);break}case"initialPlacement":Y=c;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function fa(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function ha(n){return Af.some(e=>n[e]>=0)}const Bf=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:s}=e,{strategy:r="referenceHidden",...a}=$n(n,e);switch(r){case"referenceHidden":{const o=await s.detectOverflow(e,{...a,elementContext:"reference"}),c=fa(o,t.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ha(c)}}}case"escaped":{const o=await s.detectOverflow(e,{...a,altBoundary:!0}),c=fa(o,t.floating);return{data:{escapedOffsets:c,escaped:ha(c)}}}default:return{}}}}},vl=new Set(["left","top"]);async function Hf(n,e){const{placement:t,platform:s,elements:r}=n,a=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Dn(t),c=wr(t),l=An(t)==="y",d=vl.has(o)?-1:1,h=a&&l?-1:1,f=$n(e,n);let{mainAxis:u,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof v=="number"&&(p=c==="end"?v*-1:v),l?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Vf=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,s;const{x:r,y:a,placement:o,middlewareData:c}=e,l=await Hf(e,n);return o===((t=c.offset)==null?void 0:t.placement)&&(s=c.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:o}}}}},Wf=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:s,placement:r,platform:a}=e,{mainAxis:o=!0,crossAxis:c=!1,limiter:l={fn:E=>{let{x:$,y:z}=E;return{x:$,y:z}}},...d}=$n(n,e),h={x:t,y:s},f=await a.detectOverflow(e,d),u=An(Dn(r)),p=ro(u);let v=h[p],y=h[u];if(o){const E=p==="y"?"top":"left",$=p==="y"?"bottom":"right",z=v+f[E],P=v-f[$];v=gi(z,v,P)}if(c){const E=u==="y"?"top":"left",$=u==="y"?"bottom":"right",z=y+f[E],P=y-f[$];y=gi(z,y,P)}const C=l.fn({...e,[p]:v,[u]:y});return{...C,data:{x:C.x-t,y:C.y-s,enabled:{[p]:o,[u]:c}}}}}},Kf=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:s,placement:r,rects:a,middlewareData:o}=e,{offset:c=0,mainAxis:l=!0,crossAxis:d=!0}=$n(n,e),h={x:t,y:s},f=An(r),u=ro(f);let p=h[u],v=h[f];const y=$n(c,e),C=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const z=u==="y"?"height":"width",P=a.reference[u]-a.floating[z]+C.mainAxis,H=a.reference[u]+a.reference[z]-C.mainAxis;p<P?p=P:p>H&&(p=H)}if(d){var E,$;const z=u==="y"?"width":"height",P=vl.has(Dn(r)),H=a.reference[f]-a.floating[z]+(P&&((E=o.offset)==null?void 0:E[f])||0)+(P?0:C.crossAxis),V=a.reference[f]+a.reference[z]+(P?0:(($=o.offset)==null?void 0:$[f])||0)-(P?C.crossAxis:0);v<H?v=H:v>V&&(v=V)}return{[u]:p,[f]:v}}}},jf=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,s;const{placement:r,rects:a,platform:o,elements:c}=e,{apply:l=()=>{},...d}=$n(n,e),h=await o.detectOverflow(e,d),f=Dn(r),u=wr(r),p=An(r)==="y",{width:v,height:y}=a.floating;let C,E;f==="top"||f==="bottom"?(C=f,E=u===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(E=f,C=u==="end"?"top":"bottom");const $=y-h.top-h.bottom,z=v-h.left-h.right,P=Un(y-h[C],$),H=Un(v-h[E],z),V=!e.middlewareData.shift;let J=P,he=H;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(he=z),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(J=$),V&&!u){const pe=cn(h.left,0),te=cn(h.right,0),ge=cn(h.top,0),U=cn(h.bottom,0);p?he=v-2*(pe!==0||te!==0?pe+te:cn(h.left,h.right)):J=y-2*(ge!==0||U!==0?ge+U:cn(h.top,h.bottom))}await l({...e,availableWidth:he,availableHeight:J});const ee=await o.getDimensions(c.floating);return v!==ee.width||y!==ee.height?{reset:{rects:!0}}:{}}}};function Bs(){return typeof window<"u"}function xr(n){return ml(n)?(n.nodeName||"").toLowerCase():"#document"}function un(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Tn(n){var e;return(e=(ml(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function ml(n){return Bs()?n instanceof Node||n instanceof un(n).Node:!1}function bn(n){return Bs()?n instanceof Element||n instanceof un(n).Element:!1}function Cn(n){return Bs()?n instanceof HTMLElement||n instanceof un(n).HTMLElement:!1}function pa(n){return!Bs()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof un(n).ShadowRoot}const Uf=new Set(["inline","contents"]);function Ur(n){const{overflow:e,overflowX:t,overflowY:s,display:r}=yn(n);return/auto|scroll|overlay|hidden|clip/.test(e+s+t)&&!Uf.has(r)}const qf=new Set(["table","td","th"]);function Zf(n){return qf.has(xr(n))}const Yf=[":popover-open",":modal"];function Hs(n){return Yf.some(e=>{try{return n.matches(e)}catch{return!1}})}const Gf=["transform","translate","scale","rotate","perspective"],Xf=["transform","translate","scale","rotate","perspective","filter"],Qf=["paint","layout","strict","content"];function oo(n){const e=ao(),t=bn(n)?yn(n):n;return Gf.some(s=>t[s]?t[s]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||Xf.some(s=>(t.willChange||"").includes(s))||Qf.some(s=>(t.contain||"").includes(s))}function Jf(n){let e=qn(n);for(;Cn(e)&&!mr(e);){if(oo(e))return e;if(Hs(e))return null;e=qn(e)}return null}function ao(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const eh=new Set(["html","body","#document"]);function mr(n){return eh.has(xr(n))}function yn(n){return un(n).getComputedStyle(n)}function Vs(n){return bn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function qn(n){if(xr(n)==="html")return n;const e=n.assignedSlot||n.parentNode||pa(n)&&n.host||Tn(n);return pa(e)?e.host:e}function bl(n){const e=qn(n);return mr(e)?n.ownerDocument?n.ownerDocument.body:n.body:Cn(e)&&Ur(e)?e:bl(e)}function Hr(n,e,t){var s;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=bl(n),a=r===((s=n.ownerDocument)==null?void 0:s.body),o=un(r);if(a){const c=mi(o);return e.concat(o,o.visualViewport||[],Ur(r)?r:[],c&&t?Hr(c):[])}return e.concat(r,Hr(r,[],t))}function mi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function yl(n){const e=yn(n);let t=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const r=Cn(n),a=r?n.offsetWidth:t,o=r?n.offsetHeight:s,c=ks(t)!==a||ks(s)!==o;return c&&(t=a,s=o),{width:t,height:s,$:c}}function lo(n){return bn(n)?n:n.contextElement}function hr(n){const e=lo(n);if(!Cn(e))return Pn(1);const t=e.getBoundingClientRect(),{width:s,height:r,$:a}=yl(e);let o=(a?ks(t.width):t.width)/s,c=(a?ks(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const th=Pn(0);function wl(n){const e=un(n);return!ao()||!e.visualViewport?th:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nh(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==un(n)?!1:e}function sr(n,e,t,s){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),a=lo(n);let o=Pn(1);e&&(s?bn(s)&&(o=hr(s)):o=hr(n));const c=nh(a,t,s)?wl(a):Pn(0);let l=(r.left+c.x)/o.x,d=(r.top+c.y)/o.y,h=r.width/o.x,f=r.height/o.y;if(a){const u=un(a),p=s&&bn(s)?un(s):s;let v=u,y=mi(v);for(;y&&s&&p!==v;){const C=hr(y),E=y.getBoundingClientRect(),$=yn(y),z=E.left+(y.clientLeft+parseFloat($.paddingLeft))*C.x,P=E.top+(y.clientTop+parseFloat($.paddingTop))*C.y;l*=C.x,d*=C.y,h*=C.x,f*=C.y,l+=z,d+=P,v=un(y),y=mi(v)}}return As({width:h,height:f,x:l,y:d})}function Ws(n,e){const t=Vs(n).scrollLeft;return e?e.left+t:sr(Tn(n)).left+t}function xl(n,e){const t=n.getBoundingClientRect(),s=t.left+e.scrollLeft-Ws(n,t),r=t.top+e.scrollTop;return{x:s,y:r}}function rh(n){let{elements:e,rect:t,offsetParent:s,strategy:r}=n;const a=r==="fixed",o=Tn(s),c=e?Hs(e.floating):!1;if(s===o||c&&a)return t;let l={scrollLeft:0,scrollTop:0},d=Pn(1);const h=Pn(0),f=Cn(s);if((f||!f&&!a)&&((xr(s)!=="body"||Ur(o))&&(l=Vs(s)),Cn(s))){const p=sr(s);d=hr(s),h.x=p.x+s.clientLeft,h.y=p.y+s.clientTop}const u=o&&!f&&!a?xl(o,l):Pn(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-l.scrollLeft*d.x+h.x+u.x,y:t.y*d.y-l.scrollTop*d.y+h.y+u.y}}function sh(n){return Array.from(n.getClientRects())}function ih(n){const e=Tn(n),t=Vs(n),s=n.ownerDocument.body,r=cn(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),a=cn(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let o=-t.scrollLeft+Ws(n);const c=-t.scrollTop;return yn(s).direction==="rtl"&&(o+=cn(e.clientWidth,s.clientWidth)-r),{width:r,height:a,x:o,y:c}}const ga=25;function oh(n,e){const t=un(n),s=Tn(n),r=t.visualViewport;let a=s.clientWidth,o=s.clientHeight,c=0,l=0;if(r){a=r.width,o=r.height;const h=ao();(!h||h&&e==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const d=Ws(s);if(d<=0){const h=s.ownerDocument,f=h.body,u=getComputedStyle(f),p=h.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,v=Math.abs(s.clientWidth-f.clientWidth-p);v<=ga&&(a-=v)}else d<=ga&&(a+=d);return{width:a,height:o,x:c,y:l}}const ah=new Set(["absolute","fixed"]);function lh(n,e){const t=sr(n,!0,e==="fixed"),s=t.top+n.clientTop,r=t.left+n.clientLeft,a=Cn(n)?hr(n):Pn(1),o=n.clientWidth*a.x,c=n.clientHeight*a.y,l=r*a.x,d=s*a.y;return{width:o,height:c,x:l,y:d}}function va(n,e,t){let s;if(e==="viewport")s=oh(n,t);else if(e==="document")s=ih(Tn(n));else if(bn(e))s=lh(e,t);else{const r=wl(n);s={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return As(s)}function _l(n,e){const t=qn(n);return t===e||!bn(t)||mr(t)?!1:yn(t).position==="fixed"||_l(t,e)}function ch(n,e){const t=e.get(n);if(t)return t;let s=Hr(n,[],!1).filter(c=>bn(c)&&xr(c)!=="body"),r=null;const a=yn(n).position==="fixed";let o=a?qn(n):n;for(;bn(o)&&!mr(o);){const c=yn(o),l=oo(o);!l&&c.position==="fixed"&&(r=null),(a?!l&&!r:!l&&c.position==="static"&&!!r&&ah.has(r.position)||Ur(o)&&!l&&_l(n,o))?s=s.filter(h=>h!==o):r=c,o=qn(o)}return e.set(n,s),s}function uh(n){let{element:e,boundary:t,rootBoundary:s,strategy:r}=n;const o=[...t==="clippingAncestors"?Hs(e)?[]:ch(e,this._c):[].concat(t),s],c=o[0],l=o.reduce((d,h)=>{const f=va(e,h,r);return d.top=cn(f.top,d.top),d.right=Un(f.right,d.right),d.bottom=Un(f.bottom,d.bottom),d.left=cn(f.left,d.left),d},va(e,c,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dh(n){const{width:e,height:t}=yl(n);return{width:e,height:t}}function fh(n,e,t){const s=Cn(e),r=Tn(e),a=t==="fixed",o=sr(n,!0,a,e);let c={scrollLeft:0,scrollTop:0};const l=Pn(0);function d(){l.x=Ws(r)}if(s||!s&&!a)if((xr(e)!=="body"||Ur(r))&&(c=Vs(e)),s){const p=sr(e,!0,a,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else r&&d();a&&!s&&r&&d();const h=r&&!s&&!a?xl(r,c):Pn(0),f=o.left+c.scrollLeft-l.x-h.x,u=o.top+c.scrollTop-l.y-h.y;return{x:f,y:u,width:o.width,height:o.height}}function ii(n){return yn(n).position==="static"}function ma(n,e){if(!Cn(n)||yn(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Tn(n)===t&&(t=t.ownerDocument.body),t}function kl(n,e){const t=un(n);if(Hs(n))return t;if(!Cn(n)){let r=qn(n);for(;r&&!mr(r);){if(bn(r)&&!ii(r))return r;r=qn(r)}return t}let s=ma(n,e);for(;s&&Zf(s)&&ii(s);)s=ma(s,e);return s&&mr(s)&&ii(s)&&!oo(s)?t:s||Jf(n)||t}const hh=async function(n){const e=this.getOffsetParent||kl,t=this.getDimensions,s=await t(n.floating);return{reference:fh(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function ph(n){return yn(n).direction==="rtl"}const gh={convertOffsetParentRelativeRectToViewportRelativeRect:rh,getDocumentElement:Tn,getClippingRect:uh,getOffsetParent:kl,getElementRects:hh,getClientRects:sh,getDimensions:dh,getScale:hr,isElement:bn,isRTL:ph};function Sl(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function vh(n,e){let t=null,s;const r=Tn(n);function a(){var c;clearTimeout(s),(c=t)==null||c.disconnect(),t=null}function o(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),a();const d=n.getBoundingClientRect(),{left:h,top:f,width:u,height:p}=d;if(c||e(),!u||!p)return;const v=ns(f),y=ns(r.clientWidth-(h+u)),C=ns(r.clientHeight-(f+p)),E=ns(h),z={rootMargin:-v+"px "+-y+"px "+-C+"px "+-E+"px",threshold:cn(0,Un(1,l))||1};let P=!0;function H(V){const J=V[0].intersectionRatio;if(J!==l){if(!P)return o();J?o(!1,J):s=setTimeout(()=>{o(!1,1e-7)},1e3)}J===1&&!Sl(d,n.getBoundingClientRect())&&o(),P=!1}try{t=new IntersectionObserver(H,{...z,root:r.ownerDocument})}catch{t=new IntersectionObserver(H,z)}t.observe(n)}return o(!0),a}function mh(n,e,t,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=lo(n),h=r||a?[...d?Hr(d):[],...Hr(e)]:[];h.forEach(E=>{r&&E.addEventListener("scroll",t,{passive:!0}),a&&E.addEventListener("resize",t)});const f=d&&c?vh(d,t):null;let u=-1,p=null;o&&(p=new ResizeObserver(E=>{let[$]=E;$&&$.target===d&&p&&(p.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var z;(z=p)==null||z.observe(e)})),t()}),d&&!l&&p.observe(d),p.observe(e));let v,y=l?sr(n):null;l&&C();function C(){const E=sr(n);y&&!Sl(y,E)&&t(),y=E,v=requestAnimationFrame(C)}return t(),()=>{var E;h.forEach($=>{r&&$.removeEventListener("scroll",t),a&&$.removeEventListener("resize",t)}),f?.(),(E=p)==null||E.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const bh=Vf,yh=Wf,wh=Lf,xh=jf,_h=Bf,kh=Nf,Sh=Kf,Ah=(n,e,t)=>{const s=new Map,r={platform:gh,...t},a={...r.platform,_c:s};return Ff(n,e,{...r,platform:a})};function Gn(n){return typeof n=="function"?n():n}function Al(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ba(n,e){const t=Al(n);return Math.round(e*t)/t}function ya(n){return{[`--bits-${n}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${n}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${n}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${n}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${n}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function Ph(n){const e=n.whileElementsMounted,t=x(()=>Gn(n.open)??!0),s=x(()=>Gn(n.middleware)),r=x(()=>Gn(n.transform)??!0),a=x(()=>Gn(n.placement)??"bottom"),o=x(()=>Gn(n.strategy)??"absolute"),c=x(()=>Gn(n.sideOffset)??0),l=x(()=>Gn(n.alignOffset)??0),d=n.reference;let h=L(0),f=L(0);const u=Sn(null);let p=L(en(i(o))),v=L(en(i(a))),y=L(en({})),C=L(!1),E=!1;const $=x(()=>{const ee=u.current?ba(u.current,i(h)):i(h),pe=u.current?ba(u.current,i(f)):i(f);return i(r)?{position:i(p),left:"0",top:"0",transform:`translate(${ee}px, ${pe}px)`,...u.current&&Al(u.current)>=1.5&&{willChange:"transform"}}:{position:i(p),left:`${ee}px`,top:`${pe}px`}});let z;function P(){d.current===null||u.current===null||Ah(d.current,u.current,{middleware:i(s),placement:i(a),strategy:i(o)}).then(ee=>{const pe=d.current;if(Ch(pe)){m(y,{...i(y),hide:{...i(y).hide,referenceHidden:!0}},!0);return}if(!i(t)&&i(h)!==0&&i(f)!==0){const ge=Math.max(Math.abs(i(c)),Math.abs(i(l)),15);if(ee.x<=ge&&ee.y<=ge)return}m(h,ee.x,!0),m(f,ee.y,!0),m(p,ee.strategy,!0),m(v,ee.placement,!0),m(y,ee.middlewareData,!0),m(C,!0)})}function H(){typeof z=="function"&&(z(),z=void 0)}function V(){if(H(),e===void 0){P();return}i(t)&&(d.current===null||u.current===null||(z=e(d.current,u.current,P)))}function J(){i(t)||m(C,!1)}function he(){return[i(s),i(a),i(o),i(c),i(l),i(t)]}return mt(()=>{e===void 0&&i(t)&&P()}),mt(V),mt(()=>{if(e!==void 0){if(he(),!i(t)){E=!1;return}if(!i(C)){E=!1;return}if(!E){E=!0;return}P()}}),mt(J),mt(()=>H),{floating:u,reference:d,get strategy(){return i(p)},get placement(){return i(v)},get middlewareData(){return i(y)},get isPositioned(){return i(C)},get floatingStyles(){return i($)},get update(){return P}}}function Ch(n){return n instanceof Element?!n.isConnected||n instanceof HTMLElement&&n.hidden?!0:n.getClientRects().length===0:!1}const Th={top:"bottom",right:"left",bottom:"top",left:"right"},co=new Fn("Floating.Root"),wa=new Fn("Floating.Content"),uo=new Fn("Floating.Root");class Ps{static create(e=!1){return e?uo.set(new Ps):co.set(new Ps)}anchorNode=Sn(null);customAnchorNode=Sn(null);triggerNode=Sn(null);constructor(){mt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class Cs{static create(e,t=!1){return t?wa.set(new Cs(e,uo.get())):wa.set(new Cs(e,co.get()))}opts;root;contentRef=Sn(null);wrapperRef=Sn(null);arrowRef=Sn(null);contentAttachment=Ft(this.contentRef);wrapperAttachment=Ft(this.wrapperRef);arrowAttachment=Ft(this.arrowRef);arrowId=Sn(no());#e=x(()=>{if(typeof this.opts.style=="string")return Dr(this.opts.style);if(!this.opts.style)return{}});#t=void 0;#n=new Wu(()=>this.arrowRef.current??void 0);#r=x(()=>this.#n?.width??0);#s=x(()=>this.#n?.height??0);#i=x(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=x(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#o=x(()=>i(this.#a).length>0);get hasExplicitBoundaries(){return i(this.#o)}set hasExplicitBoundaries(e){m(this.#o,e)}#l=x(()=>({padding:this.opts.collisionPadding.current,boundary:i(this.#a).filter(ld),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return i(this.#l)}set detectOverflowOptions(e){m(this.#l,e)}#u=L(void 0);#c=L(void 0);#d=L(void 0);#h=L(void 0);#p=x(()=>[bh({mainAxis:this.opts.sideOffset.current+i(this.#s),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&yh({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?Sh():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&wh({...this.detectOverflowOptions}),xh({...this.detectOverflowOptions,apply:({rects:e,availableWidth:t,availableHeight:s})=>{const{width:r,height:a}=e.reference;m(this.#u,t,!0),m(this.#c,s,!0),m(this.#d,r,!0),m(this.#h,a,!0)}}),this.arrowRef.current&&kh({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),Eh({arrowWidth:i(this.#r),arrowHeight:i(this.#s)}),this.opts.hideWhenDetached.current&&_h({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return i(this.#p)}set middleware(e){m(this.#p,e)}floating;#g=x(()=>Oh(this.floating.placement));get placedSide(){return i(this.#g)}set placedSide(e){m(this.#g,e)}#v=x(()=>zh(this.floating.placement));get placedAlign(){return i(this.#v)}set placedAlign(e){m(this.#v,e)}#f=x(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return i(this.#f)}set arrowX(e){m(this.#f,e)}#m=x(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return i(this.#m)}set arrowY(e){m(this.#m,e)}#b=x(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return i(this.#b)}set cannotCenterArrow(e){m(this.#b,e)}#y=L();get contentZIndex(){return i(this.#y)}set contentZIndex(e){m(this.#y,e,!0)}#w=x(()=>Th[this.placedSide]);get arrowBaseSide(){return i(this.#w)}set arrowBaseSide(e){m(this.#w,e)}#x=x(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${i(this.#u)}px`,"--bits-floating-available-height":`${i(this.#c)}px`,"--bits-floating-anchor-width":`${i(this.#d)}px`,"--bits-floating-anchor-height":`${i(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...i(this.#e)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return i(this.#x)}set wrapperProps(e){m(this.#x,e)}#_=x(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Da({...i(this.#e)}),...this.contentAttachment}));get props(){return i(this.#_)}set props(e){m(this.#_,e)}#k=x(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return i(this.#k)}set arrowStyle(e){m(this.#k,e)}constructor(e,t){this.opts=e,this.root=t,this.#t=e.updatePositionStrategy,e.customAnchor&&(this.root.customAnchorNode.current=e.customAnchor.current),Tt(()=>e.customAnchor.current,s=>{this.root.customAnchorNode.current=s}),this.floating=Ph({strategy:()=>this.opts.strategy.current,placement:()=>i(this.#i),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...s)=>mh(...s,{animationFrame:this.#t?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),mt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),Tt(()=>this.contentRef.current,s=>{if(!s||!this.opts.enabled.current)return;const r=Ai(s),a=r.requestAnimationFrame(()=>{if(this.contentRef.current!==s||!this.opts.enabled.current)return;const o=r.getComputedStyle(s).zIndex;o!==this.contentZIndex&&(this.contentZIndex=o)});return()=>{r.cancelAnimationFrame(a)}}),mt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class Ts{static create(e,t=!1){return t?new Ts(e,uo.get()):new Ts(e,co.get())}opts;root;constructor(e,t){this.opts=e,this.root=t,e.virtualEl&&e.virtualEl.current?t.triggerNode=Ma(e.virtualEl.current):t.triggerNode=e.ref}}function Eh(n){return{name:"transformOrigin",options:n,fn(e){const{placement:t,rects:s,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,c=o?0:n.arrowWidth,l=o?0:n.arrowHeight,[d,h]=fo(t),f={start:"0%",center:"50%",end:"100%"}[h],u=(r.arrow?.x??0)+c/2,p=(r.arrow?.y??0)+l/2;let v="",y="";return d==="bottom"?(v=o?f:`${u}px`,y=`${-l}px`):d==="top"?(v=o?f:`${u}px`,y=`${s.floating.height+l}px`):d==="right"?(v=`${-l}px`,y=o?f:`${p}px`):d==="left"&&(v=`${s.floating.width+l}px`,y=o?f:`${p}px`),{data:{x:v,y}}}}}function fo(n){const[e,t="center"]=n.split("-");return[e,t]}function Oh(n){return fo(n)[0]}function zh(n){return fo(n)[1]}function Rh(n,e){F(e,!0);let t=w(e,"tooltip",3,!1);Ps.create(t());var s=I(),r=A(s);se(r,()=>e.children??Te),g(n,s),N()}function Mh(n,e){F(e,!0);let t=w(e,"tooltip",3,!1);Ts.create({id:M(()=>e.id),virtualEl:M(()=>e.virtualEl),ref:e.ref},t());var s=I(),r=A(s);se(r,()=>e.children??Te),g(n,s),N()}function Ih(n,e){F(e,!0);let t=w(e,"side",3,"bottom"),s=w(e,"sideOffset",3,0),r=w(e,"align",3,"center"),a=w(e,"alignOffset",3,0),o=w(e,"arrowPadding",3,0),c=w(e,"avoidCollisions",3,!0),l=w(e,"collisionBoundary",19,()=>[]),d=w(e,"collisionPadding",3,0),h=w(e,"hideWhenDetached",3,!1),f=w(e,"onPlaced",3,()=>{}),u=w(e,"sticky",3,"partial"),p=w(e,"updatePositionStrategy",3,"optimized"),v=w(e,"strategy",3,"fixed"),y=w(e,"dir",3,"ltr"),C=w(e,"style",19,()=>({})),E=w(e,"wrapperId",19,no),$=w(e,"customAnchor",3,null),z=w(e,"tooltip",3,!1);const P=Cs.create({side:M(()=>t()),sideOffset:M(()=>s()),align:M(()=>r()),alignOffset:M(()=>a()),id:M(()=>e.id),arrowPadding:M(()=>o()),avoidCollisions:M(()=>c()),collisionBoundary:M(()=>l()),collisionPadding:M(()=>d()),hideWhenDetached:M(()=>h()),onPlaced:M(()=>f()),sticky:M(()=>u()),updatePositionStrategy:M(()=>p()),strategy:M(()=>v()),dir:M(()=>y()),style:M(()=>C()),enabled:M(()=>e.enabled),wrapperId:M(()=>E()),customAnchor:M(()=>$())},z()),H=x(()=>tt(P.wrapperProps,{style:{pointerEvents:"auto"}}));var V=I(),J=A(V);se(J,()=>e.content??Te,()=>({props:P.props,wrapperProps:i(H)})),g(n,V),N()}function $h(n,e){F(e,!0),Is(()=>{e.onPlaced?.()});var t=I(),s=A(t);se(s,()=>e.content??Te,()=>({props:{},wrapperProps:{}})),g(n,t),N()}function Dh(n,e){let t=w(e,"isStatic",3,!1),s=Fe(e,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var r=I(),a=A(r);{var o=l=>{$h(l,{get content(){return e.content},get onPlaced(){return e.onPlaced}})},c=l=>{Ih(l,ot({get content(){return e.content},get onPlaced(){return e.onPlaced}},()=>s))};O(a,l=>{t()?l(o):l(c,!1)})}g(n,r)}var Fh=T("<!> <!>",1);function Pl(n,e){F(e,!0);let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"trapFocus",3,!0),r=w(e,"isValidEvent",3,()=>!1),a=w(e,"customAnchor",3,null),o=w(e,"isStatic",3,!1),c=w(e,"tooltip",3,!1),l=w(e,"contentPointerEvents",3,"auto"),d=Fe(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);Dh(n,{get isStatic(){return o()},get id(){return e.id},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get enabled(){return e.enabled},get tooltip(){return c()},content:(f,u)=>{let p=()=>u?.().props,v=()=>u?.().wrapperProps;var y=Fh(),C=A(y);{var E=P=>{vr(P,{get preventScroll(){return e.preventScroll}})},$=P=>{vr(P,{get preventScroll(){return e.preventScroll}})};O(C,P=>{e.forceMount&&e.enabled?P(E):e.forceMount||P($,1)})}var z=D(C,2);Ji(z,{get onOpenAutoFocus(){return e.onOpenAutoFocus},get onCloseAutoFocus(){return e.onCloseAutoFocus},get loop(){return e.loop},get enabled(){return e.enabled},get trapFocus(){return s()},get forceMount(){return e.forceMount},get ref(){return e.ref},focusScope:(H,V)=>{let J=()=>V?.().props;Gi(H,{get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get enabled(){return e.enabled},get ref(){return e.ref},children:(he,ee)=>{Zi(he,{get id(){return e.id},get onInteractOutside(){return e.onInteractOutside},get onFocusOutside(){return e.onFocusOutside},get interactOutsideBehavior(){return t()},get isValidEvent(){return r()},get enabled(){return e.enabled},get ref(){return e.ref},children:(te,ge)=>{let U=()=>ge?.().props;to(te,{get id(){return e.id},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get enabled(){return e.enabled},get ref(){return e.ref},children:(G,j)=>{var Y=I(),we=A(Y);{let Se=x(()=>({props:tt(d,p(),U(),J(),{style:{pointerEvents:l()}}),wrapperProps:v()}));se(we,()=>e.popper??Te,()=>i(Se))}g(G,Y)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),g(f,y)},$$slots:{content:!0}}),N()}function Nh(n,e){let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"trapFocus",3,!0),r=w(e,"isValidEvent",3,()=>!1),a=w(e,"customAnchor",3,null),o=w(e,"isStatic",3,!1),c=Fe(e,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=I(),d=A(l);{var h=f=>{Pl(f,ot({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return e.open},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return t()},get loop(){return e.loop},get trapFocus(){return s()},get isValidEvent(){return r()},get onFocusOutside(){return e.onFocusOutside},forceMount:!1,get ref(){return e.ref}},()=>c))};O(d,f=>{e.shouldRender&&f(h)})}g(n,l)}function Lh(n,e){let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"trapFocus",3,!0),r=w(e,"isValidEvent",3,()=>!1),a=w(e,"customAnchor",3,null),o=w(e,"isStatic",3,!1),c=Fe(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);Pl(n,ot({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return e.enabled},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return t()},get loop(){return e.loop},get trapFocus(){return s()},get isValidEvent(){return r()},get onFocusOutside(){return e.onFocusOutside}},()=>c,{forceMount:!0}))}var Bh=T("<div><!></div>");function Hh(n,e){const t=Yt();F(e,!0);let s=w(e,"ref",15,null),r=w(e,"id",19,()=>Gt(t)),a=w(e,"disabled",3,!1),o=w(e,"onSelect",3,Ve),c=w(e,"closeOnSelect",3,!0),l=Fe(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const d=Ki.create({id:M(()=>r()),disabled:M(()=>a()),onSelect:M(()=>o()),ref:M(()=>s(),y=>s(y)),closeOnSelect:M(()=>c())}),h=x(()=>tt(l,d.props));var f=I(),u=A(f);{var p=y=>{var C=I(),E=A(C);se(E,()=>e.child,()=>({props:i(h)})),g(y,C)},v=y=>{var C=Bh();ye(C,()=>({...i(h)}));var E=S(C);se(E,()=>e.children??Te),k(C),g(y,C)};O(u,y=>{e.child?y(p):y(v,!1)})}g(n,f),N()}var Vh=T("<div><!></div>");function Wh(n,e){const t=Yt();F(e,!0);let s=w(e,"ref",15,null),r=w(e,"id",19,()=>Gt(t)),a=Fe(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const o=ji.create({id:M(()=>r()),ref:M(()=>s(),u=>s(u))}),c=x(()=>tt(a,o.props));var l=I(),d=A(l);{var h=u=>{var p=I(),v=A(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=Vh();ye(p,()=>({...i(c)}));var v=S(p);se(v,()=>e.children??Te),k(p),g(u,p)};O(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),N()}function Kh(n,e){F(e,!0);let t=w(e,"open",15,!1),s=w(e,"onOpenChange",3,Ve),r=w(e,"onOpenChangeComplete",3,Ve);Ns.create({variant:M(()=>"dialog"),open:M(()=>t(),c=>{t(c),s()(c)}),onOpenChangeComplete:M(()=>r())});var a=I(),o=A(a);se(o,()=>e.children??Te),g(n,a),N()}var jh=T("<button><!></button>");function Uh(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"disabled",3,!1),o=Fe(e,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const c=Ri.create({variant:M(()=>"close"),id:M(()=>s()),ref:M(()=>r(),p=>r(p)),disabled:M(()=>!!a())}),l=x(()=>tt(o,c.props));var d=I(),h=A(d);{var f=p=>{var v=I(),y=A(v);se(y,()=>e.child,()=>({props:i(l)})),g(p,v)},u=p=>{var v=jh();ye(v,()=>({...i(l)}));var y=S(v);se(y,()=>e.children??Te),k(v),g(p,v)};O(h,p=>{e.child?p(f):p(u,!1)})}g(n,d),N()}var qh=T("<!> <!>",1),Zh=T("<!> <div><!></div>",1);function Yh(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"forceMount",3,!1),o=w(e,"onCloseAutoFocus",3,Ve),c=w(e,"onOpenAutoFocus",3,Ve),l=w(e,"onEscapeKeydown",3,Ve),d=w(e,"onInteractOutside",3,Ve),h=w(e,"trapFocus",3,!0),f=w(e,"preventScroll",3,!0),u=w(e,"restoreScrollDelay",3,null),p=Fe(e,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const v=Ls.create({id:M(()=>s()),ref:M(()=>r(),z=>r(z))}),y=x(()=>tt(p,v.props));var C=I(),E=A(C);{var $=z=>{Ji(z,{get ref(){return v.opts.ref},loop:!0,get trapFocus(){return h()},get enabled(){return v.root.opts.open.current},get onOpenAutoFocus(){return c()},get onCloseAutoFocus(){return o()},focusScope:(H,V)=>{let J=()=>V?.().props;Gi(H,ot(()=>i(y),{get enabled(){return v.root.opts.open.current},get ref(){return v.opts.ref},onEscapeKeydown:he=>{l()(he),!he.defaultPrevented&&v.root.handleClose()},children:(he,ee)=>{Zi(he,ot(()=>i(y),{get ref(){return v.opts.ref},get enabled(){return v.root.opts.open.current},onInteractOutside:pe=>{d()(pe),!pe.defaultPrevented&&v.root.handleClose()},children:(pe,te)=>{to(pe,ot(()=>i(y),{get ref(){return v.opts.ref},get enabled(){return v.root.opts.open.current},children:(ge,U)=>{var G=I(),j=A(G);{var Y=Se=>{var Oe=qh(),at=A(Oe);{var ft=X=>{vr(X,{get preventScroll(){return f()},get restoreScrollDelay(){return u()}})};O(at,X=>{v.root.opts.open.current&&X(ft)})}var kt=D(at,2);{let X=x(()=>({props:tt(i(y),J()),...v.snippetProps}));se(kt,()=>e.child,()=>i(X))}g(Se,Oe)},we=Se=>{var Oe=Zh(),at=A(Oe);vr(at,{get preventScroll(){return f()}});var ft=D(at,2);ye(ft,X=>({...X}),[()=>tt(i(y),J())]);var kt=S(ft);se(kt,()=>e.children??Te),k(ft),g(Se,Oe)};O(j,Se=>{e.child?Se(Y):Se(we,!1)})}g(ge,G)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};O(E,z=>{(v.shouldRender||a())&&z($)})}g(n,C),N()}function Gh(n,e){F(e,!0);let t=w(e,"open",15,!1),s=w(e,"dir",3,"ltr"),r=w(e,"onOpenChange",3,Ve),a=w(e,"onOpenChangeComplete",3,Ve),o=w(e,"_internal_variant",3,"dropdown-menu");const c=Hi.create({variant:M(()=>o()),dir:M(()=>s()),onClose:()=>{t(!1),r()(!1)}});Vi.create({open:M(()=>t(),l=>{t(l),r()(l)}),onOpenChangeComplete:M(()=>a())},c),Rh(n,{children:(l,d)=>{var h=I(),f=A(h);se(f,()=>e.children??Te),g(l,h)},$$slots:{default:!0}}),N()}var Xh=T("<div><div><!></div></div>"),Qh=T("<div><div><!></div></div>");function Jh(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"loop",3,!0),o=w(e,"onInteractOutside",3,Ve),c=w(e,"onEscapeKeydown",3,Ve),l=w(e,"onCloseAutoFocus",3,Ve),d=w(e,"forceMount",3,!1),h=w(e,"trapFocus",3,!1),f=Fe(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const u=Wi.create({id:M(()=>s()),loop:M(()=>a()),ref:M(()=>r(),P=>r(P)),onCloseAutoFocus:M(()=>l())}),p=x(()=>tt(f,u.props));function v(P){if(u.handleInteractOutside(P),!P.defaultPrevented&&(o()(P),!P.defaultPrevented)){if(P.target&&P.target instanceof Element){const H=`[${u.parentMenu.root.getBitsAttr("sub-content")}]`;if(P.target.closest(H))return}u.parentMenu.onClose()}}function y(P){c()(P),!P.defaultPrevented&&u.parentMenu.onClose()}var C=I(),E=A(C);{var $=P=>{Lh(P,ot(()=>i(p),()=>u.popperProps,{get ref(){return u.opts.ref},get enabled(){return u.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:y,get trapFocus(){return h()},get loop(){return a()},forceMount:!0,get id(){return s()},get shouldRender(){return u.shouldRender},popper:(V,J)=>{let he=()=>J?.().props,ee=()=>J?.().wrapperProps;const pe=x(()=>tt(he(),{style:ya("dropdown-menu")},{style:e.style}));var te=I(),ge=A(te);{var U=j=>{var Y=I(),we=A(Y);{let Se=x(()=>({props:i(pe),wrapperProps:ee(),...u.snippetProps}));se(we,()=>e.child,()=>i(Se))}g(j,Y)},G=j=>{var Y=Xh();ye(Y,()=>({...ee()}));var we=S(Y);ye(we,()=>({...i(pe)}));var Se=S(we);se(Se,()=>e.children??Te),k(we),k(Y),g(j,Y)};O(ge,j=>{e.child?j(U):j(G,!1)})}g(V,te)},$$slots:{popper:!0}}))},z=P=>{Nh(P,ot(()=>i(p),()=>u.popperProps,{get ref(){return u.opts.ref},get open(){return u.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:y,get trapFocus(){return h()},get loop(){return a()},forceMount:!1,get id(){return s()},get shouldRender(){return u.shouldRender},popper:(V,J)=>{let he=()=>J?.().props,ee=()=>J?.().wrapperProps;const pe=x(()=>tt(he(),{style:ya("dropdown-menu")},{style:e.style}));var te=I(),ge=A(te);{var U=j=>{var Y=I(),we=A(Y);{let Se=x(()=>({props:i(pe),wrapperProps:ee(),...u.snippetProps}));se(we,()=>e.child,()=>i(Se))}g(j,Y)},G=j=>{var Y=Qh();ye(Y,()=>({...ee()}));var we=S(Y);ye(we,()=>({...i(pe)}));var Se=S(we);se(Se,()=>e.children??Te),k(we),k(Y),g(j,Y)};O(ge,j=>{e.child?j(U):j(G,!1)})}g(V,te)},$$slots:{popper:!0}}))};O(E,P=>{d()?P($):d()||P(z,1)})}g(n,C),N()}var ep=T("<button><!></button>");function tp(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"disabled",3,!1),o=w(e,"type",3,"button"),c=Fe(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=Ui.create({id:M(()=>s()),disabled:M(()=>a()??!1),ref:M(()=>r(),h=>r(h))}),d=x(()=>tt(c,l.props,{type:o()}));Mh(n,{get id(){return s()},get ref(){return l.opts.ref},children:(h,f)=>{var u=I(),p=A(u);{var v=C=>{var E=I(),$=A(E);se($,()=>e.child,()=>({props:i(d)})),g(C,E)},y=C=>{var E=ep();ye(E,()=>({...i(d)}));var $=S(E);se($,()=>e.children??Te),k(E),g(C,E)};O(p,C=>{e.child?C(v):C(y,!1)})}g(h,u)},$$slots:{default:!0}}),N()}const Es=Ei({component:"tabs",parts:["root","list","trigger","content"]}),ho=new Fn("Tabs.Root");class po{static create(e){return ho.set(new po(e))}opts;attachment;rovingFocusGroup;#e=L(en([]));get triggerIds(){return i(this.#e)}set triggerIds(e){m(this.#e,e,!0)}valueToTriggerId=new ci;valueToContentId=new ci;constructor(e){this.opts=e,this.attachment=Ft(e.ref),this.rovingFocusGroup=new Ua({candidateAttr:Es.trigger,rootNode:this.opts.ref,loop:this.opts.loop,orientation:this.opts.orientation})}registerTrigger(e,t){return this.triggerIds.push(e),this.valueToTriggerId.set(t,e),()=>{this.triggerIds=this.triggerIds.filter(s=>s!==e),this.valueToTriggerId.delete(t)}}registerContent(e,t){return this.valueToContentId.set(t,e),()=>{this.valueToContentId.delete(t)}}setValue(e){this.opts.value.current=e}#t=x(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,[Es.root]:"",...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}class go{static create(e){return new go(e,ho.get())}opts;root;attachment;#e=x(()=>this.root.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(e.ref)}#t=x(()=>({id:this.opts.id.current,role:"tablist","aria-orientation":this.root.opts.orientation.current,"data-orientation":this.root.opts.orientation.current,[Es.list]:"","data-disabled":jn(i(this.#e)),...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}class vo{static create(e){return new vo(e,ho.get())}opts;root;attachment;#e=L(0);#t=x(()=>this.root.opts.value.current===this.opts.value.current);#n=x(()=>this.opts.disabled.current||this.root.opts.disabled.current);#r=x(()=>this.root.valueToContentId.get(this.opts.value.current));constructor(e,t){this.opts=e,this.root=t,this.attachment=Ft(e.ref),Tt([()=>this.opts.id.current,()=>this.opts.value.current],([s,r])=>this.root.registerTrigger(s,r)),mt(()=>{this.root.triggerIds.length,i(this.#t)||!this.root.opts.value.current?m(this.#e,0):m(this.#e,-1)}),this.onfocus=this.onfocus.bind(this),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#s(){this.root.opts.value.current!==this.opts.value.current&&this.root.setValue(this.opts.value.current)}onfocus(e){this.root.opts.activationMode.current!=="automatic"||i(this.#n)||this.#s()}onclick(e){i(this.#n)||this.#s()}onkeydown(e){if(!i(this.#n)){if(e.key===yr||e.key===jr){e.preventDefault(),this.#s();return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#i=x(()=>({id:this.opts.id.current,role:"tab","data-state":np(i(this.#t)),"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":jn(i(this.#n)),"aria-selected":Ci(i(this.#t)),"aria-controls":i(this.#r),[Es.trigger]:"",disabled:Xu(i(this.#n)),tabindex:i(this.#e),onclick:this.onclick,onfocus:this.onfocus,onkeydown:this.onkeydown,...this.attachment}));get props(){return i(this.#i)}set props(e){m(this.#i,e)}}function np(n){return n?"active":"inactive"}var rp=T("<div><!></div>");function sp(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"value",15,""),o=w(e,"onValueChange",3,Ve),c=w(e,"orientation",3,"horizontal"),l=w(e,"loop",3,!0),d=w(e,"activationMode",3,"automatic"),h=w(e,"disabled",3,!1),f=Fe(e,["$$slots","$$events","$$legacy","id","ref","value","onValueChange","orientation","loop","activationMode","disabled","children","child"]);const u=po.create({id:M(()=>s()),value:M(()=>a(),$=>{a($),o()($)}),orientation:M(()=>c()),loop:M(()=>l()),activationMode:M(()=>d()),disabled:M(()=>h()),ref:M(()=>r(),$=>r($))}),p=x(()=>tt(f,u.props));var v=I(),y=A(v);{var C=$=>{var z=I(),P=A(z);se(P,()=>e.child,()=>({props:i(p)})),g($,z)},E=$=>{var z=rp();ye(z,()=>({...i(p)}));var P=S(z);se(P,()=>e.children??Te),k(z),g($,z)};O(y,$=>{e.child?$(C):$(E,!1)})}g(n,v),N()}var ip=T("<div><!></div>");function op(n,e){const t=Yt();F(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=Fe(e,["$$slots","$$events","$$legacy","child","children","id","ref"]);const o=go.create({id:M(()=>s()),ref:M(()=>r(),u=>r(u))}),c=x(()=>tt(a,o.props));var l=I(),d=A(l);{var h=u=>{var p=I(),v=A(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=ip();ye(p,()=>({...i(c)}));var v=S(p);se(v,()=>e.children??Te),k(p),g(u,p)};O(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),N()}var ap=T("<button><!></button>");function lp(n,e){const t=Yt();F(e,!0);let s=w(e,"disabled",3,!1),r=w(e,"id",19,()=>Gt(t)),a=w(e,"type",3,"button"),o=w(e,"ref",15,null),c=Fe(e,["$$slots","$$events","$$legacy","child","children","disabled","id","type","value","ref"]);const l=vo.create({id:M(()=>r()),disabled:M(()=>s()??!1),value:M(()=>e.value),ref:M(()=>o(),v=>o(v))}),d=x(()=>tt(c,l.props,{type:a()}));var h=I(),f=A(h);{var u=v=>{var y=I(),C=A(y);se(C,()=>e.child,()=>({props:i(d)})),g(v,y)},p=v=>{var y=ap();ye(y,()=>({...i(d)}));var C=S(y);se(C,()=>e.children??Te),k(y),g(v,y)};O(f,v=>{e.child?v(u):v(p,!1)})}g(n,h),N()}const rs=Gh,ss=tp,is=Ni,os=Jh,Xn=Hh,w0=Wh;var cp=ue("<title> </title>"),up=ue('<svg><!><path d="M18 22 19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22z"></path><path d="M2 18H16V20H2z"></path><path d="M6 12H16V14H6z"></path><path d="M10 6H16V8H10z"></path></svg>');function dp(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=up();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=cp(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(4),k(l),g(n,l),N()}var fp=ue("<title> </title>"),hp=ue('<svg><!><path d="M18 22 19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22z"></path><path d="M2 6H16V8H2z"></path><path d="M6 12H16V14H6z"></path><path d="M10 18H16V20H10z"></path></svg>');function pp(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=hp();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=fp(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(4),k(l),g(n,l),N()}function gp(n){return Kt(`/api/repos/${encodeURIComponent(n)}/sync`,{method:"POST"})}function vp(){return Kt("/api/sync",{method:"POST"})}function x0(n,e,t){return Kt(`/api/repos/${encodeURIComponent(n)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(t)}/refresh`,{method:"POST"})}function _0(n,e,t){return Kt(`/api/repos/${encodeURIComponent(n)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(t)}/refresh/apply`,{method:"POST"})}function k0(){return Kt("/api/sources")}function S0(){return Kt("/api/connectors")}function A0(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/config`)}function P0(n,e){return Kt(`/api/connectors/${encodeURIComponent(n)}/config`,{method:"POST",body:JSON.stringify({...e,name:n})})}function C0(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/config`,{method:"DELETE"})}function T0(n){return Kt(`/api/sources/${encodeURIComponent(n)}`)}function E0(n,e){return Kt(`/api/sources/${encodeURIComponent(n)}`,{method:"POST",body:JSON.stringify(e)})}function O0(n,e){return Kt(`/api/repos/${encodeURIComponent(n)}`,{method:"PATCH",body:JSON.stringify({sync:e})})}function z0(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/oauth/authorize`,{method:"POST"})}function R0(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/oauth/status`)}function M0(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/oauth/disconnect`,{method:"POST"})}function mp(){let n=L(en({})),e=null,t=null;function s(p,v,y){t&&(clearInterval(t),t=null),e=`${p}/${v}/${y}`,a("enter",p,v,y),t=setInterval(()=>{e&&a("heartbeat",p,v,y)},3e4)}function r(){if(t&&(clearInterval(t),t=null),e){const[p,v,y]=e.split("/");p&&v&&y&&a("leave",p,v,y),e=null}}function a(p,v,y,C){Qt.send({type:"presence",action:p,repo:v,entityType:y,entityId:C})}function o(p){const v=`${p.repo}/${p.entityType}/${p.entityId}`,y=i(n)[v]??[];if(p.action==="leave")i(n)[v]=y.filter(C=>C.id!==p.user.id);else{const C=y.findIndex(E=>E.id===p.user.id);C>=0?(y[C]=p.user,i(n)[v]=[...y]):i(n)[v]=[...y,p.user]}}function c(){if(m(n,{},!0),!e)return;const[p,v,y]=e.split("/");p&&v&&y&&a("enter",p,v,y)}function l(p,v,y,C){const E=`${p}/${v}/${y}`,$=i(n)[E]??[];return C?$.filter(z=>z.id!==C):$}function d(p,v){const y=new Map;for(const[C,E]of Object.entries(i(n)))if(C.startsWith(p))for(const $ of E)(!v||$.id!==v)&&y.set($.id,$);return[...y.values()]}function h(p,v){return d(`${p}/`,v)}function f(p){const v=new Map;for(const y of Object.values(i(n)))for(const C of y)(!p||C.id!==p)&&v.set(C.id,C);return[...v.values()]}const u=x(()=>{const p=new Map;for(const v of Object.values(i(n)))for(const y of v)p.set(y.id,y);return[...p.values()]});return{enter:s,leave:r,handlePresenceEvent:o,resetAndResend:c,getPresence:l,getPresenceByPrefix:d,getRepoPresence:h,getAllUsers:f,get allUsers(){return i(u)}}}const pr=mp();Qt.setPresenceHandler(n=>pr.handlePresenceEvent(n));Qt.addConnectHandler(()=>pr.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>pr.leave());var bp=ue("<title> </title>"),yp=ue('<svg><!><path d="M30,30H28V25a5.0057,5.0057,0,0,0-5-5V18a7.0078,7.0078,0,0,1,7,7Z"></path><path d="M22,30H20V25a5.0059,5.0059,0,0,0-5-5H9a5.0059,5.0059,0,0,0-5,5v5H2V25a7.0082,7.0082,0,0,1,7-7h6a7.0082,7.0082,0,0,1,7,7Z"></path><path d="M20,2V4a5,5,0,0,1,0,10v2A7,7,0,0,0,20,2Z"></path><path d="M12,4A5,5,0,1,1,7,9a5,5,0,0,1,5-5m0-2a7,7,0,1,0,7,7A7,7,0,0,0,12,2Z"></path></svg>');function wp(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=yp();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=bp(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(4),k(l),g(n,l),N()}var xp=ue("<title> </title>"),_p=ue('<svg><!><path d="M28,8H20.8284L17.4143,4.5859A2,2,0,0,0,16,4H4A2,2,0,0,0,2,6V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10A2,2,0,0,0,28,8ZM8,26V14h8v6.17l-2.59-2.58L12,19l5,5,5-5-1.41-1.41L18,20.17V14a2.0025,2.0025,0,0,0-2-2H8a2.0025,2.0025,0,0,0-2,2V26H4V6H16l4,4h8v2H22v2h6V26Z"></path></svg>');function kp(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=_p();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=xp(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var Sp=ue("<title> </title>"),Ap=ue('<svg><!><path d="M15 12H17V30H15z"></path><path d="M11.33,18.22a7,7,0,0,1,0-10.44l1.34,1.49a5,5,0,0,0,0,7.46Z"></path><path d="M20.67,18.22l-1.34-1.49a5,5,0,0,0,0-7.46l1.34-1.49a7,7,0,0,1,0,10.44Z"></path><path d="M8.4,21.8a11,11,0,0,1,0-17.6L9.6,5.8a9,9,0,0,0,0,14.4Z"></path><path d="M23.6,21.8l-1.2-1.6a9,9,0,0,0,0-14.4l1.2-1.6a11,11,0,0,1,0,17.6Z"></path></svg>');function Pp(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Ap();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Sp(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(5),k(l),g(n,l),N()}var Cp=ue("<title> </title>"),Tp=ue('<svg><!><path d="M22,8H21V2H19V8H13V2H11V8H10a2,2,0,0,0-2,2v6a8.0073,8.0073,0,0,0,7,7.9307V30h2V23.9307A8.0073,8.0073,0,0,0,24,16V10A2,2,0,0,0,22,8Z"></path></svg>');function Ep(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Tp();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Cp(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var Op=ue("<title> </title>"),zp=ue('<svg><!><path d="M17 22 17 14 13 14 13 16 15 16 15 22 12 22 12 24 20 24 20 22 17 22z"></path><path d="M16,8a1.5,1.5,0,1,0,1.5,1.5A1.5,1.5,0,0,0,16,8Z"></path><path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"></path></svg>');function Rp(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=zp();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Op(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(3),k(l),g(n,l),N()}function Mp(n,e){F(e,!0);let t=w(e,"ref",15,null),s=w(e,"value",15,""),r=Fe(e,["$$slots","$$events","$$legacy","ref","value","class"]);var a=I(),o=A(a);{let c=x(()=>Et("flex flex-col gap-2",e.class));q(o,()=>sp,(l,d)=>{d(l,ot({"data-slot":"tabs",get class(){return i(c)}},()=>r,{get ref(){return t()},set ref(h){t(h)},get value(){return s()},set value(h){s(h)}}))})}g(n,a),N()}function Ip(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class","orientation"]);var r=I(),a=A(r);{let o=x(()=>Et(e.orientation==="vertical"?"flex flex-col w-full":"inline-flex h-9 w-fit items-center justify-center rounded-lg bg-[var(--color-bg-surface)] p-[3px]",e.class));q(a,()=>op,(c,l)=>{l(c,ot({"data-slot":"tabs-list",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),N()}function Rr(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class","orientation"]);var r=I(),a=A(r);{let o=x(()=>Et("inline-flex items-center text-[14px] font-normal whitespace-nowrap transition-[color,background] duration-150 cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e.orientation==="vertical"?"justify-start w-full h-8 gap-[11px] pl-[19px] pr-3 text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:text-[var(--color-text-primary)] data-[state=active]:bg-[var(--color-bg-hover)] data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:font-medium":"justify-center flex-1 gap-2 rounded-md border border-transparent px-2 py-1 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] data-[state=active]:bg-[var(--color-bg-hover)] data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:shadow-sm",e.class));q(a,()=>lp,(c,l)=>{l(c,ot({"data-slot":"tabs-trigger",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),N()}function $p(n,e){F(e,!0);let t=w(e,"open",15,!1),s=Fe(e,["$$slots","$$events","$$legacy","open"]);var r=I(),a=A(r);q(a,()=>fd,(o,c)=>{c(o,ot(()=>s,{get open(){return t()},set open(l){t(l)}}))}),g(n,r),N()}function Dp(n,e){let t=Fe(e,["$$slots","$$events","$$legacy"]);var s=I(),r=A(s);q(r,()=>Ni,(a,o)=>{o(a,ot(()=>t))}),g(n,s)}function Fp(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=A(r);{let o=x(()=>Et("text-lg font-semibold",e.class));q(a,()=>qa,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-title",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),N()}function Np(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=A(r);{let o=x(()=>e.class||Et(gs()));q(a,()=>gd,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-action",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),N()}function Lp(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=A(r);{let o=x(()=>e.class||Et(gs({variant:"ghost"})));q(a,()=>md,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-cancel",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),N()}var Bp=T("<div><!></div>");function Hp(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=Bp();ye(r,o=>({"data-slot":"alert-dialog-footer",class:o,...s}),[()=>Et("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e.class)]);var a=S(r);se(a,()=>e.children??Te),k(r),$s(r,o=>t(o),()=>t()),g(n,r),N()}var Vp=T("<div><!></div>");function Wp(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=Vp();ye(r,o=>({"data-slot":"alert-dialog-header",class:o,...s}),[()=>Et("flex flex-col gap-2 text-center sm:text-start",e.class)]);var a=S(r);se(a,()=>e.children??Te),k(r),$s(r,o=>t(o),()=>t()),g(n,r),N()}function Kp(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=A(r);{let o=x(()=>Et("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e.class));q(a,()=>hl,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-overlay",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),N()}var jp=T("<!> <!>",1);function Up(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);Dp(n,ot(()=>e.portalProps,{children:(r,a)=>{var o=jp(),c=A(o);Kp(c,{});var l=D(c,2);{let d=x(()=>Et("bg-[var(--color-bg-elevated)] border-[var(--color-border)] text-[var(--color-text-primary)] 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e.class));q(l,()=>_f,(h,f)=>{f(h,ot({"data-slot":"alert-dialog-content",get class(){return i(d)}},()=>s,{get ref(){return t()},set ref(u){t(u)}}))})}g(r,o)},$$slots:{default:!0}})),N()}function qp(n,e){F(e,!0);let t=w(e,"ref",15,null),s=Fe(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=A(r);{let o=x(()=>Et("text-[var(--color-text-secondary)] text-sm",e.class));q(a,()=>pl,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-description",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),N()}var Zp=T("<!> <!>",1),Yp=T("<!> <!>",1),Gp=T("<!> <!>",1);function as(n,e){F(e,!0);let t=w(e,"open",15),s=w(e,"confirmLabel",3,"Confirm"),r=w(e,"cancelLabel",3,"Cancel"),a=w(e,"destructive",3,!1);var o=I(),c=A(o);q(c,()=>$p,(l,d)=>{d(l,{onOpenChange:h=>{h||e.oncancel()},get open(){return t()},set open(h){t(h)},children:(h,f)=>{var u=I(),p=A(u);q(p,()=>Up,(v,y)=>{y(v,{children:(C,E)=>{var $=Gp(),z=A($);q(z,()=>Wp,(H,V)=>{V(H,{children:(J,he)=>{var ee=Zp(),pe=A(ee);q(pe,()=>Fp,(ge,U)=>{U(ge,{children:(G,j)=>{de();var Y=Jt();W(()=>Q(Y,e.title)),g(G,Y)},$$slots:{default:!0}})});var te=D(pe,2);q(te,()=>qp,(ge,U)=>{U(ge,{children:(G,j)=>{de();var Y=Jt();W(()=>Q(Y,e.message)),g(G,Y)},$$slots:{default:!0}})}),g(J,ee)},$$slots:{default:!0}})});var P=D(z,2);q(P,()=>Hp,(H,V)=>{V(H,{children:(J,he)=>{var ee=Yp(),pe=A(ee);{let ge=x(()=>gs({variant:"ghost"}));q(pe,()=>Lp,(U,G)=>{G(U,{get class(){return i(ge)},get onclick(){return e.oncancel},children:(j,Y)=>{de();var we=Jt();W(()=>Q(we,r())),g(j,we)},$$slots:{default:!0}})})}var te=D(pe,2);{let ge=x(()=>gs({variant:a()?"destructive":"accent"}));q(te,()=>Np,(U,G)=>{G(U,{get class(){return i(ge)},get onclick(){return e.onconfirm},children:(j,Y)=>{de();var we=Jt();W(()=>Q(we,s())),g(j,we)},$$slots:{default:!0}})})}g(J,ee)},$$slots:{default:!0}})}),g(C,$)},$$slots:{default:!0}})}),g(h,u)},$$slots:{default:!0}})}),g(n,o),N()}function mo(n,e){F(e,!0);let t=w(e,"open",15,!1),s=Fe(e,["$$slots","$$events","$$legacy","open","onOpenChange","children"]);var r=I(),a=A(r);q(a,()=>Kh,(o,c)=>{c(o,ot({get onOpenChange(){return e.onOpenChange}},()=>s,{get open(){return t()},set open(l){t(l)},children:(l,d)=>{var h=I(),f=A(h);se(f,()=>e.children),g(l,h)},$$slots:{default:!0}}))}),g(n,r),N()}var Xp=T("<!> <!>",1);function bo(n,e){F(e,!0);let t=w(e,"size",3,"md"),s=Fe(e,["$$slots","$$events","$$legacy","children","class","size"]);var r=I(),a=A(r);q(a,()=>Ni,(o,c)=>{c(o,{children:(l,d)=>{var h=Xp(),f=A(h);q(f,()=>hl,(p,v)=>{v(p,{class:"dialog-overlay"})});var u=D(f,2);{let p=x(()=>Et("dialog-content",`dialog-${t()}`,e.class));q(u,()=>Yh,(v,y)=>{y(v,ot({get class(){return i(p)}},()=>s,{children:(C,E)=>{var $=I(),z=A($);se(z,()=>e.children),g(C,$)},$$slots:{default:!0}}))})}g(l,h)},$$slots:{default:!0}})}),g(n,r),N()}var Qp=T("<div><!></div>");function Cl(n,e){F(e,!0);var t=Qp(),s=S(t);se(s,()=>e.children),k(t),W(r=>Ds(t,1,r),[()=>ki(Et("dialog-header",e.class))]),g(n,t),N()}function Tl(n,e){F(e,!0);var t=I(),s=A(t);{let r=x(()=>Et("dialog-title",e.class));q(s,()=>qa,(a,o)=>{o(a,{get class(){return i(r)},children:(c,l)=>{var d=I(),h=A(d);se(h,()=>e.children),g(c,d)},$$slots:{default:!0}})})}g(n,t),N()}function Jp(n,e){F(e,!0);var t=I(),s=A(t);{let r=x(()=>Et("dialog-description",e.class));q(s,()=>pl,(a,o)=>{o(a,{get class(){return i(r)},children:(c,l)=>{var d=I(),h=A(d);se(h,()=>e.children),g(c,d)},$$slots:{default:!0}})})}g(n,t),N()}var eg=T("<div><!></div>");function tg(n,e){F(e,!0);var t=eg(),s=S(t);se(s,()=>e.children),k(t),W(r=>Ds(t,1,r),[()=>ki(Et("dialog-body",e.class))]),g(n,t),N()}var ng=T("<div><!></div>");function rg(n,e){F(e,!0);var t=ng(),s=S(t);se(s,()=>e.children),k(t),W(r=>Ds(t,1,r),[()=>ki(Et("dialog-footer",e.class))]),g(n,t),N()}function sg(n,e){F(e,!0);var t=I(),s=A(t);{let r=x(()=>Et("dialog-close-btn",e.class));q(s,()=>Uh,(a,o)=>{o(a,{get class(){return i(r)},children:(c,l)=>{vs(c,{size:16})},$$slots:{default:!0}})})}g(n,t),N()}var ig=T("<!> <!>",1),og=T('<span class="type-dot svelte-ak7t5k"></span> <div class="type-info svelte-ak7t5k"><span class="type-name svelte-ak7t5k"> </span> <span class="type-desc svelte-ak7t5k"> </span></div>',1),ag=T('<div class="type-section svelte-ak7t5k"><div class="type-section-label svelte-ak7t5k"> </div> <div class="type-grid svelte-ak7t5k"></div></div>'),lg=T("<!> <!>",1);function cg(n,e){F(e,!0);let t=w(e,"open",15),s=w(e,"appEntityTypes",19,()=>[]);const r={deck:"Presentation slides",doc:"Professional documents",project:"Client engagements and initiatives",meeting:"Conversations and check-ins",decision:"Choices made and their rationale",task:"Action items and to-dos",deliverable:"Outputs and work products",note:"Freeform thinking and scratch",process:"Repeatable methods and workflows",standard:"Guidelines and best practices","case-study":"Past work and lessons learned",document:"Long-form structured content",dataset:"Structured data and tables",reference:"Articles, tools, and resources",publication:"Published works and reports",person:"People you work with",organization:"Companies and institutions",role:"Job functions and responsibilities","practice-area":"Disciplines and specialties",deal:"Opportunities and proposals"},a=[{group:"Project",types:["project","meeting","decision","task","deliverable","note"]},{group:"Knowledge",types:["process","standard","case-study","document","dataset","reference","publication"]},{group:"Business",types:["person","organization","role","practice-area","deal"]}],o=x(()=>s().length>0?[{group:"Apps",types:s()},...a]:a);function c(h){return h.replace(/-/g," ").replace(/\b\w/g,f=>f.toUpperCase())}var l=I(),d=A(l);q(d,()=>mo,(h,f)=>{f(h,{onOpenChange:u=>{u||e.oncancel()},get open(){return t()},set open(u){t(u)},children:(u,p)=>{var v=I(),y=A(v);q(y,()=>bo,(C,E)=>{E(C,{size:"md",children:($,z)=>{var P=lg(),H=A(P);q(H,()=>Cl,(J,he)=>{he(J,{children:(ee,pe)=>{var te=ig(),ge=A(te);q(ge,()=>Tl,(G,j)=>{j(G,{children:(Y,we)=>{de();var Se=Jt("New Entity");g(Y,Se)},$$slots:{default:!0}})});var U=D(ge,2);q(U,()=>sg,(G,j)=>{j(G,{})}),g(ee,te)},$$slots:{default:!0}})});var V=D(H,2);q(V,()=>tg,(J,he)=>{he(J,{class:"entity-body",children:(ee,pe)=>{var te=I(),ge=A(te);xt(ge,17,()=>i(o),Dt,(U,G)=>{var j=ag(),Y=S(j),we=S(Y,!0);k(Y);var Se=D(Y,2);xt(Se,21,()=>i(G).types,Dt,(Oe,at)=>{Ge(Oe,{variant:"outline",class:"type-card",type:"button",onclick:()=>e.onselect(i(at)),children:(ft,kt)=>{var X=og(),ve=A(X);let Me;var ct=D(ve,2),Ke=S(ct),St=S(Ke,!0);k(Ke);var hn=D(Ke,2),Xt=S(hn,!0);k(hn),k(ct),W((ht,nt)=>{Me=Wn(ve,"",Me,ht),Q(St,nt),Q(Xt,r[i(at)])},[()=>({background:dr(i(at))}),()=>c(i(at))]),g(ft,X)},$$slots:{default:!0}})}),k(Se),k(j),W(()=>Q(we,i(G).group)),g(U,j)}),g(ee,te)},$$slots:{default:!0}})}),g($,P)},$$slots:{default:!0}})}),g(u,v)},$$slots:{default:!0}})}),g(n,l),N()}var ug=T('<span class="row-chevron svelte-6dohdz"><!></span>'),dg=T('<span class="item-count svelte-6dohdz"> </span>'),fg=T('<!> <span class="row-label svelte-6dohdz"> </span> <!>',1),hg=T('<div class="indent-group svelte-6dohdz"><!></div>'),pg=T("<!> <!>",1),gg=T('<span class="repo-type-icon svelte-6dohdz"><!></span>'),vg=T('<span class="repo-name svelte-6dohdz"> </span>'),mg=T('<span class="item-count svelte-6dohdz"> </span>'),bg=T('<span class="presence-avatar svelte-6dohdz"> </span>'),yg=T('<span class="presence-stack svelte-6dohdz"></span>'),wg=T('<span class="row-chevron svelte-6dohdz"><!></span> <!> <!> <!> <!>',1),xg=T("<!> ",1),_g=T("<!> Import Files",1),kg=T("<!> Rename",1),Sg=T("<!> Delete",1),Ag=T("<!> <!> <!> <!>",1),Pg=T("<!> <!>",1),Cg=T('<div class="loading-row svelte-6dohdz">Loading...</div>'),Tg=T('<span class="presence-avatar svelte-6dohdz"> </span>'),Eg=T('<span class="presence-stack svelte-6dohdz"></span>'),Og=T('<span class="row-chevron svelte-6dohdz"><!></span> <span class="row-label svelte-6dohdz"> </span> <span class="item-count svelte-6dohdz"> </span> <!>',1),zg=T("<!> ",1),Rg=T("<!> <!>",1),Mg=T('<span class="row-chevron svelte-6dohdz"><!></span>'),Ig=T('<mark class="filter-match svelte-6dohdz"> </mark>'),$g=T('<span class="presence-avatar svelte-6dohdz"> </span>'),Dg=T('<span class="presence-stack svelte-6dohdz"></span>'),Fg=T('<!> <span class="row-label svelte-6dohdz"><!></span> <!>',1),Ng=T("<!> Delete",1),Lg=T("<!> <!>",1),Bg=T('<div class="loading-row svelte-6dohdz">Loading...</div>'),Hg=T('<div class="indent-group svelte-6dohdz"><!></div>'),Vg=T('<div class="entity-row-wrapper svelte-6dohdz"><!> <!></div> <!>',1),Wg=T('<div class="indent-group svelte-6dohdz"></div>'),Kg=T('<div class="type-header-wrapper svelte-6dohdz"><!> <!></div> <!>',1),jg=T('<span class="row-chevron svelte-6dohdz"><!></span> <span class="row-label svelte-6dohdz">New Entity</span>',1),Ug=T("<!> <!>",1),qg=T('<div class="indent-group svelte-6dohdz"><!></div>'),Zg=T('<div class="tree-group svelte-6dohdz"><div><!> <!></div> <!></div>'),Yg=T('<div class="workspace-icon svelte-6dohdz"> </div> <span class="workspace-name svelte-6dohdz"> </span>',1),Gg=T('<!> <span class="svelte-6dohdz">Workspace</span>',1),Xg=T('<!> <span class="svelte-6dohdz">Team</span>',1),Qg=T('<!> <span class="svelte-6dohdz">Permissions</span>',1),Jg=T("<!> <!> <!>",1),ev=T('<!> <span class="svelte-6dohdz">Connectors</span>',1),tv=T('<!> <span class="svelte-6dohdz">Sync Sources</span>',1),nv=T("<!> <!> <!>",1),rv=T('<div class="settings-nav svelte-6dohdz"><!></div>'),sv=T('<mark class="filter-match svelte-6dohdz"> </mark>'),iv=T('<span class="recent-time svelte-6dohdz"> </span>'),ov=T('<span class="entity-type-dot svelte-6dohdz"></span> <span class="row-label svelte-6dohdz"><!></span> <!>',1),av=T("<!> Delete",1),lv=T("<!> <!>",1),cv=T('<div class="entity-row-wrapper svelte-6dohdz"><!> <!></div>'),uv=T('<div class="no-results svelte-6dohdz">No matching entities</div>'),dv=T("<!> <!>",1),fv=T('<div class="no-results svelte-6dohdz">No matching entities</div>'),hv=T("<!> <!>",1),pv=T('<div class="new-collection-row svelte-6dohdz"><!> <!> <!></div>'),gv=T('<span class="row-chevron svelte-6dohdz"><!></span> <span class="repo-name svelte-6dohdz">New Collection</span>',1),vv=T('<div class="filter-bar svelte-6dohdz"><span class="filter-icon svelte-6dohdz"><!></span> <!> <!> <!></div> <nav class="tree svelte-6dohdz"><!> <!> <!></nav>',1),mv=T('<div class="sidebar-footer svelte-6dohdz"><span class="user-email svelte-6dohdz"> </span> <!></div>'),bv=T("<!> <!>",1),yv=T('<!> <p class="svelte-6dohdz">Drag files here or <button class="file-picker-link svelte-6dohdz">browse</button></p>',1),wv=T('<div class="import-file-row svelte-6dohdz"><span class="import-file-name svelte-6dohdz"> </span> <button class="import-file-remove svelte-6dohdz">×</button></div>'),xv=T('<div class="import-file-list svelte-6dohdz"></div> <p class="import-hint svelte-6dohdz">Drop more files to add</p>',1),_v=T("<!> <!>",1),kv=T('<!> <div class="import-modal-body svelte-6dohdz"><div class="import-drop-zone svelte-6dohdz"><!></div> <input id="import-file-input" type="file" multiple="" accept=".md,.txt,.csv" style="display:none" class="svelte-6dohdz"/></div> <!>',1),Sv=T('<aside class="sidebar svelte-6dohdz"><div class="sidebar-header svelte-6dohdz"><!> <div class="header-actions svelte-6dohdz"><!> <!></div></div> <!> <!></aside> <!> <!> <!> <!> <!> <!>',1);function Av(n,e){F(e,!0);const t=(b,_=Te,R=Te,K=Te,ke=Te,me=Te,be=Te)=>{var Pt=I(),Ot=A(Pt);xt(Ot,17,_,Dt,(dn,zt)=>{const nn=x(()=>me()?`${me()}/${i(zt).name}`:i(zt).name),rn=x(()=>`${R()}/${K()}/${ke()}/${i(nn)}`),Ye=x(()=>i(zt).type==="directory"),ut=x(()=>Z.isFolderExpanded(i(rn))),Ut=x(()=>!i(Ye)&&i(nt)===ke()&&i(jt)===i(nn));var Re=pg(),Qe=A(Re);{let fe=x(()=>i(Ut)?"selected":""),ie=x(()=>i(Nn)===i(rn)?"focused":""),ne=x(()=>`padding-left: ${ur(be(),i(Ye))}`);Ge(Qe,{variant:"ghost",get class(){return`tree-row ${i(fe)??""} ${i(ie)??""}`},get"data-tree-key"(){return i(rn)},get style(){return i(ne)},onclick:()=>{i(Ye)?Z.toggleFolder(i(rn)):kn(`/${R()}/${K()}/${ke()}/${i(nn)}`)},children:(Ne,re)=>{var oe=fg(),Ae=A(oe);{var Ce=Ct=>{var pt=ug(),xe=S(pt);{var _e=rt=>{Qr(rt,{size:14})},$e=rt=>{Xr(rt,{size:14})};O(xe,rt=>{i(ut)?rt(_e):rt($e,!1)})}k(pt),g(Ct,pt)};O(Ae,Ct=>{i(Ye)&&Ct(Ce)})}var Ie=D(Ae,2),Le=S(Ie,!0);k(Ie);var Ze=D(Ie,2);{var yt=Ct=>{var pt=dg(),xe=S(pt,!0);k(pt),W(()=>Q(xe,i(zt).count)),g(Ct,pt)};O(Ze,Ct=>{i(Ye)&&i(zt).count!=null&&Ct(yt)})}W(()=>Q(Le,i(zt).name)),g(Ne,oe)},$$slots:{default:!0}})}var qe=D(Qe,2);{var je=fe=>{var ie=hg();let ne;var Ne=S(ie);t(Ne,()=>i(zt).children,R,K,ke,()=>i(nn),()=>be()+1),k(ie),W(re=>ne=Wn(ie,"",ne,re),[()=>({"--guide-left":Gr(be())})]),g(fe,ie)};O(qe,fe=>{i(Ye)&&i(ut)&&i(zt).children&&i(zt).children.length>0&&fe(je)})}g(dn,Re)}),g(b,Pt)},s=(b,_=Te)=>{const R=x(()=>i(tn)?.repo===_().name),K=x(()=>`repo:${_().name}`),ke=x(()=>pr.getRepoPresence(_().name,$t.user?String($t.user.id):void 0));var me=Zg(),be=S(me),Pt=S(be);{let Ye=x(()=>i(R)?"repo-active":""),ut=x(()=>i(Nn)===i(K)?"focused":""),Ut=x(()=>i(R)&&i(tn)?.color?`--active-color: ${i(tn).color}`:void 0);Ge(Pt,{variant:"ghost",get class(){return`repo-row ${i(Ye)??""} ${i(ut)??""}`},get"data-tree-key"(){return i(K)},get style(){return i(Ut)},onclick:()=>Ys(_().name),children:(Re,Qe)=>{var qe=wg(),je=A(qe),fe=S(je);{var ie=xe=>{Qr(xe,{size:14})},ne=x(()=>Z.isExpanded(_().name)),Ne=xe=>{Xr(xe,{size:14})};O(fe,xe=>{i(ne)?xe(ie):xe(Ne,!1)})}k(je);var re=D(je,2);{var oe=xe=>{var _e=gg(),$e=S(_e);ni($e,{size:12}),k(_e),g(xe,_e)};O(re,xe=>{_().private&&xe(oe)})}var Ae=D(re,2);{var Ce=xe=>{fs(xe,{class:"repo-rename-input",type:"text",onkeydown:pe,onblur:ee,onclick:_e=>_e.stopPropagation(),get ref(){return i(J)},set ref(_e){m(J,_e,!0)},get value(){return i(V)},set value(_e){m(V,_e,!0)}})},Ie=xe=>{var _e=vg(),$e=S(_e,!0);k(_e),W(()=>Q($e,_().name)),fr("dblclick",_e,rt=>{i(te)&&_().type!=="private"&&he(_().name,rt)}),g(xe,_e)};O(Ae,xe=>{i(H)===_().name?xe(Ce):xe(Ie,!1)})}var Le=D(Ae,2);{var Ze=xe=>{var _e=mg(),$e=S(_e,!0);k(_e),W(()=>Q($e,_().count)),g(xe,_e)};O(Le,xe=>{_().count!=null&&i(H)!==_().name&&xe(Ze)})}var yt=D(Le,2);{var Ct=xe=>{var _e=yg();xt(_e,21,()=>i(ke).slice(0,3),Dt,($e,rt)=>{var gt=bg(),Ee=S(gt,!0);k(gt),W(Rt=>Q(Ee,Rt),[()=>i(rt).name[0].toUpperCase()]),g($e,gt)}),k(_e),W($e=>ds(_e,"title",$e),[()=>i(ke).map($e=>$e.name).join(", ")]),g(xe,_e)},pt=x(()=>!Z.isExpanded(_().name)&&i(ke).length>0);O(yt,xe=>{i(pt)&&xe(Ct)})}g(Re,qe)},$$slots:{default:!0}})}var Ot=D(Pt,2);{var dn=Ye=>{var ut=I(),Ut=A(ut);q(Ut,()=>rs,(Re,Qe)=>{Qe(Re,{onOpenChange:qe=>{m(r,qe?_().name:null,!0)},children:(qe,je)=>{var fe=Pg(),ie=A(fe);{let Ne=x(()=>i(r)===_().name?"menu-open":"");q(ie,()=>ss,(re,oe)=>{oe(re,{get class(){return`repo-actions-btn ${i(Ne)??""}`},onclick:Ae=>Ae.stopPropagation(),children:(Ae,Ce)=>{Jr(Ae,{size:12})},$$slots:{default:!0}})})}var ne=D(ie,2);q(ne,()=>is,(Ne,re)=>{re(Ne,{children:(oe,Ae)=>{var Ce=I(),Ie=A(Ce);q(Ie,()=>os,(Le,Ze)=>{Ze(Le,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(yt,Ct)=>{var pt=Ag(),xe=A(pt);{var _e=Pe=>{var Be=I(),vt=A(Be);{let st=x(()=>!!i(u));q(vt,()=>Xn,(it,Je)=>{Je(it,{class:"repo-menu-item",get disabled(){return i(st)},onSelect:()=>p(_().name),children:(Mt,dt)=>{var It=xg(),He=A(It);{let wt=x(()=>i(u)===_().name?"animate-spin":"");Qo(He,{size:12,get class(){return i(wt)}})}var lt=D(He);W(()=>Q(lt,` ${i(u)===_().name?"Syncing...":"Sync"}`)),g(Mt,It)},$$slots:{default:!0}})})}g(Pe,Be)};O(xe,Pe=>{_().sync&&_().sync.length>0&&Pe(_e)})}var $e=D(xe,2);{var rt=Pe=>{var Be=I(),vt=A(Be);q(vt,()=>Xn,(st,it)=>{it(st,{class:"repo-menu-item",onSelect:()=>{m(G,_().name,!0),m(j,[],!0)},children:(Je,Mt)=>{var dt=_g(),It=A(dt);Jo(It,{size:12}),de(),g(Je,dt)},$$slots:{default:!0}})}),g(Pe,Be)};O($e,Pe=>{i(te)&&Pe(rt)})}var gt=D($e,2);{var Ee=Pe=>{var Be=I(),vt=A(Be);q(vt,()=>Xn,(st,it)=>{it(st,{class:"repo-menu-item",onSelect:Je=>he(_().name,Je),children:(Je,Mt)=>{var dt=kg(),It=A(dt);Ra(It,{size:12}),de(),g(Je,dt)},$$slots:{default:!0}})}),g(Pe,Be)};O(gt,Pe=>{i(te)&&_().type!=="private"&&Pe(Ee)})}var Rt=D(gt,2);{var sn=Pe=>{var Be=I(),vt=A(Be);q(vt,()=>Xn,(st,it)=>{it(st,{class:"repo-menu-item repo-menu-item-danger",onSelect:Je=>h(_().name,Je),children:(Je,Mt)=>{var dt=Sg(),It=A(dt);$r(It,{size:12}),de(),g(Je,dt)},$$slots:{default:!0}})}),g(Pe,Be)};O(Rt,Pe=>{i(te)&&Pe(sn)})}g(yt,pt)},$$slots:{default:!0}})}),g(oe,Ce)},$$slots:{default:!0}})}),g(qe,fe)},$$slots:{default:!0}})}),g(Ye,ut)};O(Ot,Ye=>{i(H)!==_().name&&(i(te)||_().sync&&_().sync.length>0)&&Ye(dn)})}k(be);var zt=D(be,2);{var nn=Ye=>{var ut=qg();let Ut;var Re=S(ut);{var Qe=je=>{var fe=Cg();let ie;W(ne=>ie=Wn(fe,"",ie,ne),[()=>({"padding-left":ur(1,!1)})]),g(je,fe)},qe=je=>{var fe=Ug(),ie=A(fe);xt(ie,17,()=>Kl(_().entities),Dt,(Ne,re)=>{const oe=x(()=>`type:${_().name}/${i(re).type}`),Ae=x(()=>!Z.isFolderCollapsed(i(oe))),Ce=x(()=>_().name===i(ht)&&i(re).entities.some(_e=>_e.id===i(nt)));var Ie=Kg(),Le=A(Ie),Ze=S(Le);{let _e=x(()=>i(Ce)?"type-active":""),$e=x(()=>`padding-left: ${ur(1,!0)}; border-left-color: ${i(Ce)?dr(i(re).type):"transparent"}`);Ge(Ze,{variant:"ghost",get class(){return`tree-row type-header-row ${i(_e)??""}`},get style(){return i($e)},get"data-tree-key"(){return i(oe)},onclick:()=>Z.toggleFolder(i(oe)),children:(rt,gt)=>{const Ee=x(()=>pr.getPresenceByPrefix(`${_().name}/${i(re).type}/`,$t.user?String($t.user.id):void 0));var Rt=Og(),sn=A(Rt),Pe=S(sn);{var Be=He=>{Qr(He,{size:14})},vt=He=>{Xr(He,{size:14})};O(Pe,He=>{i(Ae)?He(Be):He(vt,!1)})}k(sn);var st=D(sn,2),it=S(st,!0);k(st);var Je=D(st,2),Mt=S(Je,!0);k(Je);var dt=D(Je,2);{var It=He=>{var lt=Eg();xt(lt,21,()=>i(Ee).slice(0,3),Dt,(wt,Yn)=>{var fn=Tg(),Lt=S(fn,!0);k(fn),W(Bt=>Q(Lt,Bt),[()=>i(Yn).name[0].toUpperCase()]),g(wt,fn)}),k(lt),W(wt=>ds(lt,"title",wt),[()=>i(Ee).map(wt=>wt.name).join(", ")]),g(He,lt)};O(dt,He=>{!i(Ae)&&i(Ee).length>0&&He(It)})}W(()=>{Q(it,i(re).label),Q(Mt,i(re).entities.length)}),g(rt,Rt)},$$slots:{default:!0}})}var yt=D(Ze,2);{var Ct=_e=>{var $e=I(),rt=A($e);q(rt,()=>rs,(gt,Ee)=>{Ee(gt,{onOpenChange:Rt=>{m(a,Rt?i(oe):null,!0)},children:(Rt,sn)=>{var Pe=Rg(),Be=A(Pe);{let st=x(()=>i(a)===i(oe)?"menu-open":"");q(Be,()=>ss,(it,Je)=>{Je(it,{get class(){return`type-actions-btn ${i(st)??""}`},onclick:Mt=>Mt.stopPropagation(),children:(Mt,dt)=>{Jr(Mt,{size:12})},$$slots:{default:!0}})})}var vt=D(Be,2);q(vt,()=>is,(st,it)=>{it(st,{children:(Je,Mt)=>{var dt=I(),It=A(dt);q(It,()=>os,(He,lt)=>{lt(He,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(wt,Yn)=>{var fn=I(),Lt=A(fn);q(Lt,()=>Xn,(Bt,on)=>{on(Bt,{class:"repo-menu-item repo-menu-item-danger",onSelect:qt=>z(_().name,i(re).type,i(re).label,i(re).entities.length,qt),children:(qt,Ln)=>{var On=zg(),Bn=A(On);$r(Bn,{size:12});var Sr=D(Bn);W(Ar=>Q(Sr,` Delete all ${Ar??""}`),[()=>i(re).label.toLowerCase()]),g(qt,On)},$$slots:{default:!0}})}),g(wt,fn)},$$slots:{default:!0}})}),g(Je,dt)},$$slots:{default:!0}})}),g(Rt,Pe)},$$slots:{default:!0}})}),g(_e,$e)};O(yt,_e=>{i(te)&&_e(Ct)})}k(Le);var pt=D(Le,2);{var xe=_e=>{var $e=Wg();let rt;xt($e,21,()=>i(re).entities,gt=>gt.id,(gt,Ee)=>{const Rt=x(()=>i(Ee).id===i(nt)&&_().name===i(ht)&&!i(jt)),sn=x(()=>i(Ee).hasSubContent&&Z.isEntityExpanded(_().name,i(Ee).entityType,i(Ee).id)),Pe=x(()=>i(Ee).hasSubContent?Z.getEntityContents(_().name,i(Ee).entityType,i(Ee).id):null),Be=x(()=>`entity:${_().name}/${i(Ee).entityType}/${i(Ee).id}`),vt=x(()=>pr.getPresence(_().name,i(Ee).entityType,i(Ee).id,$t.user?String($t.user.id):void 0));var st=Vg(),it=A(st),Je=S(it);{let He=x(()=>i(Rt)?"selected":""),lt=x(()=>i(Nn)===i(Be)?"focused":""),wt=x(()=>`padding-left: ${ur(2,i(Ee).hasSubContent)}${i(Rt)?`; --active-color: ${dr(i(Ee).entityType)}`:""}`);Ge(Je,{variant:"ghost",get class(){return`tree-row ${i(He)??""} ${i(lt)??""}`},get"data-tree-key"(){return i(Be)},get style(){return i(wt)},onclick:()=>Xs(i(Ee),_().name),children:(Yn,fn)=>{var Lt=Fg(),Bt=A(Lt);{var on=Ht=>{var Vt=Mg(),xn=S(Vt);{var Hn=an=>{Qr(an,{size:14})},gn=an=>{Xr(an,{size:14})};O(xn,an=>{i(sn)?an(Hn):an(gn,!1)})}k(Vt),g(Ht,Vt)};O(Bt,Ht=>{i(Ee).hasSubContent&&Ht(on)})}var qt=D(Bt,2),Ln=S(qt);{var On=Ht=>{var Vt=I(),xn=A(Vt);xt(xn,17,()=>Eo(i(Ee).title),Dt,(Hn,gn)=>{var an=I(),Pr=A(an);{var Cr=zn=>{var Vn=Ig(),Jl=S(Vn,!0);k(Vn),W(()=>Q(Jl,i(gn).text)),g(zn,Vn)},Ho=zn=>{var Vn=Jt();W(()=>Q(Vn,i(gn).text)),g(zn,Vn)};O(Pr,zn=>{i(gn).match?zn(Cr):zn(Ho,!1)})}g(Hn,an)}),g(Ht,Vt)},Bn=Ht=>{var Vt=Jt();W(()=>Q(Vt,i(Ee).title)),g(Ht,Vt)};O(Ln,Ht=>{i(At)?Ht(On):Ht(Bn,!1)})}k(qt);var Sr=D(qt,2);{var Ar=Ht=>{var Vt=Dg();xt(Vt,21,()=>i(vt).slice(0,3),Dt,(xn,Hn)=>{var gn=$g(),an=S(gn,!0);k(gn),W(Pr=>Q(an,Pr),[()=>i(Hn).name[0].toUpperCase()]),g(xn,gn)}),k(Vt),W(xn=>ds(Vt,"title",xn),[()=>i(vt).map(xn=>xn.name).join(", ")]),g(Ht,Vt)};O(Sr,Ht=>{i(vt).length>0&&Ht(Ar)})}g(Yn,Lt)},$$slots:{default:!0}})}var Mt=D(Je,2);q(Mt,()=>rs,(He,lt)=>{lt(He,{onOpenChange:wt=>{m(o,wt?i(Be):null,!0)},children:(wt,Yn)=>{var fn=Lg(),Lt=A(fn);{let on=x(()=>i(o)===i(Be)?"menu-open":"");q(Lt,()=>ss,(qt,Ln)=>{Ln(qt,{get class(){return`entity-actions-btn ${i(on)??""}`},onclick:On=>On.stopPropagation(),children:(On,Bn)=>{Jr(On,{size:12})},$$slots:{default:!0}})})}var Bt=D(Lt,2);q(Bt,()=>is,(on,qt)=>{qt(on,{children:(Ln,On)=>{var Bn=I(),Sr=A(Bn);q(Sr,()=>os,(Ar,Ht)=>{Ht(Ar,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(Vt,xn)=>{var Hn=I(),gn=A(Hn);q(gn,()=>Xn,(an,Pr)=>{Pr(an,{class:"repo-menu-item repo-menu-item-danger",onSelect:Cr=>y(_().name,i(Ee),Cr),children:(Cr,Ho)=>{var zn=Ng(),Vn=A(zn);$r(Vn,{size:12}),de(),g(Cr,zn)},$$slots:{default:!0}})}),g(Vt,Hn)},$$slots:{default:!0}})}),g(Ln,Bn)},$$slots:{default:!0}})}),g(wt,fn)},$$slots:{default:!0}})}),k(it);var dt=D(it,2);{var It=He=>{var lt=I(),wt=A(lt);{var Yn=Lt=>{var Bt=Bg();let on;W(qt=>on=Wn(Bt,"",on,qt),[()=>({"padding-left":ur(3,!1)})]),g(Lt,Bt)},fn=Lt=>{var Bt=Hg();let on;var qt=S(Bt);t(qt,()=>i(Pe).entries,()=>_().name,()=>i(Ee).entityType,()=>i(Ee).id,()=>"",()=>3),k(Bt),W(Ln=>on=Wn(Bt,"",on,Ln),[()=>({"--guide-left":Gr(2)})]),g(Lt,Bt)};O(wt,Lt=>{i(Pe).loading?Lt(Yn):i(Pe).entries.length>0&&Lt(fn,1)})}g(He,lt)};O(dt,He=>{i(sn)&&i(Pe)&&He(It)})}ln("mouseenter",it,()=>{ze.hoveredEntityId=i(Ee).id}),ln("mouseleave",it,()=>{ze.hoveredEntityId=null}),g(gt,st)}),k($e),W(gt=>rt=Wn($e,"",rt,gt),[()=>({"--guide-left":Gr(1)})]),g(_e,$e)};O(pt,_e=>{i(Ae)&&_e(xe)})}g(Ne,Ie)});var ne=D(ie,2);{let Ne=x(()=>`padding-left: ${ur(1,!0)}`);Ge(ne,{variant:"ghost",class:"tree-row new-entity-row",get style(){return i(Ne)},onclick:re=>{re.stopPropagation(),m(En,_().name,!0)},children:(re,oe)=>{var Ae=jg(),Ce=A(Ae),Ie=S(Ce);Xo(Ie,{size:14}),k(Ce),de(2),g(re,Ae)},$$slots:{default:!0}})}g(je,fe)};O(Re,je=>{_().loading?je(Qe):je(qe,!1)})}k(ut),W(je=>Ut=Wn(ut,"",Ut,je),[()=>({"--guide-left":Gr(0)})]),g(Ye,ut)},rn=x(()=>Z.isExpanded(_().name));O(zt,Ye=>{i(rn)&&Ye(nn)})}k(me),W(()=>Ds(be,1,`repo-row-wrapper ${i(U)===_().name?"drop-target":""}`,"svelte-6dohdz")),ln("dragover",be,Ye=>Se(Ye,_().name)),ln("dragleave",be,Oe),ln("drop",be,Ye=>at(Ye,_().name)),g(b,me)};let r=L(null),a=L(null),o=L(null);async function c(){Qt.startSyncToast("workspace");try{const{workspaceResults:b=[]}=await vp();let _=0,R=0;const K=[];for(const ke of b)for(const me of ke.targets??[])_+=(me.created??0)+(me.derived??0),R+=me.skipped??0,K.push(...me.errors??[]);if(_>0){const ke=new Set(b.flatMap(me=>(me.targets??[]).filter(be=>(be.created??0)+(be.derived??0)>0).map(be=>be.repo)));await Promise.all([...ke].map(me=>Z.refreshEntities(me)))}K.length>0?Qt.finishSyncToast("workspace",`Sync failed: ${K[0]}`,!0):_>0?Qt.finishSyncToast("workspace",`Synced ${_} new entities`,!1):Qt.finishSyncToast("workspace",`No new entities (${R} already synced)`,!1)}catch(b){console.error("Sync failed:",b),Qt.finishSyncToast("workspace",`Sync failed: ${b.message}`,!0)}}let l=L(!1),d=L(null);function h(b,_){_.stopPropagation(),m(d,b,!0)}async function f(){if(!i(d))return;const b=i(d);m(d,null);try{await Z.removeCollection(b)}catch(_){console.error("Failed to delete collection:",_.message)}}let u=L(null);async function p(b){if(!i(u)){m(u,b,!0),Qt.startSyncToast(b);try{const _=await gp(b),K=(_.collectionResults??_.results??[]).reduce((ke,me)=>ke+(me.created??0)+(me.skipped??0),0);Qt.finishSyncToast(b,`Synced ${K} entities in ${b}`,!1),Z.refreshEntities(b)}catch(_){Qt.finishSyncToast(b,`Sync failed: ${_.message}`,!0)}finally{m(u,null)}}}let v=L(null);function y(b,_,R){R.stopPropagation(),m(v,{repo:b,type:_.entityType,id:_.id,title:_.title},!0)}async function C(){if(!i(v))return;const{repo:b,type:_,id:R}=i(v);m(v,null),Z.removeEntity(b,_,R),ze.selectedRepo===b&&ze.selectedId===R&&kn("/");try{await jo(b,_,R)}catch(K){console.error("Failed to delete entity:",K.message),await Z.refreshEntities(b)}}let E=L(null),$=L(!1);function z(b,_,R,K,ke){ke.stopPropagation(),m(E,{repo:b,type:_,label:R,count:K},!0)}async function P(){if(!i(E)||i($))return;const{repo:b,type:_}=i(E),R=Z.repos.find(be=>be.name===b)?.entities.filter(be=>be.entityType===_)??[];m($,!0),m(E,null),ze.selectedRepo===b&&R.some(be=>be.id===ze.selectedId)&&kn("/");const K=R.length;for(const be of R)try{await jo(b,be.entityType,be.id)}catch{}await Z.refreshEntities(b);const ke=Z.repos.find(be=>be.name===b)?.entities.filter(be=>be.entityType===_).length??0,me=K-ke;Qt.showToast(`Deleted ${me} ${me===1?"entity":"entities"}`),m($,!1)}let H=L(null),V=L(""),J=L(null);function he(b,_){_.stopPropagation(),m(H,b,!0),m(V,b,!0),setTimeout(()=>i(J)?.select(),0)}async function ee(){if(!i(H))return;const b=i(H),_=i(V).trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(m(H,null),!(!_||_===b))try{await Z.renameCollectionTo(b,_)}catch(R){console.error("Failed to rename collection:",R.message)}}function pe(b){b.key==="Enter"?(b.preventDefault(),ee()):b.key==="Escape"&&m(H,null)}const te=x(()=>!$t.loading&&(!$t.authEnabled||$t.user?.role==="admin"));let ge=L(!1),U=L(null),G=L(null),j=L(en([])),Y=L(!1);const we=[".md",".txt",".csv"];function Se(b,_){b.preventDefault(),i(te)&&(b.dataTransfer&&(b.dataTransfer.dropEffect="copy"),m(U,_,!0))}function Oe(b){const _=b.relatedTarget;_&&b.currentTarget?.contains(_)||m(U,null)}async function at(b,_){if(b.preventDefault(),m(U,null),!i(te)||!b.dataTransfer?.files.length)return;const R=await ft(b.dataTransfer.files);R.length!==0&&await kt(_,R)}async function ft(b){const _=[];for(const R of Array.from(b)){const K="."+R.name.split(".").pop()?.toLowerCase();if(!we.includes(K))continue;const ke=await R.text();_.push({filename:R.name,content:ke})}return _}async function kt(b,_){if(_.length!==0){m(Y,!0);try{const{apiFetch:R}=await Sc(async()=>{const{apiFetch:ke}=await import("./VEgGCdut.js").then(me=>me.v);return{apiFetch:ke}},__vite__mapDeps([0,1,2,3]),import.meta.url),K=await R(`/api/repos/${encodeURIComponent(b)}/import`,{method:"POST",body:JSON.stringify({files:_})});await Z.refreshEntities(b),console.log(`Imported ${K.imported} file(s) into ${b}`,K)}catch(R){console.error("Import failed:",R.message)}finally{m(Y,!1),m(G,null),m(j,[],!0)}}}async function X(b){if(b.preventDefault(),!b.dataTransfer?.files.length)return;const _=await ft(b.dataTransfer.files);m(j,[...i(j),..._],!0)}async function ve(b){const _=b.target;if(!_.files?.length)return;const R=await ft(_.files);m(j,[...i(j),...R],!0),_.value=""}let Me=L(""),ct=L(!1),Ke=L(null),St=L(!1);async function hn(){const b=i(Me).trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(b){m(St,!0);try{await Z.addCollection(b,void 0,i(ct)||void 0),m(ge,!1),m(Me,""),m(ct,!1)}catch{m(St,!1),await new Promise(R=>requestAnimationFrame(R)),i(Ke)?.classList.remove("shake"),i(Ke)?.offsetWidth,i(Ke)?.classList.add("shake"),i(Ke)?.focus();return}finally{m(St,!1)}}}function Xt(b){b.key==="Enter"?(b.preventDefault(),hn()):b.key==="Escape"&&(m(ge,!1),m(Me,""),m(ct,!1))}const ht=x(()=>ze.selectedRepo),nt=x(()=>ze.selectedId),jt=x(()=>ze.selectedSubPath),At=x(()=>Z.filterQuery);let pn=L(null);function lr(b){const _=b.target.value;Z.setFilterQuery(_)}function Zn(){Z.setFilterQuery(""),i(pn)&&(i(pn).value="")}function cr(b,_,R,K,ke,me){for(const be of b){const Pt=ke?`${ke}/${be.name}`:be.name,Ot=`${_}/${R}/${K}/${Pt}`;be.type==="directory"?(me.push({key:Ot,kind:"content-dir",repo:_,folderKey:Ot}),Z.isFolderExpanded(Ot)&&be.children?.length&&cr(be.children,_,R,K,Pt,me)):me.push({key:Ot,kind:"content-file",repo:_,gotoPath:`/${_}/${R}/${K}/${Pt}`})}}const bt=x(()=>{const b=[],_=Z.sortedRepos;for(const R of _)if(b.push({key:`repo:${R.name}`,kind:"repo",repo:R.name}),Z.isExpanded(R.name)&&!R.loading){for(const K of R.entities)if(b.push({key:`entity:${R.name}/${K.entityType}/${K.id}`,kind:"entity",repo:R.name,entity:K}),K.hasSubContent&&Z.isEntityExpanded(R.name,K.entityType,K.id)){const me=Z.getEntityContents(R.name,K.entityType,K.id);!me.loading&&me.entries.length>0&&cr(me.entries,R.name,K.entityType,K.id,"",b)}}return b});let We=L(-1);const Nn=x(()=>i(We)>=0&&i(We)<i(bt).length?i(bt)[i(We)].key:null);let Zr="";mt(()=>{const b=Z.filterQuery;b!==Zr&&(Zr=b,m(We,-1))});function wn(){requestAnimationFrame(()=>{if(!i(Nt)||i(We)<0)return;const b=i(bt)[i(We)]?.key;if(!b)return;const _=i(Nt).querySelector(`[data-tree-key="${CSS.escape(b)}"]`);_&&_.scrollIntoView({block:"nearest"})})}function Yr(){if(i(We)<0)return;const b=i(bt)[i(We)];if(b)switch(b.kind){case"repo":Z.toggleRepo(b.repo);break;case"entity":b.entity&&Xs(b.entity,b.repo);break;case"content-dir":b.folderKey&&Z.toggleFolder(b.folderKey);break;case"content-file":b.gotoPath&&kn(b.gotoPath);break}}function Us(){if(i(We)<0)return;const b=i(bt)[i(We)];b&&(b.kind==="repo"&&!Z.isExpanded(b.repo)?Z.toggleRepo(b.repo):b.kind==="entity"&&b.entity?.hasSubContent&&!Z.isEntityExpanded(b.repo,b.entity.entityType,b.entity.id)?Z.toggleEntity(b.repo,b.entity.entityType,b.entity.id):b.kind==="content-dir"&&b.folderKey&&!Z.isFolderExpanded(b.folderKey)?Z.toggleFolder(b.folderKey):i(We)<i(bt).length-1&&(tr(We),wn()))}function qs(){if(i(We)<0)return;const b=i(bt)[i(We)];b&&(b.kind==="repo"&&Z.isExpanded(b.repo)?Z.toggleRepo(b.repo):b.kind==="entity"&&b.entity?.hasSubContent&&Z.isEntityExpanded(b.repo,b.entity.entityType,b.entity.id)?Z.toggleEntity(b.repo,b.entity.entityType,b.entity.id):b.kind==="content-dir"&&b.folderKey&&Z.isFolderExpanded(b.folderKey)?Z.toggleFolder(b.folderKey):i(We)>0&&(tr(We,-1),wn()))}function Zs(b){if(b.key==="Escape"){Zn(),i(pn)?.blur(),m(We,-1);return}if(b.key==="ArrowDown"){b.preventDefault(),i(We)<i(bt).length-1&&tr(We),wn();return}if(b.key==="ArrowUp"){b.preventDefault(),i(We)>0?tr(We,-1):i(We)===0&&m(We,-1),wn();return}if(b.key==="Enter"){b.preventDefault(),Yr();return}if(b.key==="ArrowRight"){b.preventDefault(),Us();return}if(b.key==="ArrowLeft"){b.preventDefault(),qs();return}}const tn=x(()=>{if(!i(nt)||!i(ht))return null;const b=Z.repos.find(R=>R.name===i(ht));if(!b)return null;const _=b.entities.find(R=>R.id===i(nt));return _?{repo:b.name,entityType:_.entityType,color:dr(_.entityType)}:null});mt(()=>{const b=i(ht)&&i(nt)?`${i(ht)}/${i(nt)}`:null;b&&b!==Z.lastAutoExpandedFor&&i(tn)&&(Z.lastAutoExpandedFor=b,Z.isExpanded(i(tn).repo)||Z.toggleRepo(i(tn).repo))});let Nt=L(void 0);Is(()=>{i(Nt)&&Z.sidebarScrollTop>0&&(i(Nt).scrollTop=Z.sidebarScrollTop)});function _r(){i(Nt)&&(Z.sidebarScrollTop=i(Nt).scrollTop)}function Ys(b){Z.toggleRepo(b)}function kr(b,_,R){kn(`/${b}/${_}/${R}`)}let En=L(null),Gs=L(!1);function To(b){return b.replace(/-/g," ").replace(/\b\w/g,_=>_.toUpperCase())}async function Vl(b,_){if(!i(Gs)){m(Gs,!0),m(En,null);try{const R=`${_}-${Date.now()}`,K=`Untitled ${To(_)}`,ke=new Date().toISOString(),me=ke.split("T")[0],be=_==="deck"?`<!-- slide: cover -->
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CTpBBS5W.js","./CbWA7IDo.js","./Da6P0VJZ.js","./C6O5NX2h.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{p as Vo,a as g,s as J,f as fe,l as Ca,o as _t,c as I,r as Yt,b as E,m as ec,u as tc,t as Jt,g as Ta,e as ln,d as fr}from"./C6O5NX2h.js";import{bd as nc,h as oi,z as ai,bu as rc,f as sc,t as K,ab as ic,bv as oc,o as Wo,C as ac,i as lc,b6 as cc,b3 as uc,k as dc,aX as fc,bs as hc,bw as pc,q as ei,y as $,bx as Ko,ak as gc,g as i,s as m,aF as Tr,p as N,l as ce,d as H,a as et,c as P,n as le,r as k,b as L,m as ue,x,Q as en,bn as vc,R as ps,bo as mc,I as bc,K as mt,L as li,W as cs,u as S,aD as Te,by as yc,bp as Ea,v as D,V as Is,al as tr,bt as wc,bk as Oa}from"./CbWA7IDo.js";import{B as xc,l as de,p as w,i as R,r as $e,s as ot,b as Ds}from"./Da6P0VJZ.js";import{a as _e,f as ti,d as se,c as Kt,i as ki,e as Fs,h as Wn,b as Dt,s as us,g as _c}from"./CTpBBS5W.js";import{c as q,_ as kc}from"./DbMgkTYM.js";import{r as Qt,e as xt,i as Ft,n as Re}from"./kW-E0CmU.js";import{g as kn,i as Sc}from"./BJlvZ6_w.js";import{i as tt}from"./D2e_f7WK.js";import{w as Z,d as jo,c as Pc}from"./DkBrGIdc.js";import{c as Et,a as gs,B as Qe,I as ds}from"./VncLXI-e.js";function Ac(){return Symbol(nc)}const Cc=Symbol("NaN");function Tc(n,e,t){oi&&ai();var s=new xc(n),r=!rc();sc(()=>{var a=e();a!==a&&(a=Cc),r&&a!==null&&typeof a=="object"&&(a={}),s.ensure(a,t)})}function Uo(n,e,t=!1,s=!1,r=!1){var a=n,o="";K(()=>{var c=ic;if(o===(o=e()??"")){oi&&ai();return}if(c.nodes!==null&&(oc(c.nodes.start,c.nodes.end),c.nodes=null),o!==""){if(oi){Wo.data;for(var l=ai(),d=l;l!==null&&(l.nodeType!==ac||l.data!=="");)d=l,l=lc(l);if(l===null)throw cc(),uc;Vo(Wo,d),a=dc(l);return}var h=t?hc:s?pc:void 0,f=fc(t?"svg":s?"math":"template",h);f.innerHTML=o;var u=t||s?f:f.content;if(Vo(ei(u),u.lastChild),t||s)for(;ei(u);)a.before(ei(u));else a.before(u)}})}class ci extends Map{#e=new Map;#t=$(0);#n=$(0);#r=Ko||-1;constructor(e){if(super(),e){for(var[t,s]of e)super.set(t,s);this.#n.v=super.size}}#s(e){return Ko===this.#r?$(e):gc(e)}has(e){var t=this.#e,s=t.get(e);if(s===void 0)if(super.has(e))s=this.#s(0),t.set(e,s);else return i(this.#t),!1;return i(s),!0}forEach(e,t){this.#i(),super.forEach(e,t)}get(e){var t=this.#e,s=t.get(e);if(s===void 0)if(super.has(e))s=this.#s(0),t.set(e,s);else{i(this.#t);return}return i(s),super.get(e)}set(e,t){var s=this.#e,r=s.get(e),a=super.get(e),o=super.set(e,t),c=this.#t;if(r===void 0)r=this.#s(0),s.set(e,r),m(this.#n,super.size),Tr(c);else if(a!==t){Tr(r);var l=c.reactions===null?null:new Set(c.reactions),d=l===null||!r.reactions?.every(h=>l.has(h));d&&Tr(c)}return o}delete(e){var t=this.#e,s=t.get(e),r=super.delete(e);return s!==void 0&&(t.delete(e),m(s,-1)),r&&(m(this.#n,super.size),Tr(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;m(this.#n,0);for(var t of e.values())m(t,-1);Tr(this.#t),e.clear()}}#i(){i(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var s=this.#s(0);e.set(t,s)}}for([,s]of this.#e)i(s)}keys(){return i(this.#t),super.keys()}values(){return this.#i(),super.values()}entries(){return this.#i(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return i(this.#n),super.size}}var qo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ec=/\n/g,Oc=/^\s*/,Rc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,zc=/^:\s*/,Mc=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ic=/^[;\s]*/,Dc=/^\s+|\s+$/g,Fc=`
|
|
3
|
+
`,Zo="/",Yo="*",Jn="",$c="comment",Nc="declaration";function Lc(n,e){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];e=e||{};var t=1,s=1;function r(v){var y=v.match(Ec);y&&(t+=y.length);var C=v.lastIndexOf(Fc);s=~C?v.length-C:s+v.length}function a(){var v={line:t,column:s};return function(y){return y.position=new o(v),d(),y}}function o(v){this.start=v,this.end={line:t,column:s},this.source=e.source}o.prototype.content=n;function c(v){var y=new Error(e.source+":"+t+":"+s+": "+v);if(y.reason=v,y.filename=e.source,y.line=t,y.column=s,y.source=n,!e.silent)throw y}function l(v){var y=v.exec(n);if(y){var C=y[0];return r(C),n=n.slice(C.length),y}}function d(){l(Oc)}function h(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=a();if(!(Zo!=n.charAt(0)||Yo!=n.charAt(1))){for(var y=2;Jn!=n.charAt(y)&&(Yo!=n.charAt(y)||Zo!=n.charAt(y+1));)++y;if(y+=2,Jn===n.charAt(y-1))return c("End of comment missing");var C=n.slice(2,y-2);return s+=2,r(C),n=n.slice(y),s+=2,v({type:$c,comment:C})}}function u(){var v=a(),y=l(Rc);if(y){if(f(),!l(zc))return c("property missing ':'");var C=l(Mc),O=v({type:Nc,property:Go(y[0].replace(qo,Jn)),value:C?Go(C[0].replace(qo,Jn)):Jn});return l(Ic),O}}function p(){var v=[];h(v);for(var y;y=u();)y!==!1&&(v.push(y),h(v));return v}return d(),p()}function Go(n){return n?n.replace(Dc,Jn):Jn}function Bc(n,e){let t=null;if(!n||typeof n!="string")return t;const s=Lc(n),r=typeof e=="function";return s.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:c}=a;r?e(o,c,a):c&&(t=t||{},t[o]=c)}),t}var Hc=fe("<title> </title>"),Vc=fe('<svg><!><path d="M29,27.5859l-7.5521-7.5521a11.0177,11.0177,0,1,0-1.4141,1.4141L27.5859,29ZM4,13a9,9,0,1,1,9,9A9.01,9.01,0,0,1,4,13Z"></path></svg>');function Ra(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Vc();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Hc(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var Wc=fe("<title> </title>"),Kc=fe('<svg><!><path d="M17.4141 16 24 9.4141 22.5859 8 16 14.5859 9.4143 8 8 9.4141 14.5859 16 8 22.5859 9.4143 24 16 17.4141 22.5859 24 24 22.5859 17.4141 16z"></path></svg>');function vs(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Kc();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Wc(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var jc=fe("<title> </title>"),Uc=fe('<svg><!><path d="M22 16 12 26 10.6 24.6 19.2 16 10.6 7.4 12 6z"></path></svg>');function Gr(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Uc();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=jc(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var qc=fe("<title> </title>"),Zc=fe('<svg><!><path d="M16 22 6 12 7.4 10.6 16 19.2 24.6 10.6 26 12z"></path></svg>');function Xr(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Zc();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=qc(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var Yc=fe("<title> </title>"),Gc=fe('<svg><!><path d="M6,30H18a2.0023,2.0023,0,0,0,2-2V25H18v3H6V4H18V7h2V4a2.0023,2.0023,0,0,0-2-2H6A2.0023,2.0023,0,0,0,4,4V28A2.0023,2.0023,0,0,0,6,30Z"></path><path d="M20.586 20.586 24.172 17 10 17 10 15 24.172 15 20.586 11.414 22 10 28 16 22 22 20.586 20.586z"></path></svg>');function Xc(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Gc();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Yc(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(2),k(l),g(n,l),L()}const Qc={project:"#5a70b0",organization:"#89a8ab",person:"#c09088",meeting:"#b5c090",deal:"#78d098",deliverable:"#e05050",decision:"#2a38a0",dataset:"#9090c0",process:"#b09890",deck:"#4a60a0",doc:"#a0c0d8",document:"#d8a0c0",note:"#707068",publication:"#d87070",reference:"#208850",task:"#b86058",role:"#484060","practice-area":"#7a7a98","case-study":"#2a4a3a",standard:"#dada98"};function dr(n){return n?Qc[n]??"#5c5c66":"#5c5c66"}const Jc={person:"people","practice-area":"practice-areas","case-study":"case-studies",process:"processes"};function eu(n){return Jc[n]??n+"s"}var tu=fe("<title> </title>"),nu=fe('<svg><!><path d="M17 15 17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z"></path></svg>');function Xo(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=nu();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=tu(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var ru=fe("<title> </title>"),su=fe('<svg><!><path d="M30.94,15.66A16.69,16.69,0,0,0,16,5,16.69,16.69,0,0,0,1.06,15.66a1,1,0,0,0,0,.68A16.69,16.69,0,0,0,16,27,16.69,16.69,0,0,0,30.94,16.34,1,1,0,0,0,30.94,15.66ZM16,25c-5.3,0-10.9-3.93-12.93-9C5.1,10.93,10.7,7,16,7s10.9,3.93,12.93,9C26.9,21.07,21.3,25,16,25Z"></path><path d="M16,10a6,6,0,1,0,6,6A6,6,0,0,0,16,10Zm0,10a4,4,0,1,1,4-4A4,4,0,0,1,16,20Z"></path></svg>');function iu(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=su();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=ru(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(2),k(l),g(n,l),L()}var ou=fe("<title> </title>"),au=fe('<svg><!><path d="M5.24,22.51l1.43-1.42A14.06,14.06,0,0,1,3.07,16C5.1,10.93,10.7,7,16,7a12.38,12.38,0,0,1,4,.72l1.55-1.56A14.72,14.72,0,0,0,16,5,16.69,16.69,0,0,0,1.06,15.66a1,1,0,0,0,0,.68A16,16,0,0,0,5.24,22.51Z"></path><path d="M12,15.73a4,4,0,0,1,3.7-3.7l1.81-1.82a6,6,0,0,0-7.33,7.33Z"></path><path d="M30.94,15.66A16.4,16.4,0,0,0,25.2,8.22L30,3.41,28.59,2,2,28.59,3.41,30l5.1-5.1A15.29,15.29,0,0,0,16,27,16.69,16.69,0,0,0,30.94,16.34,1,1,0,0,0,30.94,15.66ZM20,16a4,4,0,0,1-6,3.44L19.44,14A4,4,0,0,1,20,16Zm-4,9a13.05,13.05,0,0,1-6-1.58l2.54-2.54a6,6,0,0,0,8.35-8.35l2.87-2.87A14.54,14.54,0,0,1,28.93,16C26.9,21.07,21.3,25,16,25Z"></path></svg>');function ni(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=au();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=ou(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(3),k(l),g(n,l),L()}var lu=fe("<title> </title>"),cu=fe('<svg><!><path d="M12 12H14V24H12z"></path><path d="M18 12H20V24H18z"></path><path d="M4,6V8H6V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8h2V6ZM8,28V8H24V28Z"></path><path d="M12 2H20V4H12z"></path></svg>');function Dr(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=cu();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=lu(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(4),k(l),g(n,l),L()}var uu=fe("<title> </title>"),du=fe('<svg><!><path d="M27,16.76c0-.25,0-.5,0-.76s0-.51,0-.77l1.92-1.68A2,2,0,0,0,29.3,11L26.94,7a2,2,0,0,0-1.73-1,2,2,0,0,0-.64.1l-2.43.82a11.35,11.35,0,0,0-1.31-.75l-.51-2.52a2,2,0,0,0-2-1.61H13.64a2,2,0,0,0-2,1.61l-.51,2.52a11.48,11.48,0,0,0-1.32.75L7.43,6.06A2,2,0,0,0,6.79,6,2,2,0,0,0,5.06,7L2.7,11a2,2,0,0,0,.41,2.51L5,15.24c0,.25,0,.5,0,.76s0,.51,0,.77L3.11,18.45A2,2,0,0,0,2.7,21L5.06,25a2,2,0,0,0,1.73,1,2,2,0,0,0,.64-.1l2.43-.82a11.35,11.35,0,0,0,1.31.75l.51,2.52a2,2,0,0,0,2,1.61h4.72a2,2,0,0,0,2-1.61l.51-2.52a11.48,11.48,0,0,0,1.32-.75l2.42.82a2,2,0,0,0,.64.1,2,2,0,0,0,1.73-1L29.3,21a2,2,0,0,0-.41-2.51ZM25.21,24l-3.43-1.16a8.86,8.86,0,0,1-2.71,1.57L18.36,28H13.64l-.71-3.55a9.36,9.36,0,0,1-2.7-1.57L6.79,24,4.43,20l2.72-2.4a8.9,8.9,0,0,1,0-3.13L4.43,12,6.79,8l3.43,1.16a8.86,8.86,0,0,1,2.71-1.57L13.64,4h4.72l.71,3.55a9.36,9.36,0,0,1,2.7,1.57L25.21,8,27.57,12l-2.72,2.4a8.9,8.9,0,0,1,0,3.13L27.57,20Z"></path><path d="M16,22a6,6,0,1,1,6-6A5.94,5.94,0,0,1,16,22Zm0-10a3.91,3.91,0,0,0-4,4,3.91,3.91,0,0,0,4,4,3.91,3.91,0,0,0,4-4A3.91,3.91,0,0,0,16,12Z"></path></svg>');function fu(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=du();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=uu(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(2),k(l),g(n,l),L()}var hu=fe("<title> </title>"),pu=fe('<svg><!><path d="M12,10H6.78A11,11,0,0,1,27,16h2A13,13,0,0,0,6,7.68V4H4v8h8Z"></path><path d="M20,22h5.22A11,11,0,0,1,5,16H3a13,13,0,0,0,23,8.32V28h2V20H20Z"></path></svg>');function Qo(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=pu();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=hu(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(2),k(l),g(n,l),L()}var gu=fe("<title> </title>"),vu=fe('<svg><!><circle cx="8" cy="16" r="2"></circle><circle cx="16" cy="16" r="2"></circle><circle cx="24" cy="16" r="2"></circle></svg>');function Qr(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=vu();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=gu(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(3),k(l),g(n,l),L()}var mu=fe("<title> </title>"),bu=fe('<svg><!><path d="M2 26H30V28H2z"></path><path d="M25.4,9c0.8-0.8,0.8-2,0-2.8c0,0,0,0,0,0l-3.6-3.6c-0.8-0.8-2-0.8-2.8,0c0,0,0,0,0,0l-15,15V24h6.4L25.4,9z M20.4,4L24,7.6 l-3,3L17.4,7L20.4,4z M6,22v-3.6l10-10l3.6,3.6l-10,10H6z"></path></svg>');function za(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=bu();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=mu(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(2),k(l),g(n,l),L()}var yu=fe("<title> </title>"),wu=fe('<svg><!><path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"></path><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"></path></svg>');function Jo(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=wu();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=yu(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(2),k(l),g(n,l),L()}function xu(n){return typeof n=="function"}function Hr(n){return n!==null&&typeof n=="object"}const _u=["string","number","bigint","boolean"];function ui(n){return n==null||_u.includes(typeof n)?!0:Array.isArray(n)?n.every(e=>ui(e)):typeof n=="object"?Object.getPrototypeOf(n)===Object.prototype:!1}const gr=Symbol("box"),$s=Symbol("is-writable");function M(n,e){const t=x(n);return e?{[gr]:!0,[$s]:!0,get current(){return i(t)},set current(s){e(s)}}:{[gr]:!0,get current(){return n()}}}function Vr(n){return Hr(n)&&gr in n}function Si(n){return Vr(n)&&$s in n}function Ma(n){return Vr(n)?n:xu(n)?M(n):Sn(n)}function ku(n){return Object.entries(n).reduce((e,[t,s])=>Vr(s)?(Si(s)?Object.defineProperty(e,t,{get(){return s.current},set(r){s.current=r}}):Object.defineProperty(e,t,{get(){return s.current}}),e):Object.assign(e,{[t]:s}),{})}function Su(n){return Si(n)?{[gr]:!0,get current(){return n.current}}:n}function Sn(n){let e=$(en(n));return{[gr]:!0,[$s]:!0,get current(){return i(e)},set current(t){m(e,t,!0)}}}function or(n){let e=$(en(n));return{[gr]:!0,[$s]:!0,get current(){return i(e)},set current(t){m(e,t,!0)}}}or.from=Ma;or.with=M;or.flatten=ku;or.readonly=Su;or.isBox=Vr;or.isWritableBox=Si;function Ia(...n){return function(e){for(const t of n)if(t){if(e.defaultPrevented)return;typeof t=="function"?t.call(this,e):t.current?.call(this,e)}}}const Pu=/\d/,Au=["-","_","/","."];function Cu(n=""){if(!Pu.test(n))return n!==n.toLowerCase()}function Tu(n){const e=[];let t="",s,r;for(const a of n){const o=Au.includes(a);if(o===!0){e.push(t),t="",s=void 0;continue}const c=Cu(a);if(r===!1){if(s===!1&&c===!0){e.push(t),t=a,s=c;continue}if(s===!0&&c===!1&&t.length>1){const l=t.at(-1);e.push(t.slice(0,Math.max(0,t.length-1))),t=l+a,s=c;continue}}t+=a,s=c,r=o}return e.push(t),e}function Da(n){return n?Tu(n).map(e=>Ou(e)).join(""):""}function Eu(n){return Ru(Da(n||""))}function Ou(n){return n?n[0].toUpperCase()+n.slice(1):""}function Ru(n){return n?n[0].toLowerCase()+n.slice(1):""}function Fr(n){if(!n)return{};const e={};function t(s,r){if(s.startsWith("-moz-")||s.startsWith("-webkit-")||s.startsWith("-ms-")||s.startsWith("-o-")){e[Da(s)]=r;return}if(s.startsWith("--")){e[s]=r;return}e[Eu(s)]=r}return Bc(n,t),e}function nr(...n){return(...e)=>{for(const t of n)typeof t=="function"&&t(...e)}}function zu(n,e){const t=RegExp(n,"g");return s=>{if(typeof s!="string")throw new TypeError(`expected an argument of type string, but got ${typeof s}`);return s.match(t)?s.replace(t,e):s}}const Mu=zu(/[A-Z]/,n=>`-${n.toLowerCase()}`);function Iu(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(e=>`${Mu(e)}: ${n[e]};`).join(`
|
|
4
|
+
`)}function Fa(n={}){return Iu(n).replace(`
|
|
5
|
+
`," ")}const Du=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Fu=new Set(Du);function $u(n){return Fu.has(n)}function Je(...n){const e={...n[0]};for(let t=1;t<n.length;t++){const s=n[t];if(s){for(const r of Object.keys(s)){const a=e[r],o=s[r],c=typeof a=="function",l=typeof o=="function";if(c&&$u(r)){const d=a,h=o;e[r]=Ia(d,h)}else if(c&&l)e[r]=nr(a,o);else if(r==="class"){const d=ui(a),h=ui(o);d&&h?e[r]=ti(a,o):d?e[r]=ti(a):h&&(e[r]=ti(o))}else if(r==="style"){const d=typeof a=="object",h=typeof o=="object",f=typeof a=="string",u=typeof o=="string";if(d&&h)e[r]={...a,...o};else if(d&&u){const p=Fr(o);e[r]={...a,...p}}else if(f&&h){const p=Fr(a);e[r]={...p,...o}}else if(f&&u){const p=Fr(a),v=Fr(o);e[r]={...p,...v}}else d?e[r]=a:h?e[r]=o:f?e[r]=a:u&&(e[r]=o)}else e[r]=o!==void 0?o:a}for(const r of Object.getOwnPropertySymbols(s)){const a=e[r],o=s[r];e[r]=o!==void 0?o:a}}}return typeof e.style=="object"&&(e.style=Fa(e.style).replaceAll(`
|
|
6
|
+
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const $a=typeof window<"u"?window:void 0;function Nu(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Lu{#e;#t;constructor(e={}){const{window:t=$a,document:s=t?.document}=e;t!==void 0&&(this.#e=s,this.#t=Ca(r=>{const a=_t(t,"focusin",r),o=_t(t,"focusout",r);return()=>{a(),o()}}))}get current(){return this.#t?.(),this.#e?Nu(this.#e):null}}new Lu;function Bu(n){return typeof n=="function"}class $n{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return vc(this.#t)}get(){const e=ps(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=ps(this.#t);return t===void 0?e:t}set(e){return mc(this.#t,e)}}function Hu(n,e){switch(n){case"post":mt(e);break;case"pre":bc(e);break}}function Na(n,e,t,s={}){const{lazy:r=!1}=s;let a=!r,o=Array.isArray(n)?[]:void 0;Hu(e,()=>{const c=Array.isArray(n)?n.map(d=>d()):n();if(!a){a=!0,o=c;return}const l=li(()=>t(c,o));return o=c,l})}function Tt(n,e,t){Na(n,"post",e,t)}function Vu(n,e,t){Na(n,"pre",e,t)}Tt.pre=Vu;function ea(n){return Bu(n)?n():n}class Wu{#e={width:0,height:0};#t=!1;#n;#r;#s;#i=x(()=>(i(this.#o)?.(),this.getSize().width));#a=x(()=>(i(this.#o)?.(),this.getSize().height));#o=x(()=>{const e=ea(this.#r);if(e)return Ca(t=>{if(!this.#s)return;const s=new this.#s.ResizeObserver(r=>{this.#t=!0;for(const a of r){const o=this.#n.box==="content-box"?a.contentBoxSize:a.borderBoxSize,c=Array.isArray(o)?o:[o];this.#e.width=c.reduce((l,d)=>Math.max(l,d.inlineSize),0),this.#e.height=c.reduce((l,d)=>Math.max(l,d.blockSize),0)}t()});return s.observe(e),()=>{this.#t=!1,s.disconnect()}})});constructor(e,t={box:"border-box"}){this.#s=t.window??$a,this.#n=t,this.#r=e,this.#e={width:0,height:0}}calculateSize(){const e=ea(this.#r);if(!e||!this.#s)return;const t=e.offsetWidth,s=e.offsetHeight;if(this.#n.box==="border-box")return{width:t,height:s};const r=this.#s.getComputedStyle(e),a=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),o=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),c=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth),l=parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth),d=t-a-c,h=s-o-l;return{width:d,height:h}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return i(this.#o)?.(),this.getSize()}get width(){return i(this.#i)}get height(){return i(this.#a)}}function br(n){mt(()=>()=>{n()})}function La(n,e){return setTimeout(e,n)}function zn(n){cs().then(n)}const Ku=1,ju=9,Uu=11;function di(n){return Hr(n)&&n.nodeType===Ku&&typeof n.nodeName=="string"}function Ba(n){return Hr(n)&&n.nodeType===ju}function qu(n){return Hr(n)&&n.constructor?.name==="VisualViewport"}function Zu(n){return Hr(n)&&n.nodeType!==void 0}function Ha(n){return Zu(n)&&n.nodeType===Uu&&"host"in n}function Yu(n,e){if(!n||!e||!di(n)||!di(e))return!1;const t=e.getRootNode?.();if(n===e||n.contains(e))return!0;if(t&&Ha(t)){let s=e;for(;s;){if(n===s)return!0;s=s.parentNode||s.host}}return!1}function Wr(n){return Ba(n)?n:qu(n)?n.document:n?.ownerDocument??document}function Pi(n){return Ha(n)?Pi(n.host):Ba(n)?n.defaultView??window:di(n)?n.ownerDocument?.defaultView??window:window}function Gu(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class Ai{element;#e=x(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return i(this.#e)}set root(e){m(this.#e,e)}constructor(e){typeof e=="function"?this.element=M(e):this.element=e}getDocument=()=>Wr(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Gu(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)}function $t(n,e){return{[Ac()]:t=>Vr(n)?(n.current=t,li(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(n.current=null,e?.(null))}):(n(t),li(()=>e?.(t)),()=>{"isConnected"in t&&t.isConnected||(n(null),e?.(null))})}}function Ci(n){return n?"true":"false"}function jn(n){return n?"":void 0}function Xu(n){return n?!0:void 0}function Ti(n){return n?"open":"closed"}function db(n,e){return e?"mixed":n?"true":"false"}class Qu{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(t=>[t,this.getAttr(t)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}}function Ei(n){const e=new Qu(n);return{...e.attrs,selector:e.selector,getAttr:e.getAttr}}const Lr="ArrowDown",Oi="ArrowLeft",Ri="ArrowRight",ms="ArrowUp",Va="End",Kr="Enter",Ju="Escape",Wa="Home",ed="PageDown",td="PageUp",yr=" ",nd="Tab";function rd(n){return window.getComputedStyle(n).getPropertyValue("direction")}function sd(n="ltr",e="horizontal"){return{horizontal:n==="rtl"?Oi:Ri,vertical:Lr}[e]}function id(n="ltr",e="horizontal"){return{horizontal:n==="rtl"?Ri:Oi,vertical:ms}[e]}function od(n="ltr",e="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(e)||(e="horizontal"),{nextKey:sd(n,e),prevKey:id(n,e)}}const Ka=typeof document<"u",ta=ad();function ad(){return Ka&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Mn(n){return n instanceof HTMLElement}function fi(n){return n instanceof Element}function ja(n){return n instanceof Element||n instanceof SVGElement}function ld(n){return n!==null}function cd(n){return n instanceof HTMLInputElement&&"select"in n}class Ua{#e;#t=or(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,s=!1){const r=this.#e.rootNode.current;if(!r||!e)return;const a=this.getCandidateNodes();if(!a.length)return;const o=a.indexOf(e),c=rd(r),{nextKey:l,prevKey:d}=od(c,this.#e.orientation.current),h=this.#e.loop.current,f={[l]:o+1,[d]:o-1,[Wa]:0,[Va]:a.length-1};if(s){const v=l===Lr?Ri:Lr,y=d===ms?Oi:ms;f[v]=o+1,f[y]=o-1}let u=f[t.key];if(u===void 0)return;t.preventDefault(),u<0&&h?u=a.length-1:u===a.length&&h&&(u=0);const p=a[u];if(p)return p.focus(),this.#t.current=p.id,this.#e.onCandidateFocus?.(p),p}getTabIndex(e){const t=this.getCandidateNodes(),s=this.#t.current!==null;return e&&!s&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){const e=this.#t.current;if(!e)return;const t=this.#e.rootNode.current?.querySelector(`#${e}`);!t||!Mn(t)||t.focus()}}class ud{#e;#t=null;constructor(e){this.#e=e,br(()=>this.#n())}#n(){this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null)}run(e){this.#n();const t=this.#e.ref.current;if(t){if(typeof t.getAnimations!="function"){this.#r(e);return}this.#t=window.requestAnimationFrame(()=>{const s=t.getAnimations();if(s.length===0){this.#r(e);return}Promise.allSettled(s.map(r=>r.finished)).then(()=>{this.#r(e)})})}}#r(e){const t=()=>{e()};this.#e.afterTick?zn(t):t()}}class hi{#e;#t;#n;#r=$(!1);constructor(e){this.#e=e,m(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new ud({ref:this.#e.ref,afterTick:this.#e.open}),Tt(()=>this.#e.open.current,t=>{t&&m(this.#r,!0),this.#t&&this.#n.run(()=>{t===this.#e.open.current&&(this.#e.open.current||m(this.#r,!1),this.#e.onComplete?.())})})}get shouldRender(){return i(this.#r)}}function Ve(){}function Gt(n,e){return`bits-${n}`}const dd=Ei({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),In=new $n("Dialog.Root | AlertDialog.Root");class Ns{static create(e){const t=In.getOr(null);return In.set(new Ns(e,t))}opts;#e=$(null);get triggerNode(){return i(this.#e)}set triggerNode(e){m(this.#e,e,!0)}#t=$(null);get contentNode(){return i(this.#t)}set contentNode(e){m(this.#t,e,!0)}#n=$(null);get overlayNode(){return i(this.#n)}set overlayNode(e){m(this.#n,e,!0)}#r=$(null);get descriptionNode(){return i(this.#r)}set descriptionNode(e){m(this.#r,e,!0)}#s=$(void 0);get contentId(){return i(this.#s)}set contentId(e){m(this.#s,e,!0)}#i=$(void 0);get titleId(){return i(this.#i)}set titleId(e){m(this.#i,e,!0)}#a=$(void 0);get triggerId(){return i(this.#a)}set triggerId(e){m(this.#a,e,!0)}#o=$(void 0);get descriptionId(){return i(this.#o)}set descriptionId(e){m(this.#o,e,!0)}#l=$(null);get cancelNode(){return i(this.#l)}set cancelNode(e){m(this.#l,e,!0)}#u=$(0);get nestedOpenCount(){return i(this.#u)}set nestedOpenCount(e){m(this.#u,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new hi({ref:M(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new hi({ref:M(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Tt(()=>this.opts.open.current,s=>{this.parent&&(s?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),br(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>dd.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#c=x(()=>({"data-state":Ti(this.opts.open.current)}));get sharedProps(){return i(this.#c)}set sharedProps(e){m(this.#c,e)}}class zi{static create(e){return new zi(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===yr||e.key===Kr)&&(e.preventDefault(),this.root.handleClose())}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Mi{static create(e){return new Mi(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(this.opts.ref)}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("action")]:"",...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Ii{static create(e){return new Ii(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=$t(this.opts.ref),Tt.pre(()=>this.opts.id.current,s=>{this.root.titleId=s})}#e=x(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Di{static create(e){return new Di(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=$t(this.opts.ref,s=>{this.root.descriptionNode=s}),Tt.pre(()=>this.opts.id.current,s=>{this.root.descriptionId=s})}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Ls{static create(e){return new Ls(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(this.opts.ref,s=>{this.root.contentNode=s,this.root.contentId=s?.id})}#e=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return i(this.#e)}set snippetProps(e){m(this.#e,e)}#t=x(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":jn(this.root.nestedOpenCount>0),"data-nested":jn(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}}class Fi{static create(e){return new Fi(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(this.opts.ref,s=>this.root.overlayNode=s)}#e=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return i(this.#e)}set snippetProps(e){m(this.#e,e)}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":jn(this.root.nestedOpenCount>0),"data-nested":jn(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}}class $i{static create(e){return new $i(e,In.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(this.opts.ref,s=>this.root.cancelNode=s),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===yr||e.key===Kr)&&(e.preventDefault(),this.root.handleClose())}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("cancel")]:"",onclick:this.onclick,onkeydown:this.onkeydown,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}function fd(n,e){N(e,!0);let t=w(e,"open",15,!1),s=w(e,"onOpenChange",3,Ve),r=w(e,"onOpenChangeComplete",3,Ve);Ns.create({variant:M(()=>"alert-dialog"),open:M(()=>t(),c=>{t(c),s()(c)}),onOpenChangeComplete:M(()=>r())});var a=I(),o=S(a);se(o,()=>e.children??Te),g(n,a),L()}var hd=E("<div><!></div>");function qa(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"level",3,2),o=$e(e,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const c=Ii.create({id:M(()=>s()),level:M(()=>a()),ref:M(()=>r(),p=>r(p))}),l=x(()=>Je(o,c.props));var d=I(),h=S(d);{var f=p=>{var v=I(),y=S(v);se(y,()=>e.child,()=>({props:i(l)})),g(p,v)},u=p=>{var v=hd();_e(v,()=>({...i(l)}));var y=P(v);se(y,()=>e.children??Te),k(v),g(p,v)};R(h,p=>{e.child?p(f):p(u,!1)})}g(n,d),L()}var pd=E("<button><!></button>");function gd(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=$e(e,["$$slots","$$events","$$legacy","children","child","id","ref"]);const o=Mi.create({id:M(()=>s()),ref:M(()=>r(),u=>r(u))}),c=x(()=>Je(a,o.props));var l=I(),d=S(l);{var h=u=>{var p=I(),v=S(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=pd();_e(p,()=>({...i(c)}));var v=P(p);se(v,()=>e.children??Te),k(p),g(u,p)};R(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),L()}var vd=E("<button><!></button>");function md(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"disabled",3,!1),o=$e(e,["$$slots","$$events","$$legacy","id","ref","children","child","disabled"]);const c=$i.create({id:M(()=>s()),ref:M(()=>r(),p=>r(p)),disabled:M(()=>!!a())}),l=x(()=>Je(o,c.props));var d=I(),h=S(d);{var f=p=>{var v=I(),y=S(v);se(y,()=>e.child,()=>({props:i(l)})),g(p,v)},u=p=>{var v=vd();_e(v,()=>({...i(l)}));var y=P(v);se(y,()=>e.children??Te),k(v),g(p,v)};R(h,p=>{e.child?p(f):p(u,!1)})}g(n,d),L()}function bd(n,e){var t=I(),s=S(t);Tc(s,()=>e.children,r=>{var a=I(),o=S(a);se(o,()=>e.children??Te),g(r,a)}),g(n,t)}const yd=new $n("BitsConfig");function wd(){const n=new xd(null,{});return yd.getOr(n).opts}class xd{opts;constructor(e,t){const s=_d(e,t);this.opts={defaultPortalTo:s(r=>r.defaultPortalTo),defaultLocale:s(r=>r.defaultLocale)}}}function _d(n,e){return t=>M(()=>{const r=t(e)?.current;if(r!==void 0)return r;if(n!==null)return t(n.opts)?.current})}function kd(n,e){return t=>{const s=wd();return M(()=>{const r=t();if(r!==void 0)return r;const a=n(s).current;return a!==void 0?a:e})}}const Sd=kd(n=>n.defaultPortalTo,"body");function Ni(n,e){N(e,!0);const t=Sd(()=>e.to),s=yc();let r=x(a);function a(){if(!Ka||e.disabled)return null;let f=null;return typeof t.current=="string"?f=document.querySelector(t.current):f=t.current,f}let o;function c(){o&&(tc(o),o=null)}Tt([()=>i(r),()=>e.disabled],([f,u])=>{if(!f||u){c();return}return o=ec(bd,{target:f,props:{children:e.children},context:s}),()=>{c()}});var l=I(),d=S(l);{var h=f=>{var u=I(),p=S(u);se(p,()=>e.children??Te),g(f,u)};R(d,f=>{e.disabled&&f(h)})}g(n,l),L()}class Pd{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){const s=this.createEvent(t);return e.dispatchEvent(s),s}listen(e,t,s){const r=a=>{t(a)};return _t(e,this.eventName,r,s)}}function na(n,e=500){let t=null;const s=(...r)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{n(...r)},e)};return s.destroy=()=>{t!==null&&(clearTimeout(t),t=null)},s}function Za(n,e){return n===e||n.contains(e)}function Ya(n){return n?.ownerDocument??document}function Ad(n,e){const{clientX:t,clientY:s}=n,r=e.getBoundingClientRect();return t<r.left||t>r.right||s<r.top||s>r.bottom}const Cd=[Kr,yr],Td=[Lr,td,Wa],Ga=[ms,ed,Va],Ed=[...Td,...Ga];function ra(n){return n.pointerType==="mouse"}function Od(n,{select:e=!1}={}){if(!n||!n.focus)return;const t=Wr(n);if(t.activeElement===n)return;const s=t.activeElement;n.focus({preventScroll:!0}),n!==s&&cd(n)&&e&&n.select()}function Rd(n,{select:e=!1}={},t){const s=t();for(const r of n)if(Od(r,{select:e}),t()!==s)return!0}let Er=$(!1);class Kn{static _refs=0;static _cleanup;constructor(){mt(()=>(Kn._refs===0&&(Kn._cleanup=Ea(()=>{const e=[],t=r=>{m(Er,!1)},s=r=>{m(Er,!0)};return e.push(_t(document,"pointerdown",t,{capture:!0}),_t(document,"pointermove",t,{capture:!0}),_t(document,"keydown",s,{capture:!0})),nr(...e)})),Kn._refs++,()=>{Kn._refs--,Kn._refs===0&&(m(Er,!1),Kn._cleanup?.())}))}get current(){return i(Er)}set current(e){m(Er,e,!0)}}var Xa=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],bs=Xa.join(","),Qa=typeof Element>"u",rr=Qa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ys=!Qa&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n?.ownerDocument},ws=function(e,t){var s;t===void 0&&(t=!0);var r=e==null||(s=e.getAttribute)===null||s===void 0?void 0:s.call(e,"inert"),a=r===""||r==="true",o=a||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ws(e.parentNode));return o},zd=function(e){var t,s=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return s===""||s==="true"},Ja=function(e,t,s){if(ws(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(bs));return t&&rr.call(e,bs)&&r.unshift(e),r=r.filter(s),r},xs=function(e,t,s){for(var r=[],a=Array.from(e);a.length;){var o=a.shift();if(!ws(o,!1))if(o.tagName==="SLOT"){var c=o.assignedElements(),l=c.length?c:o.children,d=xs(l,!0,s);s.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else{var h=rr.call(o,bs);h&&s.filter(o)&&(t||!e.includes(o))&&r.push(o);var f=o.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(o),u=!ws(f,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(o));if(f&&u){var p=xs(f===!0?o.children:f.children,!0,s);s.flatten?r.push.apply(r,p):r.push({scopeParent:o,candidates:p})}else a.unshift.apply(a,o.children)}}return r},el=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tl=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||zd(e))&&!el(e)?0:e.tabIndex},Md=function(e,t){var s=tl(e);return s<0&&t&&!el(e)?0:s},Id=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},nl=function(e){return e.tagName==="INPUT"},Dd=function(e){return nl(e)&&e.type==="hidden"},Fd=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(s){return s.tagName==="SUMMARY"});return t},$d=function(e,t){for(var s=0;s<e.length;s++)if(e[s].checked&&e[s].form===t)return e[s]},Nd=function(e){if(!e.name)return!0;var t=e.form||ys(e),s=function(c){return t.querySelectorAll('input[type="radio"][name="'+c+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=s(window.CSS.escape(e.name));else try{r=s(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=$d(r,e.form);return!a||a===e},Ld=function(e){return nl(e)&&e.type==="radio"},Bd=function(e){return Ld(e)&&!Nd(e)},Hd=function(e){var t,s=e&&ys(e),r=(t=s)===null||t===void 0?void 0:t.host,a=!1;if(s&&s!==e){var o,c,l;for(a=!!((o=r)!==null&&o!==void 0&&(c=o.ownerDocument)!==null&&c!==void 0&&c.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!a&&r;){var d,h,f;s=ys(r),r=(d=s)===null||d===void 0?void 0:d.host,a=!!((h=r)!==null&&h!==void 0&&(f=h.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return a},sa=function(e){var t=e.getBoundingClientRect(),s=t.width,r=t.height;return s===0&&r===0},Vd=function(e,t){var s=t.displayCheck,r=t.getShadowRoot;if(s==="full-native"&&"checkVisibility"in e){var a=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(e).visibility==="hidden")return!0;var o=rr.call(e,"details>summary:first-of-type"),c=o?e.parentElement:e;if(rr.call(c,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof r=="function"){for(var l=e;e;){var d=e.parentElement,h=ys(e);if(d&&!d.shadowRoot&&r(d)===!0)return sa(e);e.assignedSlot?e=e.assignedSlot:!d&&h!==e.ownerDocument?e=h.host:e=d}e=l}if(Hd(e))return!e.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return sa(e);return!1},Wd=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var s=0;s<t.children.length;s++){var r=t.children.item(s);if(r.tagName==="LEGEND")return rr.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},_s=function(e,t){return!(t.disabled||Dd(t)||Vd(t,e)||Fd(t)||Wd(t))},pi=function(e,t){return!(Bd(t)||tl(t)<0||!_s(e,t))},Kd=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},rl=function(e){var t=[],s=[];return e.forEach(function(r,a){var o=!!r.scopeParent,c=o?r.scopeParent:r,l=Md(c,o),d=o?rl(r.candidates):c;l===0?o?t.push.apply(t,d):t.push(c):s.push({documentOrder:a,tabIndex:l,item:r,isScope:o,content:d})}),s.sort(Id).reduce(function(r,a){return a.isScope?r.push.apply(r,a.content):r.push(a.content),r},[]).concat(t)},sl=function(e,t){t=t||{};var s;return t.getShadowRoot?s=xs([e],t.includeContainer,{filter:pi.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Kd}):s=Ja(e,t.includeContainer,pi.bind(null,t)),rl(s)},il=function(e,t){t=t||{};var s;return t.getShadowRoot?s=xs([e],t.includeContainer,{filter:_s.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):s=Ja(e,t.includeContainer,_s.bind(null,t)),s},Li=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return rr.call(e,bs)===!1?!1:pi(t,e)},jd=Xa.concat("iframe:not([inert]):not([inert] *)").join(","),ol=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return rr.call(e,jd)===!1?!1:_s(t,e)};function Nr(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Ud(n,e){if(!Li(n,Nr()))return qd(n,e);const t=Wr(n),s=sl(t.body,Nr());e==="prev"&&s.reverse();const r=s.indexOf(n);return r===-1?t.body:s.slice(r+1)[0]}function qd(n,e){const t=Wr(n);if(!ol(n,Nr()))return t.body;const s=il(t.body,Nr());e==="prev"&&s.reverse();const r=s.indexOf(n);return r===-1?t.body:s.slice(r+1).find(o=>Li(o,Nr()))??t.body}function Zd(n,e){return n.length!==e.length?!1:n.every((t,s)=>al(t,e[s]))}function al(n,e){return Number.isNaN(n)&&Number.isNaN(e)?!0:Array.isArray(n)&&Array.isArray(e)?Zd(n,e):typeof n=="object"&&typeof e=="object"?Yd(n,e):Object.is(n,e)}function Yd(n,e){if(typeof n!="object"||typeof e!="object"||n===null||e===null)return!1;const t=Object.keys(n),s=Object.keys(e);if(t.length!==s.length)return!1;for(const r of t)if(!s.includes(r)||!al(n[r],e[r]))return!1;return!0}function fb(n,e,t=!0){if(!(n.length===0||e<0||e>=n.length))return n.length===1&&e===0?n[0]:e===n.length-1?t?n[0]:void 0:n[e+1]}function hb(n,e,t=!0){if(!(n.length===0||e<0||e>=n.length))return n.length===1&&e===0?n[0]:e===0?t?n[n.length-1]:void 0:n[e-1]}function pb(n,e,t,s=!0){if(n.length===0||e<0||e>=n.length)return;let r=e+t;return s?r=(r%n.length+n.length)%n.length:r=Math.max(0,Math.min(r,n.length-1)),n[r]}function gb(n,e,t,s=!0){if(n.length===0||e<0||e>=n.length)return;let r=e-t;return s?r=(r%n.length+n.length)%n.length:r=Math.max(0,Math.min(r,n.length-1)),n[r]}function ll(n,e,t){const s=e.toLowerCase();if(s.endsWith(" ")){const f=s.slice(0,-1);if(n.filter(y=>y.toLowerCase().startsWith(f)).length<=1)return ll(n,f,t);const p=t?.toLowerCase();if(p&&p.startsWith(f)&&p.charAt(f.length)===" "&&e.trim()===f)return t;const v=n.filter(y=>y.toLowerCase().startsWith(s));if(v.length>0){const y=t?n.indexOf(t):-1;return ia(v,Math.max(y,0)).find(T=>T!==t)||t}}const a=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,o=a.toLowerCase(),c=t?n.indexOf(t):-1;let l=ia(n,Math.max(c,0));a.length===1&&(l=l.filter(f=>f!==t));const h=l.find(f=>f?.toLowerCase().startsWith(o));return h!==t?h:void 0}function ia(n,e){return n.map((t,s)=>n[(e+s)%n.length])}const Gd={afterMs:1e4,onChange:Ve};function cl(n,e){const{afterMs:t,onChange:s,getWindow:r}={...Gd,...e};let a=null,o=$(en(n));function c(){return r().setTimeout(()=>{m(o,n,!0),s?.(n)},t)}return mt(()=>()=>{a&&r().clearTimeout(a)}),M(()=>i(o),l=>{m(o,l,!0),s?.(l),a&&r().clearTimeout(a),a=c()})}class Xd{#e;#t;#n=x(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#r=x(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=cl("",{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;const s=i(this.#r)(),r=t.find(l=>l===s)?.textContent?.trim()??"",a=t.map(l=>l.textContent?.trim()??""),o=ll(a,this.#t.current,r),c=t.find(l=>l.textContent?.trim()===o);return c&&i(this.#n)(c),c}resetTypeahead(){this.#t.current=""}get search(){return this.#t.current}}class Qd{#e;#t;#n;#r=$(null);constructor(e){this.#e=e,this.#t=x(()=>this.#e.enabled()),this.#n=cl(!1,{afterMs:e.transitTimeout??300,onChange:t=>{i(this.#t)&&this.#e.setIsPointerInTransit?.(t)},getWindow:()=>Pi(this.#e.triggerNode())}),Tt([e.triggerNode,e.contentNode,e.enabled],([t,s,r])=>{if(!t||!s||!r)return;const a=c=>{this.#i(c,s)},o=c=>{this.#i(c,t)};return nr(_t(t,"pointerleave",a),_t(s,"pointerleave",o))}),Tt(()=>i(this.#r),()=>{const t=r=>{if(!i(this.#r))return;const a=r.target;if(!fi(a))return;const o={x:r.clientX,y:r.clientY},c=e.triggerNode()?.contains(a)||e.contentNode()?.contains(a),l=!nf(o,i(this.#r));c?this.#s():l&&(this.#s(),e.onPointerExit())},s=Wr(e.triggerNode()??e.contentNode());if(s)return _t(s,"pointermove",t)})}#s(){m(this.#r,null),this.#n.current=!1}#i(e,t){const s=e.currentTarget;if(!Mn(s))return;const r={x:e.clientX,y:e.clientY},a=Jd(r,s.getBoundingClientRect()),o=ef(r,a),c=tf(t.getBoundingClientRect()),l=rf([...o,...c]);m(this.#r,l,!0),this.#n.current=!0}}function Jd(n,e){const t=Math.abs(e.top-n.y),s=Math.abs(e.bottom-n.y),r=Math.abs(e.right-n.x),a=Math.abs(e.left-n.x);switch(Math.min(t,s,r,a)){case a:return"left";case r:return"right";case t:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function ef(n,e,t=5){const s=t*1.5;switch(e){case"top":return[{x:n.x-t,y:n.y+t},{x:n.x,y:n.y-s},{x:n.x+t,y:n.y+t}];case"bottom":return[{x:n.x-t,y:n.y-t},{x:n.x,y:n.y+s},{x:n.x+t,y:n.y-t}];case"left":return[{x:n.x+t,y:n.y-t},{x:n.x-s,y:n.y},{x:n.x+t,y:n.y+t}];case"right":return[{x:n.x-t,y:n.y-t},{x:n.x+s,y:n.y},{x:n.x-t,y:n.y+t}]}}function tf(n){const{top:e,right:t,bottom:s,left:r}=n;return[{x:r,y:e},{x:t,y:e},{x:t,y:s},{x:r,y:s}]}function nf(n,e){const{x:t,y:s}=n;let r=!1;for(let a=0,o=e.length-1;a<e.length;o=a++){const c=e[a].x,l=e[a].y,d=e[o].x,h=e[o].y;l>s!=h>s&&t<(d-c)*(s-l)/(h-l)+c&&(r=!r)}return r}function rf(n){const e=n.slice();return e.sort((t,s)=>t.x<s.x?-1:t.x>s.x?1:t.y<s.y?-1:t.y>s.y?1:0),sf(e)}function sf(n){if(n.length<=1)return n.slice();const e=[];for(let s=0;s<n.length;s++){const r=n[s];for(;e.length>=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(r.y-o.y)>=(a.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let s=n.length-1;s>=0;s--){const r=n[s];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(r.y-o.y)>=(a.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}const of="data-context-menu-trigger",af="data-context-menu-content",ul=new $n("Menu.Root"),Bi=new $n("Menu.Root | Menu.Sub"),dl=new $n("Menu.Content"),lf=new Pd("bitsmenuopen",{bubbles:!1,cancelable:!0}),cf=Ei({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class Hi{static create(e){const t=new Hi(e);return ul.set(t)}opts;isUsingKeyboard=new Kn;#e=$(!1);get ignoreCloseAutoFocus(){return i(this.#e)}set ignoreCloseAutoFocus(e){m(this.#e,e,!0)}#t=$(!1);get isPointerInTransit(){return i(this.#t)}set isPointerInTransit(e){m(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>cf.getAttr(e,this.opts.variant.current)}class Vi{static create(e,t){return Bi.set(new Vi(e,t,null))}opts;root;parentMenu;contentId=M(()=>"");#e=$(null);get contentNode(){return i(this.#e)}set contentNode(e){m(this.#e,e,!0)}contentPresence;#t=$(null);get triggerNode(){return i(this.#t)}set triggerNode(e){m(this.#t,e,!0)}constructor(e,t,s){this.opts=e,this.root=t,this.parentMenu=s,this.contentPresence=new hi({ref:M(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),s&&Tt(()=>s.opts.open.current,()=>{s.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class Wi{static create(e){return dl.set(new Wi(e,Bi.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=$("");get search(){return i(this.#e)}set search(e){m(this.#e,e,!0)}#t=0;#n;#r=$(!1);get mounted(){return i(this.#r)}set mounted(e){m(this.#r,e,!0)}#s;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new Ai(e.ref),this.attachment=$t(this.opts.ref,s=>{this.parentMenu.contentNode!==s&&(this.parentMenu.contentNode=s)}),t.contentId=e.id,this.#s=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Qd({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:s=>{this.parentMenu.root.isPointerInTransit=s}}),this.#n=new Xd({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new Ua({rootNode:M(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:M(()=>"vertical")}),Tt(()=>this.parentMenu.contentNode,s=>{if(!s)return;const r=()=>{zn(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return lf.listen(s,r)}),mt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#i(){const e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=e=>{this.opts.onCloseAutoFocus.current?.(e),!(e.defaultPrevented||this.#s)&&this.parentMenu.triggerNode&&Li(this.parentMenu.triggerNode)&&(e.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();const s=Ud(t.triggerNode,e.shiftKey?"prev":"next");s?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),zn(()=>{s.focus(),zn(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===nd){this.handleTabKeyDown(e);return}const t=e.target,s=e.currentTarget;if(!Mn(t)||!Mn(s))return;const r=t.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,a=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code==="Space")return;const l=this.#i();r&&!a&&o&&this.#n(e.key,l),e.target?.id===this.parentMenu.contentId.current&&Ed.includes(e.key)&&(e.preventDefault(),Ga.includes(e.key)&&l.reverse(),Rd(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){fi(e.currentTarget)&&fi(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=""))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&zn(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(e){if(e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(e){if(!ja(e.target))return;const t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}e.target.closest(`#${t}`)&&e.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#o=x(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return i(this.#o)}set snippetProps(e){m(this.#o,e)}#l=x(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Ti(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return i(this.#l)}set props(e){m(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}}class uf{opts;content;attachment;#e=$(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=$t(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&ra(e))if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;const s=e.currentTarget;if(!Mn(s))return;s.focus()}}onpointerleave(e){e.defaultPrevented||ra(e)&&this.content.onItemLeave(e)}onfocus(e){zn(()=>{e.defaultPrevented||this.opts.disabled.current||m(this.#e,!0)})}onblur(e){zn(()=>{e.defaultPrevented||m(this.#e,!1)})}#t=x(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":Ci(this.opts.disabled.current),"data-disabled":jn(this.opts.disabled.current),"data-highlighted":i(this.#e)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}class Ki{static create(e){const t=new uf(e,dl.get());return new Ki(e,t)}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;const e=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){const t=this.item.content.search!=="";if(!(this.item.opts.disabled.current||t&&e.key===yr)&&Cd.includes(e.key)){if(!Mn(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!Mn(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#n=x(()=>Je(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return i(this.#n)}set props(e){m(this.#n,e)}}class ji{static create(e){return new ji(e,ul.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(this.opts.ref)}#e=x(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return i(this.#e)}set props(e){m(this.#e,e)}}class Ui{static create(e){return new Ui(e,Bi.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=$t(this.opts.ref,s=>this.parentMenu.triggerNode=s)}onclick=e=>{this.opts.disabled.current||e.detail!==0||(this.parentMenu.toggleOpen(),e.preventDefault())};onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType==="touch")return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType==="touch"&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===yr||e.key===Kr){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===Lr&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=x(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=x(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":Ci(this.parentMenu.opts.open.current),"aria-controls":i(this.#e),"data-disabled":jn(this.opts.disabled.current),"data-state":Ti(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}globalThis.bitsDismissableLayers??=new Map;class qi{static create(e){return new qi(e)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#s=!1;#i=void 0;#a;#o=Ve;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#a=e.onFocusOutside,mt(()=>{this.#i=Ya(this.opts.ref.current)});let t=Ve;const s=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};Tt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return La(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#u())}),s}),br(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#o(),t()})}#l=e=>{e.defaultPrevented||this.opts.ref.current&&zn(()=>{!this.opts.ref.current||this.#v(e.target)||e.target&&!this.#s&&this.#a.current?.(e)})};#u(){return nr(_t(this.#i,"pointerdown",nr(this.#h,this.#g),{capture:!0}),_t(this.#i,"pointerdown",nr(this.#p,this.#d)),_t(this.#i,"focusin",this.#l))}#c=e=>{let t=e;t.defaultPrevented&&(t=oa(e)),this.#e.current(e)};#d=na(e=>{if(!this.opts.ref.current){this.#o();return}const t=this.opts.isValidEvent.current(e,this.opts.ref.current)||hf(e,this.opts.ref.current);if(!this.#r||this.#m()||!t){this.#o();return}let s=e;if(s.defaultPrevented&&(s=oa(s)),this.#t.current!=="close"&&this.#t.current!=="defer-otherwise-close"){this.#o();return}e.pointerType==="touch"?(this.#o(),this.#o=_t(this.#i,"click",this.#c,{once:!0})):this.#e.current(s)},10);#h=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#g=()=>{this.opts.ref.current&&(this.#r=ff(this.opts.ref.current))};#v=e=>this.opts.ref.current?Za(this.opts.ref.current,e):!1;#f=na(()=>{for(const e in this.#n)this.#n[e]=!1;this.#r=!1},20);#m(){return Object.values(this.#n).some(Boolean)}#b=()=>{this.#s=!0};#y=()=>{this.#s=!1};props={onfocuscapture:this.#b,onblurcapture:this.#y}}function df(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([e,{current:t}])=>t==="close"||t==="ignore")}function ff(n){const e=[...globalThis.bitsDismissableLayers],t=df(e);if(t)return t[0].opts.ref.current===n;const[s]=e[0];return s.opts.ref.current===n}function hf(n,e){const t=n.target;if(!ja(t))return!1;const s=!!t.closest(`[${of}]`);if("button"in n&&n.button>0&&!s)return!1;if("button"in n&&n.button===0&&s)return!0;const r=!!e.closest(`[${af}]`);return s&&r?!1:Ya(t).documentElement.contains(t)&&!Za(e,t)&&Ad(n,e)}function oa(n){const e=n.currentTarget,t=n.target;let s;n instanceof PointerEvent?s=new PointerEvent(n.type,n):s=new PointerEvent("pointerdown",n);let r=!1;return new Proxy(s,{get:(o,c)=>c==="currentTarget"?e:c==="target"?t:c==="preventDefault"?()=>{r=!0,typeof o.preventDefault=="function"&&o.preventDefault()}:c==="defaultPrevented"?r:c in o?o[c]:n[c]})}function Zi(n,e){N(e,!0);let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"onInteractOutside",3,Ve),r=w(e,"onFocusOutside",3,Ve),a=w(e,"isValidEvent",3,()=>!1);const o=qi.create({id:M(()=>e.id),interactOutsideBehavior:M(()=>t()),onInteractOutside:M(()=>s()),enabled:M(()=>e.enabled),onFocusOutside:M(()=>r()),isValidEvent:M(()=>a()),ref:e.ref});var c=I(),l=S(c);se(l,()=>e.children??Te,()=>({props:o.props})),g(n,c),L()}globalThis.bitsEscapeLayers??=new Map;class Yi{static create(e){return new Yi(e)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Ai(this.opts.ref);let t=Ve;Tt(()=>e.enabled.current,s=>(s&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>_t(this.domContext.getDocument(),"keydown",this.#t,{passive:!1});#t=e=>{if(e.key!==Ju||!pf(this))return;const t=new KeyboardEvent(e.type,e);e.preventDefault();const s=this.opts.escapeKeydownBehavior.current;s!=="close"&&s!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(t)}}function pf(n){const e=[...globalThis.bitsEscapeLayers],t=e.findLast(([r,{current:a}])=>a==="close"||a==="ignore");if(t)return t[0]===n;const[s]=e[0];return s===n}function Gi(n,e){N(e,!0);let t=w(e,"escapeKeydownBehavior",3,"close"),s=w(e,"onEscapeKeydown",3,Ve);Yi.create({escapeKeydownBehavior:M(()=>t()),onEscapeKeydown:M(()=>s()),enabled:M(()=>e.enabled),ref:e.ref});var r=I(),a=S(r);se(a,()=>e.children??Te),g(n,r),L()}class Xi{static instance;#e=Sn([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new Xi),this.instance}register(e){const t=this.getActive();t&&t!==e&&t.pause();const s=document.activeElement;s&&s!==document.body&&this.#n.set(e,s),this.#e.current=this.#e.current.filter(r=>r!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(s=>s!==e);const t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}}class Qi{#e=!1;#t=null;#n=Xi.getInstance();#r=[];#s;constructor(e){this.#s=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#i(){for(const e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#l(),this.#a()}unmount(){this.#t&&(this.#i(),this.#o(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#t=null)}#a(){if(!this.#t)return;const e=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#s.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;const t=this.#c();t?(t.focus(),this.#n.setFocusMemory(this,t)):this.#t.focus()})}#o(){const e=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#s.onCloseAutoFocus.current?.(e),!e.defaultPrevented){const t=this.#n.getPreFocusMemory(this);if(t&&document.contains(t))try{t.focus()}catch{document.body.focus()}}}#l(){if(!this.#t||!this.#s.trap.current)return;const e=this.#t,t=e.ownerDocument,s=o=>{if(this.#e||!this.#n.isActiveScope(this))return;const c=o.target;if(!c)return;if(e.contains(c))this.#n.setFocusMemory(this,c);else{const d=this.#n.getFocusMemory(this);if(d&&e.contains(d)&&ol(d))o.preventDefault(),d.focus();else{const h=this.#c(),f=this.#d()[0];(h||f||e).focus()}}},r=o=>{if(!this.#s.loop||this.#e||o.key!=="Tab"||!this.#n.isActiveScope(this))return;const c=this.#u();if(c.length===0)return;const l=c[0],d=c[c.length-1];!o.shiftKey&&t.activeElement===d?(o.preventDefault(),l.focus()):o.shiftKey&&t.activeElement===l&&(o.preventDefault(),d.focus())};this.#r.push(_t(t,"focusin",s,{capture:!0}),_t(e,"keydown",r));const a=new MutationObserver(()=>{const o=this.#n.getFocusMemory(this);if(o&&!e.contains(o)){const c=this.#c(),l=this.#d()[0],d=c||l;d?(d.focus(),this.#n.setFocusMemory(this,d)):e.focus()}});a.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>a.disconnect())}#u(){return this.#t?sl(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#c(){return this.#u()[0]||null}#d(){return this.#t?il(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(e){let t=null;return Tt([()=>e.ref.current,()=>e.enabled.current],([s,r])=>{s&&r?(t||(t=new Qi(e)),t.mount(s)):t&&(t.unmount(),t=null)}),br(()=>{t?.unmount()}),{get props(){return{tabindex:-1}}}}}function Ji(n,e){N(e,!0);let t=w(e,"enabled",3,!1),s=w(e,"trapFocus",3,!1),r=w(e,"loop",3,!1),a=w(e,"onCloseAutoFocus",3,Ve),o=w(e,"onOpenAutoFocus",3,Ve);const c=Qi.use({enabled:M(()=>t()),trap:M(()=>s()),loop:r(),onCloseAutoFocus:M(()=>a()),onOpenAutoFocus:M(()=>o()),ref:e.ref});var l=I(),d=S(l);se(d,()=>e.focusScope??Te,()=>({props:c.props})),g(n,l),L()}globalThis.bitsTextSelectionLayers??=new Map;class eo{static create(e){return new eo(e)}opts;domContext;#e=Ve;constructor(e){this.opts=e,this.domContext=new Ai(e.ref);let t=Ve;Tt(()=>this.opts.enabled.current,s=>(s&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#t()),()=>{t(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#t(){return nr(_t(this.domContext.getDocument(),"pointerdown",this.#n),_t(this.domContext.getDocument(),"pointerup",Ia(this.#r,this.opts.onPointerUp.current)))}#n=e=>{const t=this.opts.ref.current,s=e.target;!Mn(t)||!Mn(s)||!this.opts.enabled.current||!vf(this)||!Yu(t,s)||(this.opts.onPointerDown.current(e),!e.defaultPrevented&&(this.#e=gf(t,this.domContext.getDocument().body)))};#r=()=>{this.#e(),this.#e=Ve}}const aa=n=>n.style.userSelect||n.style.webkitUserSelect;function gf(n,e){const t=aa(e),s=aa(n);return Jr(e,"none"),Jr(n,"text"),()=>{Jr(e,t),Jr(n,s)}}function Jr(n,e){n.style.userSelect=e,n.style.webkitUserSelect=e}function vf(n){const e=[...globalThis.bitsTextSelectionLayers];if(!e.length)return!1;const t=e.at(-1);return t?t[0]===n:!1}function to(n,e){N(e,!0);let t=w(e,"preventOverflowTextSelection",3,!0),s=w(e,"onPointerDown",3,Ve),r=w(e,"onPointerUp",3,Ve);eo.create({id:M(()=>e.id),onPointerDown:M(()=>s()),onPointerUp:M(()=>r()),enabled:M(()=>e.enabled&&t()),ref:e.ref});var a=I(),o=S(a);se(o,()=>e.children??Te),g(n,a),L()}globalThis.bitsIdCounter??={current:0};function no(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}class mf{#e;#t=0;#n=$();#r;constructor(e){this.#e=e}#s(){this.#t-=1,this.#r&&this.#t<=0&&(this.#r(),m(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,i(this.#n)===void 0&&(this.#r=Ea(()=>{m(this.#n,this.#e(...e),!0)})),mt(()=>()=>{this.#s()}),i(this.#n)}}const fs=new ci;let es=$(null),ri=null,Or=null,Rr=!1;const la=M(()=>{for(const n of fs.values())if(n)return!0;return!1});let si=null;const bf=new mf(()=>{function n(){document.body.setAttribute("style",i(es)??""),document.body.style.removeProperty("--scrollbar-width"),ta&&ri?.(),m(es,null)}function e(){Or!==null&&(window.clearTimeout(Or),Or=null)}function t(r,a){e(),Rr=!0,si=Date.now();const o=si,c=()=>{Or=null,si===o&&(fl(fs)?Rr=!1:(Rr=!1,a()))},l=r===null?24:r;Or=window.setTimeout(c,l)}function s(){i(es)===null&&fs.size===0&&!Rr&&m(es,document.body.getAttribute("style"),!0)}return Tt(()=>la.current,()=>{if(!la.current)return;s(),Rr=!1;const r=getComputedStyle(document.documentElement),a=getComputedStyle(document.body),o=r.scrollbarGutter?.includes("stable")||a.scrollbarGutter?.includes("stable"),c=window.innerWidth-document.documentElement.clientWidth,d={padding:Number.parseInt(a.paddingRight??"0",10)+c,margin:Number.parseInt(a.marginRight??"0",10)};c>0&&!o&&(document.body.style.paddingRight=`${d.padding}px`,document.body.style.marginRight=`${d.margin}px`,document.body.style.setProperty("--scrollbar-width",`${c}px`)),document.body.style.overflow="hidden",ta&&(ri=_t(document,"touchmove",h=>{h.target===document.documentElement&&(h.touches.length>1||h.preventDefault())},{passive:!1})),zn(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),br(()=>()=>{ri?.()}),{get lockMap(){return fs},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:t,cancelPendingCleanup:e,ensureInitialStyleCaptured:s}});class yf{#e=no();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=bf.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=M(()=>this.#r.lockMap.get(this.#e)??!1,s=>this.#r.lockMap.set(this.#e,s)),br(()=>{if(this.#r.lockMap.delete(this.#e),fl(this.#r.lockMap))return;const s=this.#n();this.#r.scheduleCleanupIfNoNewLocks(s,()=>{this.#r.resetBodyStyle()})}))}}function fl(n){for(const[e,t]of n)if(t)return!0;return!1}function vr(n,e){N(e,!0);let t=w(e,"preventScroll",3,!0),s=w(e,"restoreScrollDelay",3,null);t()&&new yf(t(),()=>s()),L()}var wf=E("<!> <!>",1),xf=E("<!> <div><!></div>",1);function _f(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"forceMount",3,!1),o=w(e,"interactOutsideBehavior",3,"ignore"),c=w(e,"onCloseAutoFocus",3,Ve),l=w(e,"onEscapeKeydown",3,Ve),d=w(e,"onOpenAutoFocus",3,Ve),h=w(e,"onInteractOutside",3,Ve),f=w(e,"preventScroll",3,!0),u=w(e,"trapFocus",3,!0),p=w(e,"restoreScrollDelay",3,null),v=$e(e,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","interactOutsideBehavior","onCloseAutoFocus","onEscapeKeydown","onOpenAutoFocus","onInteractOutside","preventScroll","trapFocus","restoreScrollDelay"]);const y=Ls.create({id:M(()=>s()),ref:M(()=>r(),A=>r(A))}),C=x(()=>Je(v,y.props));var O=I(),T=S(O);{var F=A=>{Ji(A,{get ref(){return y.opts.ref},loop:!0,get trapFocus(){return u()},get enabled(){return y.root.opts.open.current},get onCloseAutoFocus(){return c()},onOpenAutoFocus:V=>{d()(V),!V.defaultPrevented&&(V.preventDefault(),La(0,()=>y.opts.ref.current?.focus()))},focusScope:(V,Q)=>{let he=()=>Q?.().props;Gi(V,ot(()=>i(C),{get enabled(){return y.root.opts.open.current},get ref(){return y.opts.ref},onEscapeKeydown:ee=>{l()(ee),!ee.defaultPrevented&&y.root.handleClose()},children:(ee,pe)=>{Zi(ee,ot(()=>i(C),{get ref(){return y.opts.ref},get enabled(){return y.root.opts.open.current},get interactOutsideBehavior(){return o()},onInteractOutside:te=>{h()(te),!te.defaultPrevented&&y.root.handleClose()},children:(te,ge)=>{to(te,ot(()=>i(C),{get ref(){return y.opts.ref},get enabled(){return y.root.opts.open.current},children:(U,G)=>{var j=I(),Y=S(j);{var ye=Oe=>{var at=wf(),ft=S(at);{var kt=ve=>{vr(ve,{get preventScroll(){return f()},get restoreScrollDelay(){return p()}})};R(ft,ve=>{y.root.opts.open.current&&ve(kt)})}var X=D(ft,2);{let ve=x(()=>({props:Je(i(C),he()),...y.snippetProps}));se(X,()=>e.child,()=>i(ve))}g(Oe,at)},Se=Oe=>{var at=xf(),ft=S(at);vr(ft,{get preventScroll(){return f()}});var kt=D(ft,2);_e(kt,ve=>({...ve}),[()=>Je(i(C),he())]);var X=P(kt);se(X,()=>e.children??Te),k(kt),g(Oe,at)};R(Y,Oe=>{e.child?Oe(ye):Oe(Se,!1)})}g(U,j)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};R(T,A=>{(y.shouldRender||a())&&A(F)})}g(n,O),L()}var kf=E("<div><!></div>");function hl(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"forceMount",3,!1),a=w(e,"ref",15,null),o=$e(e,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const c=Fi.create({id:M(()=>s()),ref:M(()=>a(),u=>a(u))}),l=x(()=>Je(o,c.props));var d=I(),h=S(d);{var f=u=>{var p=I(),v=S(p);{var y=O=>{var T=I(),F=S(T);{let A=x(()=>({props:Je(i(l)),...c.snippetProps}));se(F,()=>e.child,()=>i(A))}g(O,T)},C=O=>{var T=kf();_e(T,A=>({...A}),[()=>Je(i(l))]);var F=P(T);se(F,()=>e.children??Te,()=>c.snippetProps),k(T),g(O,T)};R(v,O=>{e.child?O(y):O(C,!1)})}g(u,p)};R(h,u=>{(c.shouldRender||r())&&u(f)})}g(n,d),L()}var Sf=E("<div><!></div>");function pl(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=$e(e,["$$slots","$$events","$$legacy","id","children","child","ref"]);const o=Di.create({id:M(()=>s()),ref:M(()=>r(),u=>r(u))}),c=x(()=>Je(a,o.props));var l=I(),d=S(l);{var h=u=>{var p=I(),v=S(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=Sf();_e(p,()=>({...i(c)}));var v=P(p);se(v,()=>e.children??Te),k(p),g(u,p)};R(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),L()}const Pf=["top","right","bottom","left"],Un=Math.min,cn=Math.max,ks=Math.round,ts=Math.floor,An=n=>({x:n,y:n}),Af={left:"right",right:"left",bottom:"top",top:"bottom"},Cf={start:"end",end:"start"};function gi(n,e,t){return cn(n,Un(e,t))}function Dn(n,e){return typeof n=="function"?n(e):n}function Fn(n){return n.split("-")[0]}function wr(n){return n.split("-")[1]}function ro(n){return n==="x"?"y":"x"}function so(n){return n==="y"?"height":"width"}const Tf=new Set(["top","bottom"]);function Pn(n){return Tf.has(Fn(n))?"y":"x"}function io(n){return ro(Pn(n))}function Ef(n,e,t){t===void 0&&(t=!1);const s=wr(n),r=io(n),a=so(r);let o=r==="x"?s===(t?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=Ss(o)),[o,Ss(o)]}function Of(n){const e=Ss(n);return[vi(n),e,vi(e)]}function vi(n){return n.replace(/start|end/g,e=>Cf[e])}const ca=["left","right"],ua=["right","left"],Rf=["top","bottom"],zf=["bottom","top"];function Mf(n,e,t){switch(n){case"top":case"bottom":return t?e?ua:ca:e?ca:ua;case"left":case"right":return e?Rf:zf;default:return[]}}function If(n,e,t,s){const r=wr(n);let a=Mf(Fn(n),t==="start",s);return r&&(a=a.map(o=>o+"-"+r),e&&(a=a.concat(a.map(vi)))),a}function Ss(n){return n.replace(/left|right|bottom|top/g,e=>Af[e])}function Df(n){return{top:0,right:0,bottom:0,left:0,...n}}function gl(n){return typeof n!="number"?Df(n):{top:n,right:n,bottom:n,left:n}}function Ps(n){const{x:e,y:t,width:s,height:r}=n;return{width:s,height:r,top:t,left:e,right:e+s,bottom:t+r,x:e,y:t}}function da(n,e,t){let{reference:s,floating:r}=n;const a=Pn(e),o=io(e),c=so(o),l=Fn(e),d=a==="y",h=s.x+s.width/2-r.width/2,f=s.y+s.height/2-r.height/2,u=s[c]/2-r[c]/2;let p;switch(l){case"top":p={x:h,y:s.y-r.height};break;case"bottom":p={x:h,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-r.width,y:f};break;default:p={x:s.x,y:s.y}}switch(wr(e)){case"start":p[o]-=u*(t&&d?-1:1);break;case"end":p[o]+=u*(t&&d?-1:1);break}return p}async function Ff(n,e){var t;e===void 0&&(e={});const{x:s,y:r,platform:a,rects:o,elements:c,strategy:l}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=Dn(e,n),v=gl(p),C=c[u?f==="floating"?"reference":"floating":f],O=Ps(await a.getClippingRect({element:(t=await(a.isElement==null?void 0:a.isElement(C)))==null||t?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:l})),T=f==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,F=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),A=await(a.isElement==null?void 0:a.isElement(F))?await(a.getScale==null?void 0:a.getScale(F))||{x:1,y:1}:{x:1,y:1},B=Ps(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:F,strategy:l}):T);return{top:(O.top-B.top+v.top)/A.y,bottom:(B.bottom-O.bottom+v.bottom)/A.y,left:(O.left-B.left+v.left)/A.x,right:(B.right-O.right+v.right)/A.x}}const $f=async(n,e,t)=>{const{placement:s="bottom",strategy:r="absolute",middleware:a=[],platform:o}=t,c=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:n,floating:e,strategy:r}),{x:h,y:f}=da(d,s,l),u=s,p={},v=0;for(let C=0;C<c.length;C++){var y;const{name:O,fn:T}=c[C],{x:F,y:A,data:B,reset:V}=await T({x:h,y:f,initialPlacement:s,placement:u,strategy:r,middlewareData:p,rects:d,platform:{...o,detectOverflow:(y=o.detectOverflow)!=null?y:Ff},elements:{reference:n,floating:e}});h=F??h,f=A??f,p={...p,[O]:{...p[O],...B}},V&&v<=50&&(v++,typeof V=="object"&&(V.placement&&(u=V.placement),V.rects&&(d=V.rects===!0?await o.getElementRects({reference:n,floating:e,strategy:r}):V.rects),{x:h,y:f}=da(d,u,l)),C=-1)}return{x:h,y:f,placement:u,strategy:r,middlewareData:p}},Nf=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:s,placement:r,rects:a,platform:o,elements:c,middlewareData:l}=e,{element:d,padding:h=0}=Dn(n,e)||{};if(d==null)return{};const f=gl(h),u={x:t,y:s},p=io(r),v=so(p),y=await o.getDimensions(d),C=p==="y",O=C?"top":"left",T=C?"bottom":"right",F=C?"clientHeight":"clientWidth",A=a.reference[v]+a.reference[p]-u[p]-a.floating[v],B=u[p]-a.reference[p],V=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let Q=V?V[F]:0;(!Q||!await(o.isElement==null?void 0:o.isElement(V)))&&(Q=c.floating[F]||a.floating[v]);const he=A/2-B/2,ee=Q/2-y[v]/2-1,pe=Un(f[O],ee),te=Un(f[T],ee),ge=pe,U=Q-y[v]-te,G=Q/2-y[v]/2+he,j=gi(ge,G,U),Y=!l.arrow&&wr(r)!=null&&G!==j&&a.reference[v]/2-(G<ge?pe:te)-y[v]/2<0,ye=Y?G<ge?G-ge:G-U:0;return{[p]:u[p]+ye,data:{[p]:j,centerOffset:G-j-ye,...Y&&{alignmentOffset:ye}},reset:Y}}}),Lf=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,s;const{placement:r,middlewareData:a,rects:o,initialPlacement:c,platform:l,elements:d}=e,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...C}=Dn(n,e);if((t=a.arrow)!=null&&t.alignmentOffset)return{};const O=Fn(r),T=Pn(c),F=Fn(c)===c,A=await(l.isRTL==null?void 0:l.isRTL(d.floating)),B=u||(F||!y?[Ss(c)]:Of(c)),V=v!=="none";!u&&V&&B.push(...If(c,y,v,A));const Q=[c,...B],he=await l.detectOverflow(e,C),ee=[];let pe=((s=a.flip)==null?void 0:s.overflows)||[];if(h&&ee.push(he[O]),f){const G=Ef(r,o,A);ee.push(he[G[0]],he[G[1]])}if(pe=[...pe,{placement:r,overflows:ee}],!ee.every(G=>G<=0)){var te,ge;const G=(((te=a.flip)==null?void 0:te.index)||0)+1,j=Q[G];if(j&&(!(f==="alignment"?T!==Pn(j):!1)||pe.every(Se=>Pn(Se.placement)===T?Se.overflows[0]>0:!0)))return{data:{index:G,overflows:pe},reset:{placement:j}};let Y=(ge=pe.filter(ye=>ye.overflows[0]<=0).sort((ye,Se)=>ye.overflows[1]-Se.overflows[1])[0])==null?void 0:ge.placement;if(!Y)switch(p){case"bestFit":{var U;const ye=(U=pe.filter(Se=>{if(V){const Oe=Pn(Se.placement);return Oe===T||Oe==="y"}return!0}).map(Se=>[Se.placement,Se.overflows.filter(Oe=>Oe>0).reduce((Oe,at)=>Oe+at,0)]).sort((Se,Oe)=>Se[1]-Oe[1])[0])==null?void 0:U[0];ye&&(Y=ye);break}case"initialPlacement":Y=c;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function fa(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function ha(n){return Pf.some(e=>n[e]>=0)}const Bf=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:s}=e,{strategy:r="referenceHidden",...a}=Dn(n,e);switch(r){case"referenceHidden":{const o=await s.detectOverflow(e,{...a,elementContext:"reference"}),c=fa(o,t.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ha(c)}}}case"escaped":{const o=await s.detectOverflow(e,{...a,altBoundary:!0}),c=fa(o,t.floating);return{data:{escapedOffsets:c,escaped:ha(c)}}}default:return{}}}}},vl=new Set(["left","top"]);async function Hf(n,e){const{placement:t,platform:s,elements:r}=n,a=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Fn(t),c=wr(t),l=Pn(t)==="y",d=vl.has(o)?-1:1,h=a&&l?-1:1,f=Dn(e,n);let{mainAxis:u,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof v=="number"&&(p=c==="end"?v*-1:v),l?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Vf=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,s;const{x:r,y:a,placement:o,middlewareData:c}=e,l=await Hf(e,n);return o===((t=c.offset)==null?void 0:t.placement)&&(s=c.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:a+l.y,data:{...l,placement:o}}}}},Wf=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:s,placement:r,platform:a}=e,{mainAxis:o=!0,crossAxis:c=!1,limiter:l={fn:O=>{let{x:T,y:F}=O;return{x:T,y:F}}},...d}=Dn(n,e),h={x:t,y:s},f=await a.detectOverflow(e,d),u=Pn(Fn(r)),p=ro(u);let v=h[p],y=h[u];if(o){const O=p==="y"?"top":"left",T=p==="y"?"bottom":"right",F=v+f[O],A=v-f[T];v=gi(F,v,A)}if(c){const O=u==="y"?"top":"left",T=u==="y"?"bottom":"right",F=y+f[O],A=y-f[T];y=gi(F,y,A)}const C=l.fn({...e,[p]:v,[u]:y});return{...C,data:{x:C.x-t,y:C.y-s,enabled:{[p]:o,[u]:c}}}}}},Kf=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:s,placement:r,rects:a,middlewareData:o}=e,{offset:c=0,mainAxis:l=!0,crossAxis:d=!0}=Dn(n,e),h={x:t,y:s},f=Pn(r),u=ro(f);let p=h[u],v=h[f];const y=Dn(c,e),C=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const F=u==="y"?"height":"width",A=a.reference[u]-a.floating[F]+C.mainAxis,B=a.reference[u]+a.reference[F]-C.mainAxis;p<A?p=A:p>B&&(p=B)}if(d){var O,T;const F=u==="y"?"width":"height",A=vl.has(Fn(r)),B=a.reference[f]-a.floating[F]+(A&&((O=o.offset)==null?void 0:O[f])||0)+(A?0:C.crossAxis),V=a.reference[f]+a.reference[F]+(A?0:((T=o.offset)==null?void 0:T[f])||0)-(A?C.crossAxis:0);v<B?v=B:v>V&&(v=V)}return{[u]:p,[f]:v}}}},jf=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,s;const{placement:r,rects:a,platform:o,elements:c}=e,{apply:l=()=>{},...d}=Dn(n,e),h=await o.detectOverflow(e,d),f=Fn(r),u=wr(r),p=Pn(r)==="y",{width:v,height:y}=a.floating;let C,O;f==="top"||f==="bottom"?(C=f,O=u===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(O=f,C=u==="end"?"top":"bottom");const T=y-h.top-h.bottom,F=v-h.left-h.right,A=Un(y-h[C],T),B=Un(v-h[O],F),V=!e.middlewareData.shift;let Q=A,he=B;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(he=F),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(Q=T),V&&!u){const pe=cn(h.left,0),te=cn(h.right,0),ge=cn(h.top,0),U=cn(h.bottom,0);p?he=v-2*(pe!==0||te!==0?pe+te:cn(h.left,h.right)):Q=y-2*(ge!==0||U!==0?ge+U:cn(h.top,h.bottom))}await l({...e,availableWidth:he,availableHeight:Q});const ee=await o.getDimensions(c.floating);return v!==ee.width||y!==ee.height?{reset:{rects:!0}}:{}}}};function Bs(){return typeof window<"u"}function xr(n){return ml(n)?(n.nodeName||"").toLowerCase():"#document"}function un(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Tn(n){var e;return(e=(ml(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function ml(n){return Bs()?n instanceof Node||n instanceof un(n).Node:!1}function bn(n){return Bs()?n instanceof Element||n instanceof un(n).Element:!1}function Cn(n){return Bs()?n instanceof HTMLElement||n instanceof un(n).HTMLElement:!1}function pa(n){return!Bs()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof un(n).ShadowRoot}const Uf=new Set(["inline","contents"]);function jr(n){const{overflow:e,overflowX:t,overflowY:s,display:r}=yn(n);return/auto|scroll|overlay|hidden|clip/.test(e+s+t)&&!Uf.has(r)}const qf=new Set(["table","td","th"]);function Zf(n){return qf.has(xr(n))}const Yf=[":popover-open",":modal"];function Hs(n){return Yf.some(e=>{try{return n.matches(e)}catch{return!1}})}const Gf=["transform","translate","scale","rotate","perspective"],Xf=["transform","translate","scale","rotate","perspective","filter"],Qf=["paint","layout","strict","content"];function oo(n){const e=ao(),t=bn(n)?yn(n):n;return Gf.some(s=>t[s]?t[s]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||Xf.some(s=>(t.willChange||"").includes(s))||Qf.some(s=>(t.contain||"").includes(s))}function Jf(n){let e=qn(n);for(;Cn(e)&&!mr(e);){if(oo(e))return e;if(Hs(e))return null;e=qn(e)}return null}function ao(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const eh=new Set(["html","body","#document"]);function mr(n){return eh.has(xr(n))}function yn(n){return un(n).getComputedStyle(n)}function Vs(n){return bn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function qn(n){if(xr(n)==="html")return n;const e=n.assignedSlot||n.parentNode||pa(n)&&n.host||Tn(n);return pa(e)?e.host:e}function bl(n){const e=qn(n);return mr(e)?n.ownerDocument?n.ownerDocument.body:n.body:Cn(e)&&jr(e)?e:bl(e)}function Br(n,e,t){var s;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=bl(n),a=r===((s=n.ownerDocument)==null?void 0:s.body),o=un(r);if(a){const c=mi(o);return e.concat(o,o.visualViewport||[],jr(r)?r:[],c&&t?Br(c):[])}return e.concat(r,Br(r,[],t))}function mi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function yl(n){const e=yn(n);let t=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const r=Cn(n),a=r?n.offsetWidth:t,o=r?n.offsetHeight:s,c=ks(t)!==a||ks(s)!==o;return c&&(t=a,s=o),{width:t,height:s,$:c}}function lo(n){return bn(n)?n:n.contextElement}function hr(n){const e=lo(n);if(!Cn(e))return An(1);const t=e.getBoundingClientRect(),{width:s,height:r,$:a}=yl(e);let o=(a?ks(t.width):t.width)/s,c=(a?ks(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const th=An(0);function wl(n){const e=un(n);return!ao()||!e.visualViewport?th:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nh(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==un(n)?!1:e}function sr(n,e,t,s){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),a=lo(n);let o=An(1);e&&(s?bn(s)&&(o=hr(s)):o=hr(n));const c=nh(a,t,s)?wl(a):An(0);let l=(r.left+c.x)/o.x,d=(r.top+c.y)/o.y,h=r.width/o.x,f=r.height/o.y;if(a){const u=un(a),p=s&&bn(s)?un(s):s;let v=u,y=mi(v);for(;y&&s&&p!==v;){const C=hr(y),O=y.getBoundingClientRect(),T=yn(y),F=O.left+(y.clientLeft+parseFloat(T.paddingLeft))*C.x,A=O.top+(y.clientTop+parseFloat(T.paddingTop))*C.y;l*=C.x,d*=C.y,h*=C.x,f*=C.y,l+=F,d+=A,v=un(y),y=mi(v)}}return Ps({width:h,height:f,x:l,y:d})}function Ws(n,e){const t=Vs(n).scrollLeft;return e?e.left+t:sr(Tn(n)).left+t}function xl(n,e){const t=n.getBoundingClientRect(),s=t.left+e.scrollLeft-Ws(n,t),r=t.top+e.scrollTop;return{x:s,y:r}}function rh(n){let{elements:e,rect:t,offsetParent:s,strategy:r}=n;const a=r==="fixed",o=Tn(s),c=e?Hs(e.floating):!1;if(s===o||c&&a)return t;let l={scrollLeft:0,scrollTop:0},d=An(1);const h=An(0),f=Cn(s);if((f||!f&&!a)&&((xr(s)!=="body"||jr(o))&&(l=Vs(s)),Cn(s))){const p=sr(s);d=hr(s),h.x=p.x+s.clientLeft,h.y=p.y+s.clientTop}const u=o&&!f&&!a?xl(o,l):An(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-l.scrollLeft*d.x+h.x+u.x,y:t.y*d.y-l.scrollTop*d.y+h.y+u.y}}function sh(n){return Array.from(n.getClientRects())}function ih(n){const e=Tn(n),t=Vs(n),s=n.ownerDocument.body,r=cn(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),a=cn(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let o=-t.scrollLeft+Ws(n);const c=-t.scrollTop;return yn(s).direction==="rtl"&&(o+=cn(e.clientWidth,s.clientWidth)-r),{width:r,height:a,x:o,y:c}}const ga=25;function oh(n,e){const t=un(n),s=Tn(n),r=t.visualViewport;let a=s.clientWidth,o=s.clientHeight,c=0,l=0;if(r){a=r.width,o=r.height;const h=ao();(!h||h&&e==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const d=Ws(s);if(d<=0){const h=s.ownerDocument,f=h.body,u=getComputedStyle(f),p=h.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,v=Math.abs(s.clientWidth-f.clientWidth-p);v<=ga&&(a-=v)}else d<=ga&&(a+=d);return{width:a,height:o,x:c,y:l}}const ah=new Set(["absolute","fixed"]);function lh(n,e){const t=sr(n,!0,e==="fixed"),s=t.top+n.clientTop,r=t.left+n.clientLeft,a=Cn(n)?hr(n):An(1),o=n.clientWidth*a.x,c=n.clientHeight*a.y,l=r*a.x,d=s*a.y;return{width:o,height:c,x:l,y:d}}function va(n,e,t){let s;if(e==="viewport")s=oh(n,t);else if(e==="document")s=ih(Tn(n));else if(bn(e))s=lh(e,t);else{const r=wl(n);s={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Ps(s)}function _l(n,e){const t=qn(n);return t===e||!bn(t)||mr(t)?!1:yn(t).position==="fixed"||_l(t,e)}function ch(n,e){const t=e.get(n);if(t)return t;let s=Br(n,[],!1).filter(c=>bn(c)&&xr(c)!=="body"),r=null;const a=yn(n).position==="fixed";let o=a?qn(n):n;for(;bn(o)&&!mr(o);){const c=yn(o),l=oo(o);!l&&c.position==="fixed"&&(r=null),(a?!l&&!r:!l&&c.position==="static"&&!!r&&ah.has(r.position)||jr(o)&&!l&&_l(n,o))?s=s.filter(h=>h!==o):r=c,o=qn(o)}return e.set(n,s),s}function uh(n){let{element:e,boundary:t,rootBoundary:s,strategy:r}=n;const o=[...t==="clippingAncestors"?Hs(e)?[]:ch(e,this._c):[].concat(t),s],c=o[0],l=o.reduce((d,h)=>{const f=va(e,h,r);return d.top=cn(f.top,d.top),d.right=Un(f.right,d.right),d.bottom=Un(f.bottom,d.bottom),d.left=cn(f.left,d.left),d},va(e,c,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dh(n){const{width:e,height:t}=yl(n);return{width:e,height:t}}function fh(n,e,t){const s=Cn(e),r=Tn(e),a=t==="fixed",o=sr(n,!0,a,e);let c={scrollLeft:0,scrollTop:0};const l=An(0);function d(){l.x=Ws(r)}if(s||!s&&!a)if((xr(e)!=="body"||jr(r))&&(c=Vs(e)),s){const p=sr(e,!0,a,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else r&&d();a&&!s&&r&&d();const h=r&&!s&&!a?xl(r,c):An(0),f=o.left+c.scrollLeft-l.x-h.x,u=o.top+c.scrollTop-l.y-h.y;return{x:f,y:u,width:o.width,height:o.height}}function ii(n){return yn(n).position==="static"}function ma(n,e){if(!Cn(n)||yn(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Tn(n)===t&&(t=t.ownerDocument.body),t}function kl(n,e){const t=un(n);if(Hs(n))return t;if(!Cn(n)){let r=qn(n);for(;r&&!mr(r);){if(bn(r)&&!ii(r))return r;r=qn(r)}return t}let s=ma(n,e);for(;s&&Zf(s)&&ii(s);)s=ma(s,e);return s&&mr(s)&&ii(s)&&!oo(s)?t:s||Jf(n)||t}const hh=async function(n){const e=this.getOffsetParent||kl,t=this.getDimensions,s=await t(n.floating);return{reference:fh(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function ph(n){return yn(n).direction==="rtl"}const gh={convertOffsetParentRelativeRectToViewportRelativeRect:rh,getDocumentElement:Tn,getClippingRect:uh,getOffsetParent:kl,getElementRects:hh,getClientRects:sh,getDimensions:dh,getScale:hr,isElement:bn,isRTL:ph};function Sl(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function vh(n,e){let t=null,s;const r=Tn(n);function a(){var c;clearTimeout(s),(c=t)==null||c.disconnect(),t=null}function o(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),a();const d=n.getBoundingClientRect(),{left:h,top:f,width:u,height:p}=d;if(c||e(),!u||!p)return;const v=ts(f),y=ts(r.clientWidth-(h+u)),C=ts(r.clientHeight-(f+p)),O=ts(h),F={rootMargin:-v+"px "+-y+"px "+-C+"px "+-O+"px",threshold:cn(0,Un(1,l))||1};let A=!0;function B(V){const Q=V[0].intersectionRatio;if(Q!==l){if(!A)return o();Q?o(!1,Q):s=setTimeout(()=>{o(!1,1e-7)},1e3)}Q===1&&!Sl(d,n.getBoundingClientRect())&&o(),A=!1}try{t=new IntersectionObserver(B,{...F,root:r.ownerDocument})}catch{t=new IntersectionObserver(B,F)}t.observe(n)}return o(!0),a}function mh(n,e,t,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=lo(n),h=r||a?[...d?Br(d):[],...Br(e)]:[];h.forEach(O=>{r&&O.addEventListener("scroll",t,{passive:!0}),a&&O.addEventListener("resize",t)});const f=d&&c?vh(d,t):null;let u=-1,p=null;o&&(p=new ResizeObserver(O=>{let[T]=O;T&&T.target===d&&p&&(p.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var F;(F=p)==null||F.observe(e)})),t()}),d&&!l&&p.observe(d),p.observe(e));let v,y=l?sr(n):null;l&&C();function C(){const O=sr(n);y&&!Sl(y,O)&&t(),y=O,v=requestAnimationFrame(C)}return t(),()=>{var O;h.forEach(T=>{r&&T.removeEventListener("scroll",t),a&&T.removeEventListener("resize",t)}),f?.(),(O=p)==null||O.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const bh=Vf,yh=Wf,wh=Lf,xh=jf,_h=Bf,kh=Nf,Sh=Kf,Ph=(n,e,t)=>{const s=new Map,r={platform:gh,...t},a={...r.platform,_c:s};return $f(n,e,{...r,platform:a})};function Gn(n){return typeof n=="function"?n():n}function Pl(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ba(n,e){const t=Pl(n);return Math.round(e*t)/t}function ya(n){return{[`--bits-${n}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${n}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${n}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${n}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${n}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function Ah(n){const e=n.whileElementsMounted,t=x(()=>Gn(n.open)??!0),s=x(()=>Gn(n.middleware)),r=x(()=>Gn(n.transform)??!0),a=x(()=>Gn(n.placement)??"bottom"),o=x(()=>Gn(n.strategy)??"absolute"),c=x(()=>Gn(n.sideOffset)??0),l=x(()=>Gn(n.alignOffset)??0),d=n.reference;let h=$(0),f=$(0);const u=Sn(null);let p=$(en(i(o))),v=$(en(i(a))),y=$(en({})),C=$(!1),O=!1;const T=x(()=>{const ee=u.current?ba(u.current,i(h)):i(h),pe=u.current?ba(u.current,i(f)):i(f);return i(r)?{position:i(p),left:"0",top:"0",transform:`translate(${ee}px, ${pe}px)`,...u.current&&Pl(u.current)>=1.5&&{willChange:"transform"}}:{position:i(p),left:`${ee}px`,top:`${pe}px`}});let F;function A(){d.current===null||u.current===null||Ph(d.current,u.current,{middleware:i(s),placement:i(a),strategy:i(o)}).then(ee=>{const pe=d.current;if(Ch(pe)){m(y,{...i(y),hide:{...i(y).hide,referenceHidden:!0}},!0);return}if(!i(t)&&i(h)!==0&&i(f)!==0){const ge=Math.max(Math.abs(i(c)),Math.abs(i(l)),15);if(ee.x<=ge&&ee.y<=ge)return}m(h,ee.x,!0),m(f,ee.y,!0),m(p,ee.strategy,!0),m(v,ee.placement,!0),m(y,ee.middlewareData,!0),m(C,!0)})}function B(){typeof F=="function"&&(F(),F=void 0)}function V(){if(B(),e===void 0){A();return}i(t)&&(d.current===null||u.current===null||(F=e(d.current,u.current,A)))}function Q(){i(t)||m(C,!1)}function he(){return[i(s),i(a),i(o),i(c),i(l),i(t)]}return mt(()=>{e===void 0&&i(t)&&A()}),mt(V),mt(()=>{if(e!==void 0){if(he(),!i(t)){O=!1;return}if(!i(C)){O=!1;return}if(!O){O=!0;return}A()}}),mt(Q),mt(()=>B),{floating:u,reference:d,get strategy(){return i(p)},get placement(){return i(v)},get middlewareData(){return i(y)},get isPositioned(){return i(C)},get floatingStyles(){return i(T)},get update(){return A}}}function Ch(n){return n instanceof Element?!n.isConnected||n instanceof HTMLElement&&n.hidden?!0:n.getClientRects().length===0:!1}const Th={top:"bottom",right:"left",bottom:"top",left:"right"},co=new $n("Floating.Root"),wa=new $n("Floating.Content"),uo=new $n("Floating.Root");class As{static create(e=!1){return e?uo.set(new As):co.set(new As)}anchorNode=Sn(null);customAnchorNode=Sn(null);triggerNode=Sn(null);constructor(){mt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class Cs{static create(e,t=!1){return t?wa.set(new Cs(e,uo.get())):wa.set(new Cs(e,co.get()))}opts;root;contentRef=Sn(null);wrapperRef=Sn(null);arrowRef=Sn(null);contentAttachment=$t(this.contentRef);wrapperAttachment=$t(this.wrapperRef);arrowAttachment=$t(this.arrowRef);arrowId=Sn(no());#e=x(()=>{if(typeof this.opts.style=="string")return Fr(this.opts.style);if(!this.opts.style)return{}});#t=void 0;#n=new Wu(()=>this.arrowRef.current??void 0);#r=x(()=>this.#n?.width??0);#s=x(()=>this.#n?.height??0);#i=x(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=x(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#o=x(()=>i(this.#a).length>0);get hasExplicitBoundaries(){return i(this.#o)}set hasExplicitBoundaries(e){m(this.#o,e)}#l=x(()=>({padding:this.opts.collisionPadding.current,boundary:i(this.#a).filter(ld),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return i(this.#l)}set detectOverflowOptions(e){m(this.#l,e)}#u=$(void 0);#c=$(void 0);#d=$(void 0);#h=$(void 0);#p=x(()=>[bh({mainAxis:this.opts.sideOffset.current+i(this.#s),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&yh({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?Sh():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&wh({...this.detectOverflowOptions}),xh({...this.detectOverflowOptions,apply:({rects:e,availableWidth:t,availableHeight:s})=>{const{width:r,height:a}=e.reference;m(this.#u,t,!0),m(this.#c,s,!0),m(this.#d,r,!0),m(this.#h,a,!0)}}),this.arrowRef.current&&kh({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),Eh({arrowWidth:i(this.#r),arrowHeight:i(this.#s)}),this.opts.hideWhenDetached.current&&_h({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return i(this.#p)}set middleware(e){m(this.#p,e)}floating;#g=x(()=>Oh(this.floating.placement));get placedSide(){return i(this.#g)}set placedSide(e){m(this.#g,e)}#v=x(()=>Rh(this.floating.placement));get placedAlign(){return i(this.#v)}set placedAlign(e){m(this.#v,e)}#f=x(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return i(this.#f)}set arrowX(e){m(this.#f,e)}#m=x(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return i(this.#m)}set arrowY(e){m(this.#m,e)}#b=x(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return i(this.#b)}set cannotCenterArrow(e){m(this.#b,e)}#y=$();get contentZIndex(){return i(this.#y)}set contentZIndex(e){m(this.#y,e,!0)}#w=x(()=>Th[this.placedSide]);get arrowBaseSide(){return i(this.#w)}set arrowBaseSide(e){m(this.#w,e)}#x=x(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${i(this.#u)}px`,"--bits-floating-available-height":`${i(this.#c)}px`,"--bits-floating-anchor-width":`${i(this.#d)}px`,"--bits-floating-anchor-height":`${i(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...i(this.#e)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return i(this.#x)}set wrapperProps(e){m(this.#x,e)}#_=x(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Fa({...i(this.#e)}),...this.contentAttachment}));get props(){return i(this.#_)}set props(e){m(this.#_,e)}#k=x(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return i(this.#k)}set arrowStyle(e){m(this.#k,e)}constructor(e,t){this.opts=e,this.root=t,this.#t=e.updatePositionStrategy,e.customAnchor&&(this.root.customAnchorNode.current=e.customAnchor.current),Tt(()=>e.customAnchor.current,s=>{this.root.customAnchorNode.current=s}),this.floating=Ah({strategy:()=>this.opts.strategy.current,placement:()=>i(this.#i),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...s)=>mh(...s,{animationFrame:this.#t?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),mt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),Tt(()=>this.contentRef.current,s=>{if(!s||!this.opts.enabled.current)return;const r=Pi(s),a=r.requestAnimationFrame(()=>{if(this.contentRef.current!==s||!this.opts.enabled.current)return;const o=r.getComputedStyle(s).zIndex;o!==this.contentZIndex&&(this.contentZIndex=o)});return()=>{r.cancelAnimationFrame(a)}}),mt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class Ts{static create(e,t=!1){return t?new Ts(e,uo.get()):new Ts(e,co.get())}opts;root;constructor(e,t){this.opts=e,this.root=t,e.virtualEl&&e.virtualEl.current?t.triggerNode=Ma(e.virtualEl.current):t.triggerNode=e.ref}}function Eh(n){return{name:"transformOrigin",options:n,fn(e){const{placement:t,rects:s,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,c=o?0:n.arrowWidth,l=o?0:n.arrowHeight,[d,h]=fo(t),f={start:"0%",center:"50%",end:"100%"}[h],u=(r.arrow?.x??0)+c/2,p=(r.arrow?.y??0)+l/2;let v="",y="";return d==="bottom"?(v=o?f:`${u}px`,y=`${-l}px`):d==="top"?(v=o?f:`${u}px`,y=`${s.floating.height+l}px`):d==="right"?(v=`${-l}px`,y=o?f:`${p}px`):d==="left"&&(v=`${s.floating.width+l}px`,y=o?f:`${p}px`),{data:{x:v,y}}}}}function fo(n){const[e,t="center"]=n.split("-");return[e,t]}function Oh(n){return fo(n)[0]}function Rh(n){return fo(n)[1]}function zh(n,e){N(e,!0);let t=w(e,"tooltip",3,!1);As.create(t());var s=I(),r=S(s);se(r,()=>e.children??Te),g(n,s),L()}function Mh(n,e){N(e,!0);let t=w(e,"tooltip",3,!1);Ts.create({id:M(()=>e.id),virtualEl:M(()=>e.virtualEl),ref:e.ref},t());var s=I(),r=S(s);se(r,()=>e.children??Te),g(n,s),L()}function Ih(n,e){N(e,!0);let t=w(e,"side",3,"bottom"),s=w(e,"sideOffset",3,0),r=w(e,"align",3,"center"),a=w(e,"alignOffset",3,0),o=w(e,"arrowPadding",3,0),c=w(e,"avoidCollisions",3,!0),l=w(e,"collisionBoundary",19,()=>[]),d=w(e,"collisionPadding",3,0),h=w(e,"hideWhenDetached",3,!1),f=w(e,"onPlaced",3,()=>{}),u=w(e,"sticky",3,"partial"),p=w(e,"updatePositionStrategy",3,"optimized"),v=w(e,"strategy",3,"fixed"),y=w(e,"dir",3,"ltr"),C=w(e,"style",19,()=>({})),O=w(e,"wrapperId",19,no),T=w(e,"customAnchor",3,null),F=w(e,"tooltip",3,!1);const A=Cs.create({side:M(()=>t()),sideOffset:M(()=>s()),align:M(()=>r()),alignOffset:M(()=>a()),id:M(()=>e.id),arrowPadding:M(()=>o()),avoidCollisions:M(()=>c()),collisionBoundary:M(()=>l()),collisionPadding:M(()=>d()),hideWhenDetached:M(()=>h()),onPlaced:M(()=>f()),sticky:M(()=>u()),updatePositionStrategy:M(()=>p()),strategy:M(()=>v()),dir:M(()=>y()),style:M(()=>C()),enabled:M(()=>e.enabled),wrapperId:M(()=>O()),customAnchor:M(()=>T())},F()),B=x(()=>Je(A.wrapperProps,{style:{pointerEvents:"auto"}}));var V=I(),Q=S(V);se(Q,()=>e.content??Te,()=>({props:A.props,wrapperProps:i(B)})),g(n,V),L()}function Dh(n,e){N(e,!0),Is(()=>{e.onPlaced?.()});var t=I(),s=S(t);se(s,()=>e.content??Te,()=>({props:{},wrapperProps:{}})),g(n,t),L()}function Fh(n,e){let t=w(e,"isStatic",3,!1),s=$e(e,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var r=I(),a=S(r);{var o=l=>{Dh(l,{get content(){return e.content},get onPlaced(){return e.onPlaced}})},c=l=>{Ih(l,ot({get content(){return e.content},get onPlaced(){return e.onPlaced}},()=>s))};R(a,l=>{t()?l(o):l(c,!1)})}g(n,r)}var $h=E("<!> <!>",1);function Al(n,e){N(e,!0);let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"trapFocus",3,!0),r=w(e,"isValidEvent",3,()=>!1),a=w(e,"customAnchor",3,null),o=w(e,"isStatic",3,!1),c=w(e,"tooltip",3,!1),l=w(e,"contentPointerEvents",3,"auto"),d=$e(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);Fh(n,{get isStatic(){return o()},get id(){return e.id},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get enabled(){return e.enabled},get tooltip(){return c()},content:(f,u)=>{let p=()=>u?.().props,v=()=>u?.().wrapperProps;var y=$h(),C=S(y);{var O=A=>{vr(A,{get preventScroll(){return e.preventScroll}})},T=A=>{vr(A,{get preventScroll(){return e.preventScroll}})};R(C,A=>{e.forceMount&&e.enabled?A(O):e.forceMount||A(T,1)})}var F=D(C,2);Ji(F,{get onOpenAutoFocus(){return e.onOpenAutoFocus},get onCloseAutoFocus(){return e.onCloseAutoFocus},get loop(){return e.loop},get enabled(){return e.enabled},get trapFocus(){return s()},get forceMount(){return e.forceMount},get ref(){return e.ref},focusScope:(B,V)=>{let Q=()=>V?.().props;Gi(B,{get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get enabled(){return e.enabled},get ref(){return e.ref},children:(he,ee)=>{Zi(he,{get id(){return e.id},get onInteractOutside(){return e.onInteractOutside},get onFocusOutside(){return e.onFocusOutside},get interactOutsideBehavior(){return t()},get isValidEvent(){return r()},get enabled(){return e.enabled},get ref(){return e.ref},children:(te,ge)=>{let U=()=>ge?.().props;to(te,{get id(){return e.id},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get enabled(){return e.enabled},get ref(){return e.ref},children:(G,j)=>{var Y=I(),ye=S(Y);{let Se=x(()=>({props:Je(d,p(),U(),Q(),{style:{pointerEvents:l()}}),wrapperProps:v()}));se(ye,()=>e.popper??Te,()=>i(Se))}g(G,Y)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),g(f,y)},$$slots:{content:!0}}),L()}function Nh(n,e){let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"trapFocus",3,!0),r=w(e,"isValidEvent",3,()=>!1),a=w(e,"customAnchor",3,null),o=w(e,"isStatic",3,!1),c=$e(e,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=I(),d=S(l);{var h=f=>{Al(f,ot({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return e.open},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return t()},get loop(){return e.loop},get trapFocus(){return s()},get isValidEvent(){return r()},get onFocusOutside(){return e.onFocusOutside},forceMount:!1,get ref(){return e.ref}},()=>c))};R(d,f=>{e.shouldRender&&f(h)})}g(n,l)}function Lh(n,e){let t=w(e,"interactOutsideBehavior",3,"close"),s=w(e,"trapFocus",3,!0),r=w(e,"isValidEvent",3,()=>!1),a=w(e,"customAnchor",3,null),o=w(e,"isStatic",3,!1),c=$e(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);Al(n,ot({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return a()},get isStatic(){return o()},get enabled(){return e.enabled},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return t()},get loop(){return e.loop},get trapFocus(){return s()},get isValidEvent(){return r()},get onFocusOutside(){return e.onFocusOutside}},()=>c,{forceMount:!0}))}var Bh=E("<div><!></div>");function Hh(n,e){const t=Yt();N(e,!0);let s=w(e,"ref",15,null),r=w(e,"id",19,()=>Gt(t)),a=w(e,"disabled",3,!1),o=w(e,"onSelect",3,Ve),c=w(e,"closeOnSelect",3,!0),l=$e(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const d=Ki.create({id:M(()=>r()),disabled:M(()=>a()),onSelect:M(()=>o()),ref:M(()=>s(),y=>s(y)),closeOnSelect:M(()=>c())}),h=x(()=>Je(l,d.props));var f=I(),u=S(f);{var p=y=>{var C=I(),O=S(C);se(O,()=>e.child,()=>({props:i(h)})),g(y,C)},v=y=>{var C=Bh();_e(C,()=>({...i(h)}));var O=P(C);se(O,()=>e.children??Te),k(C),g(y,C)};R(u,y=>{e.child?y(p):y(v,!1)})}g(n,f),L()}var Vh=E("<div><!></div>");function Wh(n,e){const t=Yt();N(e,!0);let s=w(e,"ref",15,null),r=w(e,"id",19,()=>Gt(t)),a=$e(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const o=ji.create({id:M(()=>r()),ref:M(()=>s(),u=>s(u))}),c=x(()=>Je(a,o.props));var l=I(),d=S(l);{var h=u=>{var p=I(),v=S(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=Vh();_e(p,()=>({...i(c)}));var v=P(p);se(v,()=>e.children??Te),k(p),g(u,p)};R(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),L()}function Kh(n,e){N(e,!0);let t=w(e,"open",15,!1),s=w(e,"onOpenChange",3,Ve),r=w(e,"onOpenChangeComplete",3,Ve);Ns.create({variant:M(()=>"dialog"),open:M(()=>t(),c=>{t(c),s()(c)}),onOpenChangeComplete:M(()=>r())});var a=I(),o=S(a);se(o,()=>e.children??Te),g(n,a),L()}var jh=E("<button><!></button>");function Uh(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"disabled",3,!1),o=$e(e,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const c=zi.create({variant:M(()=>"close"),id:M(()=>s()),ref:M(()=>r(),p=>r(p)),disabled:M(()=>!!a())}),l=x(()=>Je(o,c.props));var d=I(),h=S(d);{var f=p=>{var v=I(),y=S(v);se(y,()=>e.child,()=>({props:i(l)})),g(p,v)},u=p=>{var v=jh();_e(v,()=>({...i(l)}));var y=P(v);se(y,()=>e.children??Te),k(v),g(p,v)};R(h,p=>{e.child?p(f):p(u,!1)})}g(n,d),L()}var qh=E("<!> <!>",1),Zh=E("<!> <div><!></div>",1);function Yh(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"forceMount",3,!1),o=w(e,"onCloseAutoFocus",3,Ve),c=w(e,"onOpenAutoFocus",3,Ve),l=w(e,"onEscapeKeydown",3,Ve),d=w(e,"onInteractOutside",3,Ve),h=w(e,"trapFocus",3,!0),f=w(e,"preventScroll",3,!0),u=w(e,"restoreScrollDelay",3,null),p=$e(e,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const v=Ls.create({id:M(()=>s()),ref:M(()=>r(),F=>r(F))}),y=x(()=>Je(p,v.props));var C=I(),O=S(C);{var T=F=>{Ji(F,{get ref(){return v.opts.ref},loop:!0,get trapFocus(){return h()},get enabled(){return v.root.opts.open.current},get onOpenAutoFocus(){return c()},get onCloseAutoFocus(){return o()},focusScope:(B,V)=>{let Q=()=>V?.().props;Gi(B,ot(()=>i(y),{get enabled(){return v.root.opts.open.current},get ref(){return v.opts.ref},onEscapeKeydown:he=>{l()(he),!he.defaultPrevented&&v.root.handleClose()},children:(he,ee)=>{Zi(he,ot(()=>i(y),{get ref(){return v.opts.ref},get enabled(){return v.root.opts.open.current},onInteractOutside:pe=>{d()(pe),!pe.defaultPrevented&&v.root.handleClose()},children:(pe,te)=>{to(pe,ot(()=>i(y),{get ref(){return v.opts.ref},get enabled(){return v.root.opts.open.current},children:(ge,U)=>{var G=I(),j=S(G);{var Y=Se=>{var Oe=qh(),at=S(Oe);{var ft=X=>{vr(X,{get preventScroll(){return f()},get restoreScrollDelay(){return u()}})};R(at,X=>{v.root.opts.open.current&&X(ft)})}var kt=D(at,2);{let X=x(()=>({props:Je(i(y),Q()),...v.snippetProps}));se(kt,()=>e.child,()=>i(X))}g(Se,Oe)},ye=Se=>{var Oe=Zh(),at=S(Oe);vr(at,{get preventScroll(){return f()}});var ft=D(at,2);_e(ft,X=>({...X}),[()=>Je(i(y),Q())]);var kt=P(ft);se(kt,()=>e.children??Te),k(ft),g(Se,Oe)};R(j,Se=>{e.child?Se(Y):Se(ye,!1)})}g(ge,G)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};R(O,F=>{(v.shouldRender||a())&&F(T)})}g(n,C),L()}function Gh(n,e){N(e,!0);let t=w(e,"open",15,!1),s=w(e,"dir",3,"ltr"),r=w(e,"onOpenChange",3,Ve),a=w(e,"onOpenChangeComplete",3,Ve),o=w(e,"_internal_variant",3,"dropdown-menu");const c=Hi.create({variant:M(()=>o()),dir:M(()=>s()),onClose:()=>{t(!1),r()(!1)}});Vi.create({open:M(()=>t(),l=>{t(l),r()(l)}),onOpenChangeComplete:M(()=>a())},c),zh(n,{children:(l,d)=>{var h=I(),f=S(h);se(f,()=>e.children??Te),g(l,h)},$$slots:{default:!0}}),L()}var Xh=E("<div><div><!></div></div>"),Qh=E("<div><div><!></div></div>");function Jh(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"loop",3,!0),o=w(e,"onInteractOutside",3,Ve),c=w(e,"onEscapeKeydown",3,Ve),l=w(e,"onCloseAutoFocus",3,Ve),d=w(e,"forceMount",3,!1),h=w(e,"trapFocus",3,!1),f=$e(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const u=Wi.create({id:M(()=>s()),loop:M(()=>a()),ref:M(()=>r(),A=>r(A)),onCloseAutoFocus:M(()=>l())}),p=x(()=>Je(f,u.props));function v(A){if(u.handleInteractOutside(A),!A.defaultPrevented&&(o()(A),!A.defaultPrevented)){if(A.target&&A.target instanceof Element){const B=`[${u.parentMenu.root.getBitsAttr("sub-content")}]`;if(A.target.closest(B))return}u.parentMenu.onClose()}}function y(A){c()(A),!A.defaultPrevented&&u.parentMenu.onClose()}var C=I(),O=S(C);{var T=A=>{Lh(A,ot(()=>i(p),()=>u.popperProps,{get ref(){return u.opts.ref},get enabled(){return u.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:y,get trapFocus(){return h()},get loop(){return a()},forceMount:!0,get id(){return s()},get shouldRender(){return u.shouldRender},popper:(V,Q)=>{let he=()=>Q?.().props,ee=()=>Q?.().wrapperProps;const pe=x(()=>Je(he(),{style:ya("dropdown-menu")},{style:e.style}));var te=I(),ge=S(te);{var U=j=>{var Y=I(),ye=S(Y);{let Se=x(()=>({props:i(pe),wrapperProps:ee(),...u.snippetProps}));se(ye,()=>e.child,()=>i(Se))}g(j,Y)},G=j=>{var Y=Xh();_e(Y,()=>({...ee()}));var ye=P(Y);_e(ye,()=>({...i(pe)}));var Se=P(ye);se(Se,()=>e.children??Te),k(ye),k(Y),g(j,Y)};R(ge,j=>{e.child?j(U):j(G,!1)})}g(V,te)},$$slots:{popper:!0}}))},F=A=>{Nh(A,ot(()=>i(p),()=>u.popperProps,{get ref(){return u.opts.ref},get open(){return u.parentMenu.opts.open.current},onInteractOutside:v,onEscapeKeydown:y,get trapFocus(){return h()},get loop(){return a()},forceMount:!1,get id(){return s()},get shouldRender(){return u.shouldRender},popper:(V,Q)=>{let he=()=>Q?.().props,ee=()=>Q?.().wrapperProps;const pe=x(()=>Je(he(),{style:ya("dropdown-menu")},{style:e.style}));var te=I(),ge=S(te);{var U=j=>{var Y=I(),ye=S(Y);{let Se=x(()=>({props:i(pe),wrapperProps:ee(),...u.snippetProps}));se(ye,()=>e.child,()=>i(Se))}g(j,Y)},G=j=>{var Y=Qh();_e(Y,()=>({...ee()}));var ye=P(Y);_e(ye,()=>({...i(pe)}));var Se=P(ye);se(Se,()=>e.children??Te),k(ye),k(Y),g(j,Y)};R(ge,j=>{e.child?j(U):j(G,!1)})}g(V,te)},$$slots:{popper:!0}}))};R(O,A=>{d()?A(T):d()||A(F,1)})}g(n,C),L()}var ep=E("<button><!></button>");function tp(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"disabled",3,!1),o=w(e,"type",3,"button"),c=$e(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=Ui.create({id:M(()=>s()),disabled:M(()=>a()??!1),ref:M(()=>r(),h=>r(h))}),d=x(()=>Je(c,l.props,{type:o()}));Mh(n,{get id(){return s()},get ref(){return l.opts.ref},children:(h,f)=>{var u=I(),p=S(u);{var v=C=>{var O=I(),T=S(O);se(T,()=>e.child,()=>({props:i(d)})),g(C,O)},y=C=>{var O=ep();_e(O,()=>({...i(d)}));var T=P(O);se(T,()=>e.children??Te),k(O),g(C,O)};R(p,C=>{e.child?C(v):C(y,!1)})}g(h,u)},$$slots:{default:!0}}),L()}const Es=Ei({component:"tabs",parts:["root","list","trigger","content"]}),ho=new $n("Tabs.Root");class po{static create(e){return ho.set(new po(e))}opts;attachment;rovingFocusGroup;#e=$(en([]));get triggerIds(){return i(this.#e)}set triggerIds(e){m(this.#e,e,!0)}valueToTriggerId=new ci;valueToContentId=new ci;constructor(e){this.opts=e,this.attachment=$t(e.ref),this.rovingFocusGroup=new Ua({candidateAttr:Es.trigger,rootNode:this.opts.ref,loop:this.opts.loop,orientation:this.opts.orientation})}registerTrigger(e,t){return this.triggerIds.push(e),this.valueToTriggerId.set(t,e),()=>{this.triggerIds=this.triggerIds.filter(s=>s!==e),this.valueToTriggerId.delete(t)}}registerContent(e,t){return this.valueToContentId.set(t,e),()=>{this.valueToContentId.delete(t)}}setValue(e){this.opts.value.current=e}#t=x(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,[Es.root]:"",...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}class go{static create(e){return new go(e,ho.get())}opts;root;attachment;#e=x(()=>this.root.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(e.ref)}#t=x(()=>({id:this.opts.id.current,role:"tablist","aria-orientation":this.root.opts.orientation.current,"data-orientation":this.root.opts.orientation.current,[Es.list]:"","data-disabled":jn(i(this.#e)),...this.attachment}));get props(){return i(this.#t)}set props(e){m(this.#t,e)}}class vo{static create(e){return new vo(e,ho.get())}opts;root;attachment;#e=$(0);#t=x(()=>this.root.opts.value.current===this.opts.value.current);#n=x(()=>this.opts.disabled.current||this.root.opts.disabled.current);#r=x(()=>this.root.valueToContentId.get(this.opts.value.current));constructor(e,t){this.opts=e,this.root=t,this.attachment=$t(e.ref),Tt([()=>this.opts.id.current,()=>this.opts.value.current],([s,r])=>this.root.registerTrigger(s,r)),mt(()=>{this.root.triggerIds.length,i(this.#t)||!this.root.opts.value.current?m(this.#e,0):m(this.#e,-1)}),this.onfocus=this.onfocus.bind(this),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#s(){this.root.opts.value.current!==this.opts.value.current&&this.root.setValue(this.opts.value.current)}onfocus(e){this.root.opts.activationMode.current!=="automatic"||i(this.#n)||this.#s()}onclick(e){i(this.#n)||this.#s()}onkeydown(e){if(!i(this.#n)){if(e.key===yr||e.key===Kr){e.preventDefault(),this.#s();return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#i=x(()=>({id:this.opts.id.current,role:"tab","data-state":np(i(this.#t)),"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":jn(i(this.#n)),"aria-selected":Ci(i(this.#t)),"aria-controls":i(this.#r),[Es.trigger]:"",disabled:Xu(i(this.#n)),tabindex:i(this.#e),onclick:this.onclick,onfocus:this.onfocus,onkeydown:this.onkeydown,...this.attachment}));get props(){return i(this.#i)}set props(e){m(this.#i,e)}}function np(n){return n?"active":"inactive"}var rp=E("<div><!></div>");function sp(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=w(e,"value",15,""),o=w(e,"onValueChange",3,Ve),c=w(e,"orientation",3,"horizontal"),l=w(e,"loop",3,!0),d=w(e,"activationMode",3,"automatic"),h=w(e,"disabled",3,!1),f=$e(e,["$$slots","$$events","$$legacy","id","ref","value","onValueChange","orientation","loop","activationMode","disabled","children","child"]);const u=po.create({id:M(()=>s()),value:M(()=>a(),T=>{a(T),o()(T)}),orientation:M(()=>c()),loop:M(()=>l()),activationMode:M(()=>d()),disabled:M(()=>h()),ref:M(()=>r(),T=>r(T))}),p=x(()=>Je(f,u.props));var v=I(),y=S(v);{var C=T=>{var F=I(),A=S(F);se(A,()=>e.child,()=>({props:i(p)})),g(T,F)},O=T=>{var F=rp();_e(F,()=>({...i(p)}));var A=P(F);se(A,()=>e.children??Te),k(F),g(T,F)};R(y,T=>{e.child?T(C):T(O,!1)})}g(n,v),L()}var ip=E("<div><!></div>");function op(n,e){const t=Yt();N(e,!0);let s=w(e,"id",19,()=>Gt(t)),r=w(e,"ref",15,null),a=$e(e,["$$slots","$$events","$$legacy","child","children","id","ref"]);const o=go.create({id:M(()=>s()),ref:M(()=>r(),u=>r(u))}),c=x(()=>Je(a,o.props));var l=I(),d=S(l);{var h=u=>{var p=I(),v=S(p);se(v,()=>e.child,()=>({props:i(c)})),g(u,p)},f=u=>{var p=ip();_e(p,()=>({...i(c)}));var v=P(p);se(v,()=>e.children??Te),k(p),g(u,p)};R(d,u=>{e.child?u(h):u(f,!1)})}g(n,l),L()}var ap=E("<button><!></button>");function lp(n,e){const t=Yt();N(e,!0);let s=w(e,"disabled",3,!1),r=w(e,"id",19,()=>Gt(t)),a=w(e,"type",3,"button"),o=w(e,"ref",15,null),c=$e(e,["$$slots","$$events","$$legacy","child","children","disabled","id","type","value","ref"]);const l=vo.create({id:M(()=>r()),disabled:M(()=>s()??!1),value:M(()=>e.value),ref:M(()=>o(),v=>o(v))}),d=x(()=>Je(c,l.props,{type:a()}));var h=I(),f=S(h);{var u=v=>{var y=I(),C=S(y);se(C,()=>e.child,()=>({props:i(d)})),g(v,y)},p=v=>{var y=ap();_e(y,()=>({...i(d)}));var C=P(y);se(C,()=>e.children??Te),k(y),g(v,y)};R(f,v=>{e.child?v(u):v(p,!1)})}g(n,h),L()}const ns=Gh,rs=tp,ss=Ni,is=Jh,Xn=Hh,vb=Wh;var cp=fe("<title> </title>"),up=fe('<svg><!><path d="M18 22 19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22z"></path><path d="M2 18H16V20H2z"></path><path d="M6 12H16V14H6z"></path><path d="M10 6H16V8H10z"></path></svg>');function dp(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=up();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=cp(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(4),k(l),g(n,l),L()}var fp=fe("<title> </title>"),hp=fe('<svg><!><path d="M18 22 19.414 20.586 23 24.172 23 4 25 4 25 24.172 28.586 20.586 30 22 24 28 18 22z"></path><path d="M2 6H16V8H2z"></path><path d="M6 12H16V14H6z"></path><path d="M10 18H16V20H10z"></path></svg>');function pp(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=hp();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=fp(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(4),k(l),g(n,l),L()}function gp(n){return Kt(`/api/repos/${encodeURIComponent(n)}/sync`,{method:"POST"})}function vp(){return Kt("/api/sync",{method:"POST"})}function mb(n,e,t){return Kt(`/api/repos/${encodeURIComponent(n)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(t)}/refresh`,{method:"POST"})}function bb(n,e,t){return Kt(`/api/repos/${encodeURIComponent(n)}/entities/${encodeURIComponent(e)}/${encodeURIComponent(t)}/refresh/apply`,{method:"POST"})}function yb(){return Kt("/api/sources")}function wb(){return Kt("/api/connectors")}function xb(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/config`)}function _b(n,e){return Kt(`/api/connectors/${encodeURIComponent(n)}/config`,{method:"POST",body:JSON.stringify({...e,name:n})})}function kb(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/config`,{method:"DELETE"})}function Sb(n){return Kt(`/api/sources/${encodeURIComponent(n)}`)}function Pb(n,e){return Kt(`/api/sources/${encodeURIComponent(n)}`,{method:"POST",body:JSON.stringify(e)})}function Ab(n,e){return Kt(`/api/repos/${encodeURIComponent(n)}`,{method:"PATCH",body:JSON.stringify({sync:e})})}function Cb(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/oauth/authorize`,{method:"POST"})}function Tb(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/oauth/status`)}function Eb(n){return Kt(`/api/connectors/${encodeURIComponent(n)}/oauth/disconnect`,{method:"POST"})}function mp(){let n=$(en({})),e=null,t=null;function s(p,v,y){t&&(clearInterval(t),t=null),e=`${p}/${v}/${y}`,a("enter",p,v,y),t=setInterval(()=>{e&&a("heartbeat",p,v,y)},3e4)}function r(){if(t&&(clearInterval(t),t=null),e){const[p,v,y]=e.split("/");p&&v&&y&&a("leave",p,v,y),e=null}}function a(p,v,y,C){Qt.send({type:"presence",action:p,repo:v,entityType:y,entityId:C})}function o(p){const v=`${p.repo}/${p.entityType}/${p.entityId}`,y=i(n)[v]??[];if(p.action==="leave")i(n)[v]=y.filter(C=>C.id!==p.user.id);else{const C=y.findIndex(O=>O.id===p.user.id);C>=0?(y[C]=p.user,i(n)[v]=[...y]):i(n)[v]=[...y,p.user]}}function c(){if(m(n,{},!0),!e)return;const[p,v,y]=e.split("/");p&&v&&y&&a("enter",p,v,y)}function l(p,v,y,C){const O=`${p}/${v}/${y}`,T=i(n)[O]??[];return C?T.filter(F=>F.id!==C):T}function d(p,v){const y=new Map;for(const[C,O]of Object.entries(i(n)))if(C.startsWith(p))for(const T of O)(!v||T.id!==v)&&y.set(T.id,T);return[...y.values()]}function h(p,v){return d(`${p}/`,v)}function f(p){const v=new Map;for(const y of Object.values(i(n)))for(const C of y)(!p||C.id!==p)&&v.set(C.id,C);return[...v.values()]}const u=x(()=>{const p=new Map;for(const v of Object.values(i(n)))for(const y of v)p.set(y.id,y);return[...p.values()]});return{enter:s,leave:r,handlePresenceEvent:o,resetAndResend:c,getPresence:l,getPresenceByPrefix:d,getRepoPresence:h,getAllUsers:f,get allUsers(){return i(u)}}}const pr=mp();Qt.setPresenceHandler(n=>pr.handlePresenceEvent(n));Qt.addConnectHandler(()=>pr.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>pr.leave());var bp=fe("<title> </title>"),yp=fe('<svg><!><path d="M30,30H28V25a5.0057,5.0057,0,0,0-5-5V18a7.0078,7.0078,0,0,1,7,7Z"></path><path d="M22,30H20V25a5.0059,5.0059,0,0,0-5-5H9a5.0059,5.0059,0,0,0-5,5v5H2V25a7.0082,7.0082,0,0,1,7-7h6a7.0082,7.0082,0,0,1,7,7Z"></path><path d="M20,2V4a5,5,0,0,1,0,10v2A7,7,0,0,0,20,2Z"></path><path d="M12,4A5,5,0,1,1,7,9a5,5,0,0,1,5-5m0-2a7,7,0,1,0,7,7A7,7,0,0,0,12,2Z"></path></svg>');function wp(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=yp();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=bp(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(4),k(l),g(n,l),L()}var xp=fe("<title> </title>"),_p=fe('<svg><!><path d="M28,8H20.8284L17.4143,4.5859A2,2,0,0,0,16,4H4A2,2,0,0,0,2,6V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10A2,2,0,0,0,28,8ZM8,26V14h8v6.17l-2.59-2.58L12,19l5,5,5-5-1.41-1.41L18,20.17V14a2.0025,2.0025,0,0,0-2-2H8a2.0025,2.0025,0,0,0-2,2V26H4V6H16l4,4h8v2H22v2h6V26Z"></path></svg>');function kp(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=_p();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=xp(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var Sp=fe("<title> </title>"),Pp=fe('<svg><!><path d="M15 12H17V30H15z"></path><path d="M11.33,18.22a7,7,0,0,1,0-10.44l1.34,1.49a5,5,0,0,0,0,7.46Z"></path><path d="M20.67,18.22l-1.34-1.49a5,5,0,0,0,0-7.46l1.34-1.49a7,7,0,0,1,0,10.44Z"></path><path d="M8.4,21.8a11,11,0,0,1,0-17.6L9.6,5.8a9,9,0,0,0,0,14.4Z"></path><path d="M23.6,21.8l-1.2-1.6a9,9,0,0,0,0-14.4l1.2-1.6a11,11,0,0,1,0,17.6Z"></path></svg>');function Ap(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Pp();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Sp(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(5),k(l),g(n,l),L()}var Cp=fe("<title> </title>"),Tp=fe('<svg><!><path d="M22,8H21V2H19V8H13V2H11V8H10a2,2,0,0,0-2,2v6a8.0073,8.0073,0,0,0,7,7.9307V30h2V23.9307A8.0073,8.0073,0,0,0,24,16V10A2,2,0,0,0,22,8Z"></path></svg>');function Ep(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Tp();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Cp(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var Op=fe("<title> </title>"),Rp=fe('<svg><!><path d="M17 22 17 14 13 14 13 16 15 16 15 22 12 22 12 24 20 24 20 22 17 22z"></path><path d="M16,8a1.5,1.5,0,1,0,1.5,1.5A1.5,1.5,0,0,0,16,8Z"></path><path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"></path></svg>');function zp(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Rp();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Op(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(3),k(l),g(n,l),L()}function Mp(n,e){N(e,!0);let t=w(e,"ref",15,null),s=w(e,"value",15,""),r=$e(e,["$$slots","$$events","$$legacy","ref","value","class"]);var a=I(),o=S(a);{let c=x(()=>Et("flex flex-col gap-2",e.class));q(o,()=>sp,(l,d)=>{d(l,ot({"data-slot":"tabs",get class(){return i(c)}},()=>r,{get ref(){return t()},set ref(h){t(h)},get value(){return s()},set value(h){s(h)}}))})}g(n,a),L()}function Ip(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class","orientation"]);var r=I(),a=S(r);{let o=x(()=>Et(e.orientation==="vertical"?"flex flex-col w-full":"inline-flex h-9 w-fit items-center justify-center rounded-lg bg-[var(--color-bg-surface)] p-[3px]",e.class));q(a,()=>op,(c,l)=>{l(c,ot({"data-slot":"tabs-list",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),L()}function zr(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class","orientation"]);var r=I(),a=S(r);{let o=x(()=>Et("inline-flex items-center text-[14px] font-normal whitespace-nowrap transition-[color,background] duration-150 cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e.orientation==="vertical"?"justify-start w-full h-8 gap-[11px] pl-[19px] pr-3 text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] hover:text-[var(--color-text-primary)] data-[state=active]:bg-[var(--color-bg-hover)] data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:font-medium":"justify-center flex-1 gap-2 rounded-md border border-transparent px-2 py-1 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)] data-[state=active]:bg-[var(--color-bg-hover)] data-[state=active]:text-[var(--color-text-primary)] data-[state=active]:shadow-sm",e.class));q(a,()=>lp,(c,l)=>{l(c,ot({"data-slot":"tabs-trigger",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),L()}function Dp(n,e){N(e,!0);let t=w(e,"open",15,!1),s=$e(e,["$$slots","$$events","$$legacy","open"]);var r=I(),a=S(r);q(a,()=>fd,(o,c)=>{c(o,ot(()=>s,{get open(){return t()},set open(l){t(l)}}))}),g(n,r),L()}function Fp(n,e){let t=$e(e,["$$slots","$$events","$$legacy"]);var s=I(),r=S(s);q(r,()=>Ni,(a,o)=>{o(a,ot(()=>t))}),g(n,s)}function $p(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=S(r);{let o=x(()=>Et("text-lg font-semibold",e.class));q(a,()=>qa,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-title",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),L()}function Np(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=S(r);{let o=x(()=>e.class||Et(gs()));q(a,()=>gd,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-action",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),L()}function Lp(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=S(r);{let o=x(()=>e.class||Et(gs({variant:"ghost"})));q(a,()=>md,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-cancel",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),L()}var Bp=E("<div><!></div>");function Hp(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=Bp();_e(r,o=>({"data-slot":"alert-dialog-footer",class:o,...s}),[()=>Et("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e.class)]);var a=P(r);se(a,()=>e.children??Te),k(r),Ds(r,o=>t(o),()=>t()),g(n,r),L()}var Vp=E("<div><!></div>");function Wp(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class","children"]);var r=Vp();_e(r,o=>({"data-slot":"alert-dialog-header",class:o,...s}),[()=>Et("flex flex-col gap-2 text-center sm:text-start",e.class)]);var a=P(r);se(a,()=>e.children??Te),k(r),Ds(r,o=>t(o),()=>t()),g(n,r),L()}function Kp(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=S(r);{let o=x(()=>Et("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e.class));q(a,()=>hl,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-overlay",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),L()}var jp=E("<!> <!>",1);function Up(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class","portalProps"]);Fp(n,ot(()=>e.portalProps,{children:(r,a)=>{var o=jp(),c=S(o);Kp(c,{});var l=D(c,2);{let d=x(()=>Et("bg-[var(--color-bg-elevated)] border-[var(--color-border)] text-[var(--color-text-primary)] 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e.class));q(l,()=>_f,(h,f)=>{f(h,ot({"data-slot":"alert-dialog-content",get class(){return i(d)}},()=>s,{get ref(){return t()},set ref(u){t(u)}}))})}g(r,o)},$$slots:{default:!0}})),L()}function qp(n,e){N(e,!0);let t=w(e,"ref",15,null),s=$e(e,["$$slots","$$events","$$legacy","ref","class"]);var r=I(),a=S(r);{let o=x(()=>Et("text-[var(--color-text-secondary)] text-sm",e.class));q(a,()=>pl,(c,l)=>{l(c,ot({"data-slot":"alert-dialog-description",get class(){return i(o)}},()=>s,{get ref(){return t()},set ref(d){t(d)}}))})}g(n,r),L()}var Zp=E("<!> <!>",1),Yp=E("<!> <!>",1),Gp=E("<!> <!>",1);function os(n,e){N(e,!0);let t=w(e,"open",15),s=w(e,"confirmLabel",3,"Confirm"),r=w(e,"cancelLabel",3,"Cancel"),a=w(e,"destructive",3,!1);var o=I(),c=S(o);q(c,()=>Dp,(l,d)=>{d(l,{onOpenChange:h=>{h||e.oncancel()},get open(){return t()},set open(h){t(h)},children:(h,f)=>{var u=I(),p=S(u);q(p,()=>Up,(v,y)=>{y(v,{children:(C,O)=>{var T=Gp(),F=S(T);q(F,()=>Wp,(B,V)=>{V(B,{children:(Q,he)=>{var ee=Zp(),pe=S(ee);q(pe,()=>$p,(ge,U)=>{U(ge,{children:(G,j)=>{le();var Y=Jt();K(()=>J(Y,e.title)),g(G,Y)},$$slots:{default:!0}})});var te=D(pe,2);q(te,()=>qp,(ge,U)=>{U(ge,{children:(G,j)=>{le();var Y=Jt();K(()=>J(Y,e.message)),g(G,Y)},$$slots:{default:!0}})}),g(Q,ee)},$$slots:{default:!0}})});var A=D(F,2);q(A,()=>Hp,(B,V)=>{V(B,{children:(Q,he)=>{var ee=Yp(),pe=S(ee);{let ge=x(()=>gs({variant:"ghost"}));q(pe,()=>Lp,(U,G)=>{G(U,{get class(){return i(ge)},get onclick(){return e.oncancel},children:(j,Y)=>{le();var ye=Jt();K(()=>J(ye,r())),g(j,ye)},$$slots:{default:!0}})})}var te=D(pe,2);{let ge=x(()=>gs({variant:a()?"destructive":"accent"}));q(te,()=>Np,(U,G)=>{G(U,{get class(){return i(ge)},get onclick(){return e.onconfirm},children:(j,Y)=>{le();var ye=Jt();K(()=>J(ye,s())),g(j,ye)},$$slots:{default:!0}})})}g(Q,ee)},$$slots:{default:!0}})}),g(C,T)},$$slots:{default:!0}})}),g(h,u)},$$slots:{default:!0}})}),g(n,o),L()}function mo(n,e){N(e,!0);let t=w(e,"open",15,!1),s=$e(e,["$$slots","$$events","$$legacy","open","onOpenChange","children"]);var r=I(),a=S(r);q(a,()=>Kh,(o,c)=>{c(o,ot({get onOpenChange(){return e.onOpenChange}},()=>s,{get open(){return t()},set open(l){t(l)},children:(l,d)=>{var h=I(),f=S(h);se(f,()=>e.children),g(l,h)},$$slots:{default:!0}}))}),g(n,r),L()}var Xp=E("<!> <!>",1);function bo(n,e){N(e,!0);let t=w(e,"size",3,"md"),s=$e(e,["$$slots","$$events","$$legacy","children","class","size"]);var r=I(),a=S(r);q(a,()=>Ni,(o,c)=>{c(o,{children:(l,d)=>{var h=Xp(),f=S(h);q(f,()=>hl,(p,v)=>{v(p,{class:"dialog-overlay"})});var u=D(f,2);{let p=x(()=>Et("dialog-content",`dialog-${t()}`,e.class));q(u,()=>Yh,(v,y)=>{y(v,ot({get class(){return i(p)}},()=>s,{children:(C,O)=>{var T=I(),F=S(T);se(F,()=>e.children),g(C,T)},$$slots:{default:!0}}))})}g(l,h)},$$slots:{default:!0}})}),g(n,r),L()}var Qp=E("<div><!></div>");function Cl(n,e){N(e,!0);var t=Qp(),s=P(t);se(s,()=>e.children),k(t),K(r=>Fs(t,1,r),[()=>ki(Et("dialog-header",e.class))]),g(n,t),L()}function Tl(n,e){N(e,!0);var t=I(),s=S(t);{let r=x(()=>Et("dialog-title",e.class));q(s,()=>qa,(a,o)=>{o(a,{get class(){return i(r)},children:(c,l)=>{var d=I(),h=S(d);se(h,()=>e.children),g(c,d)},$$slots:{default:!0}})})}g(n,t),L()}function Jp(n,e){N(e,!0);var t=I(),s=S(t);{let r=x(()=>Et("dialog-description",e.class));q(s,()=>pl,(a,o)=>{o(a,{get class(){return i(r)},children:(c,l)=>{var d=I(),h=S(d);se(h,()=>e.children),g(c,d)},$$slots:{default:!0}})})}g(n,t),L()}var eg=E("<div><!></div>");function tg(n,e){N(e,!0);var t=eg(),s=P(t);se(s,()=>e.children),k(t),K(r=>Fs(t,1,r),[()=>ki(Et("dialog-body",e.class))]),g(n,t),L()}var ng=E("<div><!></div>");function rg(n,e){N(e,!0);var t=ng(),s=P(t);se(s,()=>e.children),k(t),K(r=>Fs(t,1,r),[()=>ki(Et("dialog-footer",e.class))]),g(n,t),L()}function sg(n,e){N(e,!0);var t=I(),s=S(t);{let r=x(()=>Et("dialog-close-btn",e.class));q(s,()=>Uh,(a,o)=>{o(a,{get class(){return i(r)},children:(c,l)=>{vs(c,{size:16})},$$slots:{default:!0}})})}g(n,t),L()}var ig=E("<!> <!>",1),og=E('<span class="type-dot svelte-ak7t5k"></span> <div class="type-info svelte-ak7t5k"><span class="type-name svelte-ak7t5k"> </span> <span class="type-desc svelte-ak7t5k"> </span></div>',1),ag=E('<div class="type-section svelte-ak7t5k"><div class="type-section-label svelte-ak7t5k"> </div> <div class="type-grid svelte-ak7t5k"></div></div>'),lg=E("<!> <!>",1);function cg(n,e){N(e,!0);let t=w(e,"open",15),s=w(e,"appEntityTypes",19,()=>[]);const r={deck:"Presentation slides",doc:"Professional documents",project:"Client engagements and initiatives",meeting:"Conversations and check-ins",decision:"Choices made and their rationale",task:"Action items and to-dos",deliverable:"Outputs and work products",note:"Freeform thinking and scratch",process:"Repeatable methods and workflows",standard:"Guidelines and best practices","case-study":"Past work and lessons learned",document:"Long-form structured content",dataset:"Structured data and tables",reference:"Articles, tools, and resources",publication:"Published works and reports",person:"People you work with",organization:"Companies and institutions",role:"Job functions and responsibilities","practice-area":"Disciplines and specialties",deal:"Opportunities and proposals"},a=[{group:"Project",types:["project","meeting","decision","task","deliverable","note"]},{group:"Knowledge",types:["process","standard","case-study","document","dataset","reference","publication"]},{group:"Business",types:["person","organization","role","practice-area","deal"]}],o=x(()=>s().length>0?[{group:"Apps",types:s()},...a]:a);function c(h){return h.replace(/-/g," ").replace(/\b\w/g,f=>f.toUpperCase())}var l=I(),d=S(l);q(d,()=>mo,(h,f)=>{f(h,{onOpenChange:u=>{u||e.oncancel()},get open(){return t()},set open(u){t(u)},children:(u,p)=>{var v=I(),y=S(v);q(y,()=>bo,(C,O)=>{O(C,{size:"md",children:(T,F)=>{var A=lg(),B=S(A);q(B,()=>Cl,(Q,he)=>{he(Q,{children:(ee,pe)=>{var te=ig(),ge=S(te);q(ge,()=>Tl,(G,j)=>{j(G,{children:(Y,ye)=>{le();var Se=Jt("New Entity");g(Y,Se)},$$slots:{default:!0}})});var U=D(ge,2);q(U,()=>sg,(G,j)=>{j(G,{})}),g(ee,te)},$$slots:{default:!0}})});var V=D(B,2);q(V,()=>tg,(Q,he)=>{he(Q,{class:"entity-body",children:(ee,pe)=>{var te=I(),ge=S(te);xt(ge,17,()=>i(o),Ft,(U,G)=>{var j=ag(),Y=P(j),ye=P(Y,!0);k(Y);var Se=D(Y,2);xt(Se,21,()=>i(G).types,Ft,(Oe,at)=>{Qe(Oe,{variant:"outline",class:"type-card",type:"button",onclick:()=>e.onselect(i(at)),children:(ft,kt)=>{var X=og(),ve=S(X);let Me;var ct=D(ve,2),Ke=P(ct),St=P(Ke,!0);k(Ke);var hn=D(Ke,2),Xt=P(hn,!0);k(hn),k(ct),K((ht,nt)=>{Me=Wn(ve,"",Me,ht),J(St,nt),J(Xt,r[i(at)])},[()=>({background:dr(i(at))}),()=>c(i(at))]),g(ft,X)},$$slots:{default:!0}})}),k(Se),k(j),K(()=>J(ye,i(G).group)),g(U,j)}),g(ee,te)},$$slots:{default:!0}})}),g(T,A)},$$slots:{default:!0}})}),g(u,v)},$$slots:{default:!0}})}),g(n,l),L()}var ug=E('<span class="row-chevron svelte-6dohdz"><!></span>'),dg=E('<span class="item-count svelte-6dohdz"> </span>'),fg=E('<!> <span class="row-label svelte-6dohdz"> </span> <!>',1),hg=E('<div class="indent-group svelte-6dohdz"><!></div>'),pg=E("<!> <!>",1),gg=E('<span class="repo-type-icon svelte-6dohdz"><!></span>'),vg=E('<span class="repo-name svelte-6dohdz"> </span>'),mg=E('<span class="item-count svelte-6dohdz"> </span>'),bg=E('<span class="presence-avatar svelte-6dohdz"> </span>'),yg=E('<span class="presence-stack svelte-6dohdz"></span>'),wg=E('<span class="row-chevron svelte-6dohdz"><!></span> <!> <!> <!> <!>',1),xg=E("<!> ",1),_g=E("<!> Import Files",1),kg=E("<!> Rename",1),Sg=E("<!> Delete",1),Pg=E("<!> <!> <!> <!>",1),Ag=E("<!> <!>",1),Cg=E('<div class="loading-row svelte-6dohdz">Loading...</div>'),Tg=E('<span class="presence-avatar svelte-6dohdz"> </span>'),Eg=E('<span class="presence-stack svelte-6dohdz"></span>'),Og=E('<span class="row-chevron svelte-6dohdz"><!></span> <span class="row-label svelte-6dohdz"> </span> <span class="item-count svelte-6dohdz"> </span> <!>',1),Rg=E("<!> ",1),zg=E("<!> <!>",1),Mg=E('<span class="row-chevron svelte-6dohdz"><!></span>'),Ig=E('<mark class="filter-match svelte-6dohdz"> </mark>'),Dg=E('<span class="presence-avatar svelte-6dohdz"> </span>'),Fg=E('<span class="presence-stack svelte-6dohdz"></span>'),$g=E('<!> <span class="row-label svelte-6dohdz"><!></span> <!>',1),Ng=E("<!> Delete",1),Lg=E("<!> <!>",1),Bg=E('<div class="loading-row svelte-6dohdz">Loading...</div>'),Hg=E('<div class="indent-group svelte-6dohdz"><!></div>'),Vg=E('<div class="entity-row-wrapper svelte-6dohdz"><!> <!></div> <!>',1),Wg=E('<div class="indent-group svelte-6dohdz"></div>'),Kg=E('<div class="type-header-wrapper svelte-6dohdz"><!> <!></div> <!>',1),jg=E('<span class="row-chevron svelte-6dohdz"><!></span> <span class="row-label svelte-6dohdz">New Entity</span>',1),Ug=E("<!> <!>",1),qg=E('<div class="indent-group svelte-6dohdz"><!></div>'),Zg=E('<div class="tree-group svelte-6dohdz"><div><!> <!></div> <!></div>'),Yg=E('<div class="workspace-icon svelte-6dohdz"> </div> <span class="workspace-name svelte-6dohdz"> </span>',1),Gg=E('<!> <span class="svelte-6dohdz">Workspace</span>',1),Xg=E('<!> <span class="svelte-6dohdz">Team</span>',1),Qg=E('<!> <span class="svelte-6dohdz">Permissions</span>',1),Jg=E("<!> <!> <!>",1),ev=E('<!> <span class="svelte-6dohdz">Connectors</span>',1),tv=E('<!> <span class="svelte-6dohdz">Sync Sources</span>',1),nv=E("<!> <!> <!>",1),rv=E('<div class="settings-nav svelte-6dohdz"><!></div>'),sv=E('<mark class="filter-match svelte-6dohdz"> </mark>'),iv=E('<span class="recent-time svelte-6dohdz"> </span>'),ov=E('<span class="entity-type-dot svelte-6dohdz"></span> <span class="row-label svelte-6dohdz"><!></span> <!>',1),av=E("<!> Delete",1),lv=E("<!> <!>",1),cv=E('<div class="entity-row-wrapper svelte-6dohdz"><!> <!></div>'),uv=E('<div class="no-results svelte-6dohdz">No matching entities</div>'),dv=E("<!> <!>",1),fv=E('<div class="no-results svelte-6dohdz">No matching entities</div>'),hv=E("<!> <!>",1),pv=E('<div class="new-collection-row svelte-6dohdz"><!> <!> <!></div>'),gv=E('<span class="row-chevron svelte-6dohdz"><!></span> <span class="repo-name svelte-6dohdz">New Collection</span>',1),vv=E('<div class="filter-bar svelte-6dohdz"><span class="filter-icon svelte-6dohdz"><!></span> <!> <!> <!></div> <nav class="tree svelte-6dohdz"><!> <!> <!></nav>',1),mv=E('<div class="sidebar-footer svelte-6dohdz"><span class="user-email svelte-6dohdz"> </span> <!></div>'),bv=E("<!> <!>",1),yv=E('<!> <p class="svelte-6dohdz">Drag files here or <button class="file-picker-link svelte-6dohdz">browse</button></p>',1),wv=E('<div class="import-file-row svelte-6dohdz"><span class="import-file-name svelte-6dohdz"> </span> <button class="import-file-remove svelte-6dohdz">×</button></div>'),xv=E('<div class="import-file-list svelte-6dohdz"></div> <p class="import-hint svelte-6dohdz">Drop more files to add</p>',1),_v=E("<!> <!>",1),kv=E('<!> <div class="import-modal-body svelte-6dohdz"><div class="import-drop-zone svelte-6dohdz"><!></div> <input id="import-file-input" type="file" multiple="" accept=".md,.txt,.csv" style="display:none" class="svelte-6dohdz"/></div> <!>',1),Sv=E('<aside class="sidebar svelte-6dohdz"><div class="sidebar-header svelte-6dohdz"><!> <div class="header-actions svelte-6dohdz"><!> <!></div></div> <!> <!></aside> <!> <!> <!> <!> <!> <!>',1);function Pv(n,e){N(e,!0);const t=(b,_=Te,z=Te,W=Te,ke=Te,me=Te,be=Te)=>{var At=I(),Ot=S(At);xt(Ot,17,_,Ft,(dn,Rt)=>{const nn=x(()=>me()?`${me()}/${i(Rt).name}`:i(Rt).name),rn=x(()=>`${z()}/${W()}/${ke()}/${i(nn)}`),Ye=x(()=>i(Rt).type==="directory"),ut=x(()=>Z.isFolderExpanded(i(rn))),Ut=x(()=>!i(Ye)&&i(nt)===ke()&&i(jt)===i(nn));var ze=pg(),Ge=S(ze);{let ae=x(()=>i(Ut)?"selected":""),ie=x(()=>i(Nn)===i(rn)?"focused":""),ne=x(()=>`padding-left: ${ur(be(),i(Ye))}`);Qe(Ge,{variant:"ghost",get class(){return`tree-row ${i(ae)??""} ${i(ie)??""}`},get"data-tree-key"(){return i(rn)},get style(){return i(ne)},onclick:()=>{i(Ye)?Z.toggleFolder(i(rn)):kn(`/${z()}/${W()}/${ke()}/${i(nn)}`)},children:(Ne,re)=>{var oe=fg(),Pe=S(oe);{var Ce=Ct=>{var pt=ug(),we=P(pt);{var xe=rt=>{Xr(rt,{size:14})},De=rt=>{Gr(rt,{size:14})};R(we,rt=>{i(ut)?rt(xe):rt(De,!1)})}k(pt),g(Ct,pt)};R(Pe,Ct=>{i(Ye)&&Ct(Ce)})}var Ie=D(Pe,2),Le=P(Ie,!0);k(Ie);var Ze=D(Ie,2);{var yt=Ct=>{var pt=dg(),we=P(pt,!0);k(pt),K(()=>J(we,i(Rt).count)),g(Ct,pt)};R(Ze,Ct=>{i(Ye)&&i(Rt).count!=null&&Ct(yt)})}K(()=>J(Le,i(Rt).name)),g(Ne,oe)},$$slots:{default:!0}})}var qe=D(Ge,2);{var je=ae=>{var ie=hg();let ne;var Ne=P(ie);t(Ne,()=>i(Rt).children,z,W,ke,()=>i(nn),()=>be()+1),k(ie),K(re=>ne=Wn(ie,"",ne,re),[()=>({"--guide-left":Yr(be())})]),g(ae,ie)};R(qe,ae=>{i(Ye)&&i(ut)&&i(Rt).children&&i(Rt).children.length>0&&ae(je)})}g(dn,ze)}),g(b,At)},s=(b,_=Te)=>{const z=x(()=>i(tn)?.repo===_().name),W=x(()=>`repo:${_().name}`),ke=x(()=>pr.getRepoPresence(_().name,Dt.user?String(Dt.user.id):void 0));var me=Zg(),be=P(me),At=P(be);{let Ye=x(()=>i(z)?"repo-active":""),ut=x(()=>i(Nn)===i(W)?"focused":""),Ut=x(()=>i(z)&&i(tn)?.color?`--active-color: ${i(tn).color}`:void 0);Qe(At,{variant:"ghost",get class(){return`repo-row ${i(Ye)??""} ${i(ut)??""}`},get"data-tree-key"(){return i(W)},get style(){return i(Ut)},onclick:()=>Ys(_().name),children:(ze,Ge)=>{var qe=wg(),je=S(qe),ae=P(je);{var ie=we=>{Xr(we,{size:14})},ne=x(()=>Z.isExpanded(_().name)),Ne=we=>{Gr(we,{size:14})};R(ae,we=>{i(ne)?we(ie):we(Ne,!1)})}k(je);var re=D(je,2);{var oe=we=>{var xe=gg(),De=P(xe);ni(De,{size:12}),k(xe),g(we,xe)};R(re,we=>{_().private&&we(oe)})}var Pe=D(re,2);{var Ce=we=>{ds(we,{class:"repo-rename-input",type:"text",onkeydown:pe,onblur:ee,onclick:xe=>xe.stopPropagation(),get ref(){return i(Q)},set ref(xe){m(Q,xe,!0)},get value(){return i(V)},set value(xe){m(V,xe,!0)}})},Ie=we=>{var xe=vg(),De=P(xe,!0);k(xe),K(()=>J(De,_().name)),fr("dblclick",xe,rt=>{i(te)&&_().type!=="private"&&he(_().name,rt)}),g(we,xe)};R(Pe,we=>{i(B)===_().name?we(Ce):we(Ie,!1)})}var Le=D(Pe,2);{var Ze=we=>{var xe=mg(),De=P(xe,!0);k(xe),K(()=>J(De,_().count)),g(we,xe)};R(Le,we=>{_().count!=null&&i(B)!==_().name&&we(Ze)})}var yt=D(Le,2);{var Ct=we=>{var xe=yg();xt(xe,21,()=>i(ke).slice(0,3),Ft,(De,rt)=>{var gt=bg(),Ee=P(gt,!0);k(gt),K(zt=>J(Ee,zt),[()=>i(rt).name[0].toUpperCase()]),g(De,gt)}),k(xe),K(De=>us(xe,"title",De),[()=>i(ke).map(De=>De.name).join(", ")]),g(we,xe)},pt=x(()=>!Z.isExpanded(_().name)&&i(ke).length>0);R(yt,we=>{i(pt)&&we(Ct)})}g(ze,qe)},$$slots:{default:!0}})}var Ot=D(At,2);{var dn=Ye=>{var ut=I(),Ut=S(ut);q(Ut,()=>ns,(ze,Ge)=>{Ge(ze,{onOpenChange:qe=>{m(r,qe?_().name:null,!0)},children:(qe,je)=>{var ae=Ag(),ie=S(ae);{let Ne=x(()=>i(r)===_().name?"menu-open":"");q(ie,()=>rs,(re,oe)=>{oe(re,{get class(){return`repo-actions-btn ${i(Ne)??""}`},onclick:Pe=>Pe.stopPropagation(),children:(Pe,Ce)=>{Qr(Pe,{size:12})},$$slots:{default:!0}})})}var ne=D(ie,2);q(ne,()=>ss,(Ne,re)=>{re(Ne,{children:(oe,Pe)=>{var Ce=I(),Ie=S(Ce);q(Ie,()=>is,(Le,Ze)=>{Ze(Le,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(yt,Ct)=>{var pt=Pg(),we=S(pt);{var xe=Ae=>{var Be=I(),vt=S(Be);{let st=x(()=>!!i(u));q(vt,()=>Xn,(it,Xe)=>{Xe(it,{class:"repo-menu-item",get disabled(){return i(st)},onSelect:()=>p(_().name),children:(Mt,dt)=>{var It=xg(),He=S(It);{let wt=x(()=>i(u)===_().name?"animate-spin":"");Qo(He,{size:12,get class(){return i(wt)}})}var lt=D(He);K(()=>J(lt,` ${i(u)===_().name?"Syncing...":"Sync"}`)),g(Mt,It)},$$slots:{default:!0}})})}g(Ae,Be)};R(we,Ae=>{_().sync&&_().sync.length>0&&Ae(xe)})}var De=D(we,2);{var rt=Ae=>{var Be=I(),vt=S(Be);q(vt,()=>Xn,(st,it)=>{it(st,{class:"repo-menu-item",onSelect:()=>{m(G,_().name,!0),m(j,[],!0)},children:(Xe,Mt)=>{var dt=_g(),It=S(dt);Jo(It,{size:12}),le(),g(Xe,dt)},$$slots:{default:!0}})}),g(Ae,Be)};R(De,Ae=>{i(te)&&Ae(rt)})}var gt=D(De,2);{var Ee=Ae=>{var Be=I(),vt=S(Be);q(vt,()=>Xn,(st,it)=>{it(st,{class:"repo-menu-item",onSelect:Xe=>he(_().name,Xe),children:(Xe,Mt)=>{var dt=kg(),It=S(dt);za(It,{size:12}),le(),g(Xe,dt)},$$slots:{default:!0}})}),g(Ae,Be)};R(gt,Ae=>{i(te)&&_().type!=="private"&&Ae(Ee)})}var zt=D(gt,2);{var sn=Ae=>{var Be=I(),vt=S(Be);q(vt,()=>Xn,(st,it)=>{it(st,{class:"repo-menu-item repo-menu-item-danger",onSelect:Xe=>h(_().name,Xe),children:(Xe,Mt)=>{var dt=Sg(),It=S(dt);Dr(It,{size:12}),le(),g(Xe,dt)},$$slots:{default:!0}})}),g(Ae,Be)};R(zt,Ae=>{i(te)&&Ae(sn)})}g(yt,pt)},$$slots:{default:!0}})}),g(oe,Ce)},$$slots:{default:!0}})}),g(qe,ae)},$$slots:{default:!0}})}),g(Ye,ut)};R(Ot,Ye=>{i(B)!==_().name&&(i(te)||_().sync&&_().sync.length>0)&&Ye(dn)})}k(be);var Rt=D(be,2);{var nn=Ye=>{var ut=qg();let Ut;var ze=P(ut);{var Ge=je=>{var ae=Cg();let ie;K(ne=>ie=Wn(ae,"",ie,ne),[()=>({"padding-left":ur(1,!1)})]),g(je,ae)},qe=je=>{var ae=Ug(),ie=S(ae);xt(ie,17,()=>Kl(_().entities),Ft,(Ne,re)=>{const oe=x(()=>`type:${_().name}/${i(re).type}`),Pe=x(()=>!Z.isFolderCollapsed(i(oe))),Ce=x(()=>_().name===i(ht)&&i(re).entities.some(xe=>xe.id===i(nt)));var Ie=Kg(),Le=S(Ie),Ze=P(Le);{let xe=x(()=>i(Ce)?"type-active":""),De=x(()=>`padding-left: ${ur(1,!0)}; border-left-color: ${i(Ce)?dr(i(re).type):"transparent"}`);Qe(Ze,{variant:"ghost",get class(){return`tree-row type-header-row ${i(xe)??""}`},get style(){return i(De)},get"data-tree-key"(){return i(oe)},onclick:()=>Z.toggleFolder(i(oe)),children:(rt,gt)=>{const Ee=x(()=>pr.getPresenceByPrefix(`${_().name}/${i(re).type}/`,Dt.user?String(Dt.user.id):void 0));var zt=Og(),sn=S(zt),Ae=P(sn);{var Be=He=>{Xr(He,{size:14})},vt=He=>{Gr(He,{size:14})};R(Ae,He=>{i(Pe)?He(Be):He(vt,!1)})}k(sn);var st=D(sn,2),it=P(st,!0);k(st);var Xe=D(st,2),Mt=P(Xe,!0);k(Xe);var dt=D(Xe,2);{var It=He=>{var lt=Eg();xt(lt,21,()=>i(Ee).slice(0,3),Ft,(wt,Yn)=>{var fn=Tg(),Lt=P(fn,!0);k(fn),K(Bt=>J(Lt,Bt),[()=>i(Yn).name[0].toUpperCase()]),g(wt,fn)}),k(lt),K(wt=>us(lt,"title",wt),[()=>i(Ee).map(wt=>wt.name).join(", ")]),g(He,lt)};R(dt,He=>{!i(Pe)&&i(Ee).length>0&&He(It)})}K(()=>{J(it,i(re).label),J(Mt,i(re).entities.length)}),g(rt,zt)},$$slots:{default:!0}})}var yt=D(Ze,2);{var Ct=xe=>{var De=I(),rt=S(De);q(rt,()=>ns,(gt,Ee)=>{Ee(gt,{onOpenChange:zt=>{m(a,zt?i(oe):null,!0)},children:(zt,sn)=>{var Ae=zg(),Be=S(Ae);{let st=x(()=>i(a)===i(oe)?"menu-open":"");q(Be,()=>rs,(it,Xe)=>{Xe(it,{get class(){return`type-actions-btn ${i(st)??""}`},onclick:Mt=>Mt.stopPropagation(),children:(Mt,dt)=>{Qr(Mt,{size:12})},$$slots:{default:!0}})})}var vt=D(Be,2);q(vt,()=>ss,(st,it)=>{it(st,{children:(Xe,Mt)=>{var dt=I(),It=S(dt);q(It,()=>is,(He,lt)=>{lt(He,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(wt,Yn)=>{var fn=I(),Lt=S(fn);q(Lt,()=>Xn,(Bt,on)=>{on(Bt,{class:"repo-menu-item repo-menu-item-danger",onSelect:qt=>F(_().name,i(re).type,i(re).label,i(re).entities.length,qt),children:(qt,Ln)=>{var On=Rg(),Bn=S(On);Dr(Bn,{size:12});var Sr=D(Bn);K(Pr=>J(Sr,` Delete all ${Pr??""}`),[()=>i(re).label.toLowerCase()]),g(qt,On)},$$slots:{default:!0}})}),g(wt,fn)},$$slots:{default:!0}})}),g(Xe,dt)},$$slots:{default:!0}})}),g(zt,Ae)},$$slots:{default:!0}})}),g(xe,De)};R(yt,xe=>{i(te)&&xe(Ct)})}k(Le);var pt=D(Le,2);{var we=xe=>{var De=Wg();let rt;xt(De,21,()=>i(re).entities,gt=>gt.id,(gt,Ee)=>{const zt=x(()=>i(Ee).id===i(nt)&&_().name===i(ht)&&!i(jt)),sn=x(()=>i(Ee).hasSubContent&&Z.isEntityExpanded(_().name,i(Ee).entityType,i(Ee).id)),Ae=x(()=>i(Ee).hasSubContent?Z.getEntityContents(_().name,i(Ee).entityType,i(Ee).id):null),Be=x(()=>`entity:${_().name}/${i(Ee).entityType}/${i(Ee).id}`),vt=x(()=>pr.getPresence(_().name,i(Ee).entityType,i(Ee).id,Dt.user?String(Dt.user.id):void 0));var st=Vg(),it=S(st),Xe=P(it);{let He=x(()=>i(zt)?"selected":""),lt=x(()=>i(Nn)===i(Be)?"focused":""),wt=x(()=>`padding-left: ${ur(2,i(Ee).hasSubContent)}${i(zt)?`; --active-color: ${dr(i(Ee).entityType)}`:""}`);Qe(Xe,{variant:"ghost",get class(){return`tree-row ${i(He)??""} ${i(lt)??""}`},get"data-tree-key"(){return i(Be)},get style(){return i(wt)},onclick:()=>Xs(i(Ee),_().name),children:(Yn,fn)=>{var Lt=$g(),Bt=S(Lt);{var on=Ht=>{var Vt=Mg(),xn=P(Vt);{var Hn=an=>{Xr(an,{size:14})},gn=an=>{Gr(an,{size:14})};R(xn,an=>{i(sn)?an(Hn):an(gn,!1)})}k(Vt),g(Ht,Vt)};R(Bt,Ht=>{i(Ee).hasSubContent&&Ht(on)})}var qt=D(Bt,2),Ln=P(qt);{var On=Ht=>{var Vt=I(),xn=S(Vt);xt(xn,17,()=>Eo(i(Ee).title),Ft,(Hn,gn)=>{var an=I(),Ar=S(an);{var Cr=Rn=>{var Vn=Ig(),Jl=P(Vn,!0);k(Vn),K(()=>J(Jl,i(gn).text)),g(Rn,Vn)},Ho=Rn=>{var Vn=Jt();K(()=>J(Vn,i(gn).text)),g(Rn,Vn)};R(Ar,Rn=>{i(gn).match?Rn(Cr):Rn(Ho,!1)})}g(Hn,an)}),g(Ht,Vt)},Bn=Ht=>{var Vt=Jt();K(()=>J(Vt,i(Ee).title)),g(Ht,Vt)};R(Ln,Ht=>{i(Pt)?Ht(On):Ht(Bn,!1)})}k(qt);var Sr=D(qt,2);{var Pr=Ht=>{var Vt=Fg();xt(Vt,21,()=>i(vt).slice(0,3),Ft,(xn,Hn)=>{var gn=Dg(),an=P(gn,!0);k(gn),K(Ar=>J(an,Ar),[()=>i(Hn).name[0].toUpperCase()]),g(xn,gn)}),k(Vt),K(xn=>us(Vt,"title",xn),[()=>i(vt).map(xn=>xn.name).join(", ")]),g(Ht,Vt)};R(Sr,Ht=>{i(vt).length>0&&Ht(Pr)})}g(Yn,Lt)},$$slots:{default:!0}})}var Mt=D(Xe,2);q(Mt,()=>ns,(He,lt)=>{lt(He,{onOpenChange:wt=>{m(o,wt?i(Be):null,!0)},children:(wt,Yn)=>{var fn=Lg(),Lt=S(fn);{let on=x(()=>i(o)===i(Be)?"menu-open":"");q(Lt,()=>rs,(qt,Ln)=>{Ln(qt,{get class(){return`entity-actions-btn ${i(on)??""}`},onclick:On=>On.stopPropagation(),children:(On,Bn)=>{Qr(On,{size:12})},$$slots:{default:!0}})})}var Bt=D(Lt,2);q(Bt,()=>ss,(on,qt)=>{qt(on,{children:(Ln,On)=>{var Bn=I(),Sr=S(Bn);q(Sr,()=>is,(Pr,Ht)=>{Ht(Pr,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(Vt,xn)=>{var Hn=I(),gn=S(Hn);q(gn,()=>Xn,(an,Ar)=>{Ar(an,{class:"repo-menu-item repo-menu-item-danger",onSelect:Cr=>y(_().name,i(Ee),Cr),children:(Cr,Ho)=>{var Rn=Ng(),Vn=S(Rn);Dr(Vn,{size:12}),le(),g(Cr,Rn)},$$slots:{default:!0}})}),g(Vt,Hn)},$$slots:{default:!0}})}),g(Ln,Bn)},$$slots:{default:!0}})}),g(wt,fn)},$$slots:{default:!0}})}),k(it);var dt=D(it,2);{var It=He=>{var lt=I(),wt=S(lt);{var Yn=Lt=>{var Bt=Bg();let on;K(qt=>on=Wn(Bt,"",on,qt),[()=>({"padding-left":ur(3,!1)})]),g(Lt,Bt)},fn=Lt=>{var Bt=Hg();let on;var qt=P(Bt);t(qt,()=>i(Ae).entries,()=>_().name,()=>i(Ee).entityType,()=>i(Ee).id,()=>"",()=>3),k(Bt),K(Ln=>on=Wn(Bt,"",on,Ln),[()=>({"--guide-left":Yr(2)})]),g(Lt,Bt)};R(wt,Lt=>{i(Ae).loading?Lt(Yn):i(Ae).entries.length>0&&Lt(fn,1)})}g(He,lt)};R(dt,He=>{i(sn)&&i(Ae)&&He(It)})}ln("mouseenter",it,()=>{Re.hoveredEntityId=i(Ee).id}),ln("mouseleave",it,()=>{Re.hoveredEntityId=null}),g(gt,st)}),k(De),K(gt=>rt=Wn(De,"",rt,gt),[()=>({"--guide-left":Yr(1)})]),g(xe,De)};R(pt,xe=>{i(Pe)&&xe(we)})}g(Ne,Ie)});var ne=D(ie,2);{let Ne=x(()=>`padding-left: ${ur(1,!0)}`);Qe(ne,{variant:"ghost",class:"tree-row new-entity-row",get style(){return i(Ne)},onclick:re=>{re.stopPropagation(),m(En,_().name,!0)},children:(re,oe)=>{var Pe=jg(),Ce=S(Pe),Ie=P(Ce);Xo(Ie,{size:14}),k(Ce),le(2),g(re,Pe)},$$slots:{default:!0}})}g(je,ae)};R(ze,je=>{_().loading?je(Ge):je(qe,!1)})}k(ut),K(je=>Ut=Wn(ut,"",Ut,je),[()=>({"--guide-left":Yr(0)})]),g(Ye,ut)},rn=x(()=>Z.isExpanded(_().name));R(Rt,Ye=>{i(rn)&&Ye(nn)})}k(me),K(()=>Fs(be,1,`repo-row-wrapper ${i(U)===_().name?"drop-target":""}`,"svelte-6dohdz")),ln("dragover",be,Ye=>Se(Ye,_().name)),ln("dragleave",be,Oe),ln("drop",be,Ye=>at(Ye,_().name)),g(b,me)};let r=$(null),a=$(null),o=$(null);async function c(){Qt.startSyncToast("workspace");try{const{workspaceResults:b=[]}=await vp();let _=0,z=0;const W=[];for(const ke of b)for(const me of ke.targets??[])_+=(me.created??0)+(me.derived??0),z+=me.skipped??0,W.push(...me.errors??[]);if(_>0){const ke=new Set(b.flatMap(me=>(me.targets??[]).filter(be=>(be.created??0)+(be.derived??0)>0).map(be=>be.repo)));await Promise.all([...ke].map(me=>Z.refreshEntities(me)))}W.length>0?Qt.finishSyncToast("workspace",`Sync failed: ${W[0]}`,!0):_>0?Qt.finishSyncToast("workspace",`Synced ${_} new entities`,!1):Qt.finishSyncToast("workspace",`No new entities (${z} already synced)`,!1)}catch(b){console.error("Sync failed:",b),Qt.finishSyncToast("workspace",`Sync failed: ${b.message}`,!0)}}let l=$(!1),d=$(null);function h(b,_){_.stopPropagation(),m(d,b,!0)}async function f(){if(!i(d))return;const b=i(d);m(d,null);try{await Z.removeCollection(b)}catch(_){console.error("Failed to delete collection:",_.message)}}let u=$(null);async function p(b){if(!i(u)){m(u,b,!0),Qt.startSyncToast(b);try{const _=await gp(b),W=(_.collectionResults??_.results??[]).reduce((ke,me)=>ke+(me.created??0)+(me.skipped??0),0);Qt.finishSyncToast(b,`Synced ${W} entities in ${b}`,!1),Z.refreshEntities(b)}catch(_){Qt.finishSyncToast(b,`Sync failed: ${_.message}`,!0)}finally{m(u,null)}}}let v=$(null);function y(b,_,z){z.stopPropagation(),m(v,{repo:b,type:_.entityType,id:_.id,title:_.title},!0)}async function C(){if(!i(v))return;const{repo:b,type:_,id:z}=i(v);m(v,null),Z.removeEntity(b,_,z),Re.selectedRepo===b&&Re.selectedId===z&&kn("/");try{await jo(b,_,z)}catch(W){console.error("Failed to delete entity:",W.message),await Z.refreshEntities(b)}}let O=$(null),T=$(!1);function F(b,_,z,W,ke){ke.stopPropagation(),m(O,{repo:b,type:_,label:z,count:W},!0)}async function A(){if(!i(O)||i(T))return;const{repo:b,type:_}=i(O),z=Z.repos.find(be=>be.name===b)?.entities.filter(be=>be.entityType===_)??[];m(T,!0),m(O,null),Re.selectedRepo===b&&z.some(be=>be.id===Re.selectedId)&&kn("/");const W=z.length;for(const be of z)try{await jo(b,be.entityType,be.id)}catch{}await Z.refreshEntities(b);const ke=Z.repos.find(be=>be.name===b)?.entities.filter(be=>be.entityType===_).length??0,me=W-ke;Qt.showToast(`Deleted ${me} ${me===1?"entity":"entities"}`),m(T,!1)}let B=$(null),V=$(""),Q=$(null);function he(b,_){_.stopPropagation(),m(B,b,!0),m(V,b,!0),setTimeout(()=>i(Q)?.select(),0)}async function ee(){if(!i(B))return;const b=i(B),_=i(V).trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(m(B,null),!(!_||_===b))try{await Z.renameCollectionTo(b,_)}catch(z){console.error("Failed to rename collection:",z.message)}}function pe(b){b.key==="Enter"?(b.preventDefault(),ee()):b.key==="Escape"&&m(B,null)}const te=x(()=>!Dt.loading&&(!Dt.authEnabled||Dt.user?.role==="admin"));let ge=$(!1),U=$(null),G=$(null),j=$(en([])),Y=$(!1);const ye=[".md",".txt",".csv"];function Se(b,_){b.preventDefault(),i(te)&&(b.dataTransfer&&(b.dataTransfer.dropEffect="copy"),m(U,_,!0))}function Oe(b){const _=b.relatedTarget;_&&b.currentTarget?.contains(_)||m(U,null)}async function at(b,_){if(b.preventDefault(),m(U,null),!i(te)||!b.dataTransfer?.files.length)return;const z=await ft(b.dataTransfer.files);z.length!==0&&await kt(_,z)}async function ft(b){const _=[];for(const z of Array.from(b)){const W="."+z.name.split(".").pop()?.toLowerCase();if(!ye.includes(W))continue;const ke=await z.text();_.push({filename:z.name,content:ke})}return _}async function kt(b,_){if(_.length!==0){m(Y,!0);try{const{apiFetch:z}=await kc(async()=>{const{apiFetch:ke}=await import("./CTpBBS5W.js").then(me=>me.n);return{apiFetch:ke}},__vite__mapDeps([0,1,2,3]),import.meta.url),W=await z(`/api/repos/${encodeURIComponent(b)}/import`,{method:"POST",body:JSON.stringify({files:_})});await Z.refreshEntities(b),console.log(`Imported ${W.imported} file(s) into ${b}`,W)}catch(z){console.error("Import failed:",z.message)}finally{m(Y,!1),m(G,null),m(j,[],!0)}}}async function X(b){if(b.preventDefault(),!b.dataTransfer?.files.length)return;const _=await ft(b.dataTransfer.files);m(j,[...i(j),..._],!0)}async function ve(b){const _=b.target;if(!_.files?.length)return;const z=await ft(_.files);m(j,[...i(j),...z],!0),_.value=""}let Me=$(""),ct=$(!1),Ke=$(null),St=$(!1);async function hn(){const b=i(Me).trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(b){m(St,!0);try{await Z.addCollection(b,void 0,i(ct)||void 0),m(ge,!1),m(Me,""),m(ct,!1)}catch{m(St,!1),await new Promise(z=>requestAnimationFrame(z)),i(Ke)?.classList.remove("shake"),i(Ke)?.offsetWidth,i(Ke)?.classList.add("shake"),i(Ke)?.focus();return}finally{m(St,!1)}}}function Xt(b){b.key==="Enter"?(b.preventDefault(),hn()):b.key==="Escape"&&(m(ge,!1),m(Me,""),m(ct,!1))}const ht=x(()=>Re.selectedRepo),nt=x(()=>Re.selectedId),jt=x(()=>Re.selectedSubPath),Pt=x(()=>Z.filterQuery);let pn=$(null);function lr(b){const _=b.target.value;Z.setFilterQuery(_)}function Zn(){Z.setFilterQuery(""),i(pn)&&(i(pn).value="")}function cr(b,_,z,W,ke,me){for(const be of b){const At=ke?`${ke}/${be.name}`:be.name,Ot=`${_}/${z}/${W}/${At}`;be.type==="directory"?(me.push({key:Ot,kind:"content-dir",repo:_,folderKey:Ot}),Z.isFolderExpanded(Ot)&&be.children?.length&&cr(be.children,_,z,W,At,me)):me.push({key:Ot,kind:"content-file",repo:_,gotoPath:`/${_}/${z}/${W}/${At}`})}}const bt=x(()=>{const b=[],_=Z.sortedRepos;for(const z of _)if(b.push({key:`repo:${z.name}`,kind:"repo",repo:z.name}),Z.isExpanded(z.name)&&!z.loading){for(const W of z.entities)if(b.push({key:`entity:${z.name}/${W.entityType}/${W.id}`,kind:"entity",repo:z.name,entity:W}),W.hasSubContent&&Z.isEntityExpanded(z.name,W.entityType,W.id)){const me=Z.getEntityContents(z.name,W.entityType,W.id);!me.loading&&me.entries.length>0&&cr(me.entries,z.name,W.entityType,W.id,"",b)}}return b});let We=$(-1);const Nn=x(()=>i(We)>=0&&i(We)<i(bt).length?i(bt)[i(We)].key:null);let qr="";mt(()=>{const b=Z.filterQuery;b!==qr&&(qr=b,m(We,-1))});function wn(){requestAnimationFrame(()=>{if(!i(Nt)||i(We)<0)return;const b=i(bt)[i(We)]?.key;if(!b)return;const _=i(Nt).querySelector(`[data-tree-key="${CSS.escape(b)}"]`);_&&_.scrollIntoView({block:"nearest"})})}function Zr(){if(i(We)<0)return;const b=i(bt)[i(We)];if(b)switch(b.kind){case"repo":Z.toggleRepo(b.repo);break;case"entity":b.entity&&Xs(b.entity,b.repo);break;case"content-dir":b.folderKey&&Z.toggleFolder(b.folderKey);break;case"content-file":b.gotoPath&&kn(b.gotoPath);break}}function Us(){if(i(We)<0)return;const b=i(bt)[i(We)];b&&(b.kind==="repo"&&!Z.isExpanded(b.repo)?Z.toggleRepo(b.repo):b.kind==="entity"&&b.entity?.hasSubContent&&!Z.isEntityExpanded(b.repo,b.entity.entityType,b.entity.id)?Z.toggleEntity(b.repo,b.entity.entityType,b.entity.id):b.kind==="content-dir"&&b.folderKey&&!Z.isFolderExpanded(b.folderKey)?Z.toggleFolder(b.folderKey):i(We)<i(bt).length-1&&(tr(We),wn()))}function qs(){if(i(We)<0)return;const b=i(bt)[i(We)];b&&(b.kind==="repo"&&Z.isExpanded(b.repo)?Z.toggleRepo(b.repo):b.kind==="entity"&&b.entity?.hasSubContent&&Z.isEntityExpanded(b.repo,b.entity.entityType,b.entity.id)?Z.toggleEntity(b.repo,b.entity.entityType,b.entity.id):b.kind==="content-dir"&&b.folderKey&&Z.isFolderExpanded(b.folderKey)?Z.toggleFolder(b.folderKey):i(We)>0&&(tr(We,-1),wn()))}function Zs(b){if(b.key==="Escape"){Zn(),i(pn)?.blur(),m(We,-1);return}if(b.key==="ArrowDown"){b.preventDefault(),i(We)<i(bt).length-1&&tr(We),wn();return}if(b.key==="ArrowUp"){b.preventDefault(),i(We)>0?tr(We,-1):i(We)===0&&m(We,-1),wn();return}if(b.key==="Enter"){b.preventDefault(),Zr();return}if(b.key==="ArrowRight"){b.preventDefault(),Us();return}if(b.key==="ArrowLeft"){b.preventDefault(),qs();return}}const tn=x(()=>{if(!i(nt)||!i(ht))return null;const b=Z.repos.find(z=>z.name===i(ht));if(!b)return null;const _=b.entities.find(z=>z.id===i(nt));return _?{repo:b.name,entityType:_.entityType,color:dr(_.entityType)}:null});mt(()=>{const b=i(ht)&&i(nt)?`${i(ht)}/${i(nt)}`:null;b&&b!==Z.lastAutoExpandedFor&&i(tn)&&(Z.lastAutoExpandedFor=b,Z.isExpanded(i(tn).repo)||Z.toggleRepo(i(tn).repo))});let Nt=$(void 0);Is(()=>{i(Nt)&&Z.sidebarScrollTop>0&&(i(Nt).scrollTop=Z.sidebarScrollTop)});function _r(){i(Nt)&&(Z.sidebarScrollTop=i(Nt).scrollTop)}function Ys(b){Z.toggleRepo(b)}function kr(b,_,z){kn(`/${b}/${_}/${z}`)}let En=$(null),Gs=$(!1);function To(b){return b.replace(/-/g," ").replace(/\b\w/g,_=>_.toUpperCase())}async function Vl(b,_){if(!i(Gs)){m(Gs,!0),m(En,null);try{const z=`${_}-${Date.now()}`,W=`Untitled ${To(_)}`,ke=new Date().toISOString(),me=ke.split("T")[0],be=_==="deck"?`<!-- slide: cover -->
|
|
7
7
|
<!-- theme: light -->
|
|
8
8
|
|
|
9
|
-
# ${
|
|
9
|
+
# ${W}
|
|
10
10
|
## Subtitle
|
|
11
11
|
|
|
12
12
|
---
|
|
@@ -25,10 +25,10 @@ Sincerely,
|
|
|
25
25
|
## Project Overview
|
|
26
26
|
|
|
27
27
|
[Project overview text]
|
|
28
|
-
`:"";await _c(b,_,R,{entity_type:_,entity_id:R,name:K,date:me,created_at:ke,updated_at:ke,created_by:"web",updated_by:"web"},be),await Z.refreshEntities(b),kn(`/${b}/${_}/${R}`)}catch(R){console.error("Failed to create entity:",R)}finally{m(Gs,!1)}}}function Xs(b,_){const R=b.id===i(nt)&&_===i(ht)&&!i(jt);ze.activeView==="graph"?ze.selectOnGraph(_,b.entityType,b.id):R?(ze.deselect(),kn("/")):(kr(_,b.entityType,b.id),b.hasSubContent&&Z.toggleEntity(_,b.entityType,b.id))}function Wl(b){if(!b)return"";const _=Date.now()-new Date(b).getTime(),R=Math.floor(_/6e4);if(R<1)return"now";if(R<60)return`${R}m`;const K=Math.floor(R/60);if(K<24)return`${K}h`;const ke=Math.floor(K/24);return ke<30?`${ke}d`:`${Math.floor(ke/30)}mo`}function Eo(b){const _=i(At).trim().toLowerCase();if(!_)return[{text:b,match:!1}];const R=b.toLowerCase().indexOf(_);if(R===-1)return[{text:b,match:!1}];const K=[];return R>0&&K.push({text:b.slice(0,R),match:!1}),K.push({text:b.slice(R,R+_.length),match:!0}),R+_.length<b.length&&K.push({text:b.slice(R+_.length),match:!1}),K}function Kl(b){const _=new Map;for(const R of b){const K=_.get(R.entityType)??[];K.push(R),_.set(R.entityType,K)}return Array.from(_.entries()).map(([R,K])=>({type:R,label:To(eu(R)),entities:K})).sort((R,K)=>R.label.localeCompare(K.label))}const Oo=30;function ur(b,_){return`${(_?20:50)+b*Oo}px`}function Gr(b){return`${30+b*Oo}px`}var zo=Sv(),Qs=A(zo),Js=S(Qs),Ro=S(Js);{var jl=b=>{Ge(b,{variant:"ghost",class:"home-btn",title:"Home",onclick:()=>{ze.deselect(),ze.activeView!=="graph"&&kn("/")},children:(_,R)=>{var K=Yg(),ke=A(K),me=S(ke,!0);k(ke);var be=D(ke,2),Pt=S(be,!0);k(be),W(Ot=>{Q(me,Ot),Q(Pt,Z.name||"Studiograph")},[()=>(Z.name||"Studiograph")[0].toUpperCase()]),g(_,K)},$$slots:{default:!0}})};O(Ro,b=>{Z.nameLoaded&&b(jl)})}var Mo=D(Ro,2),Io=S(Mo);{var Ul=b=>{Ge(b,{variant:"ghost",size:"icon",class:"settings-btn",title:"Sync workspace",onclick:c,children:(_,R)=>{Qo(_,{size:14})},$$slots:{default:!0}})};O(Io,b=>{i(te)&&b(Ul)})}var ql=D(Io,2);{let b=x(()=>i(te)?"Workspace Settings":"Connectors");Ge(ql,{variant:"ghost",size:"icon",class:"settings-btn",get title(){return i(b)},href:"/settings",children:(_,R)=>{fu(_,{size:14})},$$slots:{default:!0}})}k(Mo),k(Js);var $o=D(Js,2);{var Zl=b=>{var _=rv(),R=S(_);q(R,()=>Mp,(K,ke)=>{ke(K,{get value(){return ze.settingsTab},onValueChange:me=>{ze.settingsTab=me},class:"flex-1",children:(me,be)=>{const Pt=x(()=>$t.user?.role==="admin"||!$t.authEnabled);var Ot=I(),dn=A(Ot);q(dn,()=>Ip,(zt,nn)=>{nn(zt,{orientation:"vertical",children:(rn,Ye)=>{var ut=nv(),Ut=A(ut);{var Re=fe=>{var ie=Jg(),ne=A(ie);q(ne,()=>Rr,(oe,Ae)=>{Ae(oe,{value:"general",orientation:"vertical",children:(Ce,Ie)=>{var Le=Gg(),Ze=A(Le);Rp(Ze,{size:14}),de(2),g(Ce,Le)},$$slots:{default:!0}})});var Ne=D(ne,2);q(Ne,()=>Rr,(oe,Ae)=>{Ae(oe,{value:"users",orientation:"vertical",children:(Ce,Ie)=>{var Le=Xg(),Ze=A(Le);wp(Ze,{size:14}),de(2),g(Ce,Le)},$$slots:{default:!0}})});var re=D(Ne,2);q(re,()=>Rr,(oe,Ae)=>{Ae(oe,{value:"collections",orientation:"vertical",children:(Ce,Ie)=>{var Le=Qg(),Ze=A(Le);kp(Ze,{size:14}),de(2),g(Ce,Le)},$$slots:{default:!0}})}),g(fe,ie)};O(Ut,fe=>{i(Pt)&&fe(Re)})}var Qe=D(Ut,2);q(Qe,()=>Rr,(fe,ie)=>{ie(fe,{value:"connectors",orientation:"vertical",children:(ne,Ne)=>{var re=ev(),oe=A(re);Ep(oe,{size:14}),de(2),g(ne,re)},$$slots:{default:!0}})});var qe=D(Qe,2);{var je=fe=>{var ie=I(),ne=A(ie);q(ne,()=>Rr,(Ne,re)=>{re(Ne,{value:"sources",orientation:"vertical",children:(oe,Ae)=>{var Ce=tv(),Ie=A(Ce);Pp(Ie,{size:14}),de(2),g(oe,Ce)},$$slots:{default:!0}})}),g(fe,ie)};O(qe,fe=>{i(Pt)&&fe(je)})}g(rn,ut)},$$slots:{default:!0}})}),g(me,Ot)},$$slots:{default:!0}})}),k(_),g(b,_)},Yl=b=>{var _=vv(),R=A(_),K=S(R),ke=S(K);za(ke,{size:14}),k(K);var me=D(K,2);fs(me,{class:"filter-input",type:"text",placeholder:"Search",oninput:lr,onkeydown:Zs,get ref(){return i(pn)},set ref(Re){m(pn,Re,!0)}});var be=D(me,2);{var Pt=Re=>{Ge(Re,{variant:"ghost",size:"icon",class:"filter-clear",onclick:Zn,title:"Clear filter",children:(Qe,qe)=>{vs(Qe,{size:13})},$$slots:{default:!0}})};O(be,Re=>{i(At)&&Re(Pt)})}var Ot=D(be,2);{let Re=x(()=>Z.sortMode==="recent"?"active":""),Qe=x(()=>Z.sortMode==="alpha"?"Sort by recent":"Sort alphabetically");Ge(Ot,{variant:"ghost",size:"icon",get class(){return`sort-toggle ${i(Re)??""}`},get title(){return i(Qe)},onclick:()=>{Z.sortMode=Z.sortMode==="alpha"?"recent":"alpha"},children:(qe,je)=>{var fe=I(),ie=A(fe);{var ne=re=>{pp(re,{size:14})},Ne=re=>{dp(re,{size:14})};O(ie,re=>{Z.sortMode==="alpha"?re(ne):re(Ne,!1)})}g(qe,fe)},$$slots:{default:!0}})}k(R);var dn=D(R,2),zt=S(dn);{var nn=Re=>{var Qe=dv(),qe=A(Qe);xt(qe,17,()=>Z.recentEntities,ie=>`${ie.repo}/${ie.entityType}/${ie.id}`,(ie,ne)=>{const Ne=x(()=>i(ne).id===i(nt)&&i(ne).repo===i(ht)&&!i(jt)),re=x(()=>`entity:${i(ne).repo}/${i(ne).entityType}/${i(ne).id}`);var oe=cv(),Ae=S(oe);{let Ie=x(()=>i(Ne)?"selected":""),Le=x(()=>i(Nn)===i(re)?"focused":""),Ze=x(()=>`padding-left: 27px${i(Ne)?`; --active-color: ${dr(i(ne).entityType)}`:""}`);Ge(Ae,{variant:"ghost",get class(){return`tree-row ${i(Ie)??""} ${i(Le)??""}`},get"data-tree-key"(){return i(re)},get style(){return i(Ze)},onclick:()=>Xs(i(ne),i(ne).repo),children:(yt,Ct)=>{var pt=ov(),xe=A(pt);let _e;var $e=D(xe,2),rt=S($e);{var gt=Pe=>{var Be=I(),vt=A(Be);xt(vt,17,()=>Eo(i(ne).title),Dt,(st,it)=>{var Je=I(),Mt=A(Je);{var dt=He=>{var lt=sv(),wt=S(lt,!0);k(lt),W(()=>Q(wt,i(it).text)),g(He,lt)},It=He=>{var lt=Jt();W(()=>Q(lt,i(it).text)),g(He,lt)};O(Mt,He=>{i(it).match?He(dt):He(It,!1)})}g(st,Je)}),g(Pe,Be)},Ee=Pe=>{var Be=Jt();W(()=>Q(Be,i(ne).title)),g(Pe,Be)};O(rt,Pe=>{i(At)?Pe(gt):Pe(Ee,!1)})}k($e);var Rt=D($e,2);{var sn=Pe=>{var Be=iv(),vt=S(Be,!0);k(Be),W(st=>Q(vt,st),[()=>Wl(i(ne).updatedAt)]),g(Pe,Be)};O(Rt,Pe=>{i(ne).updatedAt&&Pe(sn)})}W(Pe=>_e=Wn(xe,"",_e,Pe),[()=>({background:dr(i(ne).entityType)})]),g(yt,pt)},$$slots:{default:!0}})}var Ce=D(Ae,2);q(Ce,()=>rs,(Ie,Le)=>{Le(Ie,{onOpenChange:Ze=>{m(o,Ze?i(re):null,!0)},children:(Ze,yt)=>{var Ct=lv(),pt=A(Ct);{let _e=x(()=>i(o)===i(re)?"menu-open":"");q(pt,()=>ss,($e,rt)=>{rt($e,{get class(){return`entity-actions-btn ${i(_e)??""}`},onclick:gt=>gt.stopPropagation(),children:(gt,Ee)=>{Jr(gt,{size:12})},$$slots:{default:!0}})})}var xe=D(pt,2);q(xe,()=>is,(_e,$e)=>{$e(_e,{children:(rt,gt)=>{var Ee=I(),Rt=A(Ee);q(Rt,()=>os,(sn,Pe)=>{Pe(sn,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(Be,vt)=>{var st=I(),it=A(st);q(it,()=>Xn,(Je,Mt)=>{Mt(Je,{class:"repo-menu-item repo-menu-item-danger",onSelect:dt=>y(i(ne).repo,i(ne),dt),children:(dt,It)=>{var He=av(),lt=A(He);$r(lt,{size:12}),de(),g(dt,He)},$$slots:{default:!0}})}),g(Be,st)},$$slots:{default:!0}})}),g(rt,Ee)},$$slots:{default:!0}})}),g(Ze,Ct)},$$slots:{default:!0}})}),k(oe),ln("mouseenter",oe,()=>{ze.hoveredEntityId=i(ne).id}),ln("mouseleave",oe,()=>{ze.hoveredEntityId=null}),g(ie,oe)});var je=D(qe,2);{var fe=ie=>{var ne=uv();g(ie,ne)};O(je,ie=>{i(At)&&Z.recentEntities.length===0&&ie(fe)})}g(Re,Qe)},rn=Re=>{var Qe=hv(),qe=A(Qe);xt(qe,17,()=>Z.sortedRepos,Dt,(ie,ne)=>{s(ie,()=>i(ne))});var je=D(qe,2);{var fe=ie=>{var ne=fv();g(ie,ne)};O(je,ie=>{i(At)&&Z.sortedRepos.length===0&&ie(fe)})}g(Re,Qe)};O(zt,Re=>{Z.sortMode==="recent"?Re(nn):Re(rn,!1)})}var Ye=D(zt,2);{var ut=Re=>{var Qe=pv(),qe=S(Qe);fs(qe,{class:"new-collection-input",type:"text",placeholder:"collection-name",onkeydown:Xt,onblur:()=>{!i(Me).trim()&&!i(ct)&&m(ge,!1)},get disabled(){return i(St)},get ref(){return i(Ke)},set ref(oe){m(Ke,oe,!0)},get value(){return i(Me)},set value(oe){m(Me,oe,!0)}});var je=D(qe,2);{var fe=oe=>{Ge(oe,{variant:"ghost",size:"icon",class:"new-collection-clear",title:"Clear",onclick:()=>{m(Me,""),m(ct,!1),m(ge,!1)},onmousedown:Ae=>Ae.preventDefault(),children:(Ae,Ce)=>{vs(Ae,{size:13})},$$slots:{default:!0}})},ie=x(()=>i(Me).trim());O(je,oe=>{i(ie)&&oe(fe)})}var ne=D(je,2);{var Ne=oe=>{{let Ae=x(()=>i(ct)?"active":""),Ce=x(()=>i(ct)?"Private (local-only)":"Make private");Ge(oe,{variant:"ghost",size:"icon",get class(){return`private-toggle ${i(Ae)??""}`},get title(){return i(Ce)},onclick:()=>{m(ct,!i(ct))},onmousedown:Ie=>Ie.preventDefault(),children:(Ie,Le)=>{var Ze=I(),yt=A(Ze);{var Ct=xe=>{ni(xe,{size:13})},pt=xe=>{iu(xe,{size:13})};O(yt,xe=>{i(ct)?xe(Ct):xe(pt,!1)})}g(Ie,Ze)},$$slots:{default:!0}})}},re=oe=>{ni(oe,{size:13,class:"private-indicator"})};O(ne,oe=>{i(te)?oe(Ne):oe(re,!1)})}k(Qe),g(Re,Qe)};O(Ye,Re=>{i(ge)&&Re(ut)})}var Ut=D(Ye,2);Ge(Ut,{variant:"ghost",class:"repo-row new-collection-btn",onclick:()=>{m(ge,!0),i(te)||m(ct,!0),setTimeout(()=>i(Ke)?.focus(),0)},title:"New collection",children:(Re,Qe)=>{var qe=gv(),je=A(qe),fe=S(je);Xo(fe,{size:14}),k(je),de(2),g(Re,qe)},$$slots:{default:!0}}),k(dn),$s(dn,Re=>m(Nt,Re),()=>i(Nt)),ln("scroll",dn,_r),g(b,_)};O($o,b=>{ze.activeView==="settings"?b(Zl):b(Yl,!1)})}var Gl=D($o,2);{var Xl=b=>{var _=mv(),R=S(_),K=S(R,!0);k(R);var ke=D(R,2);Ge(ke,{variant:"ghost",size:"icon",class:"footer-icon-btn",title:"Sign out",onclick:()=>{m(l,!0)},children:(me,be)=>{Xc(me,{size:14})},$$slots:{default:!0}}),k(_),W(()=>Q(K,$t.user.email)),g(b,_)};O(Gl,b=>{$t.authEnabled&&$t.user&&b(Xl)})}k(Qs);var Do=D(Qs,2);{let b=x(()=>i(En)!==null),_=x(()=>i(En)??""),R=x(()=>Z.apps.flatMap(K=>K.entityTypes));cg(Do,{get open(){return i(b)},get collection(){return i(_)},get appEntityTypes(){return i(R)},onselect:K=>{i(En)&&Vl(i(En),K)},oncancel:()=>{m(En,null)}})}var Fo=D(Do,2);{let b=x(()=>i(d)!==null),_=x(()=>`Delete "${i(d)}" and all its entities? This cannot be undone.`);as(Fo,{get open(){return i(b)},title:"Delete Collection",get message(){return i(_)},confirmLabel:"Delete",destructive:!0,onconfirm:f,oncancel:()=>{m(d,null)}})}var No=D(Fo,2);{let b=x(()=>i(v)!==null),_=x(()=>`Delete "${i(v)?.title}"? This cannot be undone.`);as(No,{get open(){return i(b)},title:"Delete Entity",get message(){return i(_)},confirmLabel:"Delete",destructive:!0,onconfirm:C,oncancel:()=>{m(v,null)}})}var Lo=D(No,2);{let b=x(()=>i(E)!==null),_=x(()=>i(E)?.label),R=x(()=>`Delete all ${i(E)?.count} ${i(E)?.label?.toLowerCase()} in this collection? This cannot be undone.`);as(Lo,{get open(){return i(b)},get title(){return`Delete All ${i(_)??""}`},get message(){return i(R)},confirmLabel:"Delete All",destructive:!0,onconfirm:P,oncancel:()=>{m(E,null)}})}var Bo=D(Lo,2);as(Bo,{get open(){return i(l)},title:"Sign Out",message:"Are you sure you want to sign out?",confirmLabel:"Sign Out",destructive:!0,onconfirm:async()=>{m(l,!1),await $t.logout(),window.location.href="/login"},oncancel:()=>{m(l,!1)}});var Ql=D(Bo,2);{let b=x(()=>!!i(G));q(Ql,()=>mo,(_,R)=>{R(_,{get open(){return i(b)},onOpenChange:K=>{K||(m(G,null),m(j,[],!0))},children:(K,ke)=>{var me=I(),be=A(me);q(be,()=>bo,(Pt,Ot)=>{Ot(Pt,{class:"import-modal",children:(dn,zt)=>{var nn=kv(),rn=A(nn);q(rn,()=>Cl,(fe,ie)=>{ie(fe,{children:(ne,Ne)=>{var re=bv(),oe=A(re);q(oe,()=>Tl,(Ce,Ie)=>{Ie(Ce,{children:(Le,Ze)=>{de();var yt=Jt();W(()=>Q(yt,`Import files into ${i(G)??""}`)),g(Le,yt)},$$slots:{default:!0}})});var Ae=D(oe,2);q(Ae,()=>Jp,(Ce,Ie)=>{Ie(Ce,{children:(Le,Ze)=>{de();var yt=Jt("Supports .md, .txt, and .csv files.");g(Le,yt)},$$slots:{default:!0}})}),g(ne,re)},$$slots:{default:!0}})});var Ye=D(rn,2),ut=S(Ye),Ut=S(ut);{var Re=fe=>{var ie=yv(),ne=A(ie);Jo(ne,{size:24,style:"opacity: 0.4"});var Ne=D(ne,2),re=D(S(Ne));k(Ne),fr("click",re,()=>document.getElementById("import-file-input")?.click()),g(fe,ie)},Qe=fe=>{var ie=xv(),ne=A(ie);xt(ne,21,()=>i(j),Dt,(Ne,re,oe)=>{var Ae=wv(),Ce=S(Ae),Ie=S(Ce,!0);k(Ce);var Le=D(Ce,2);k(Ae),W(()=>Q(Ie,i(re).filename)),fr("click",Le,()=>{m(j,i(j).filter((Ze,yt)=>yt!==oe),!0)}),g(Ne,Ae)}),k(ne),de(2),g(fe,ie)};O(Ut,fe=>{i(j).length===0?fe(Re):fe(Qe,!1)})}k(ut);var qe=D(ut,2);k(Ye);var je=D(Ye,2);q(je,()=>rg,(fe,ie)=>{ie(fe,{children:(ne,Ne)=>{var re=_v(),oe=A(re);Ge(oe,{variant:"ghost",onclick:()=>{m(G,null),m(j,[],!0)},children:(Ce,Ie)=>{de();var Le=Jt("Cancel");g(Ce,Le)},$$slots:{default:!0}});var Ae=D(oe,2);{let Ce=x(()=>i(j).length===0||i(Y));Ge(Ae,{get disabled(){return i(Ce)},onclick:()=>i(G)&&kt(i(G),i(j)),children:(Ie,Le)=>{de();var Ze=Jt();W(()=>Q(Ze,i(Y)?"Importing...":`Import ${i(j).length} file${i(j).length!==1?"s":""}`)),g(Ie,Ze)},$$slots:{default:!0}})}g(ne,re)},$$slots:{default:!0}})}),ln("dragover",ut,fe=>{fe.preventDefault(),fe.dataTransfer&&(fe.dataTransfer.dropEffect="copy")}),ln("drop",ut,X),fr("change",qe,ve),g(dn,nn)},$$slots:{default:!0}})}),g(K,me)},$$slots:{default:!0}})})}g(n,zo),N()}Ta(["dblclick","click","change"]);var Pv=ue("<title> </title>"),Cv=ue('<svg><!><path d="M16 4 6 14 7.41 15.41 15 7.83 15 28 17 28 17 7.83 24.59 15.41 26 14 16 4z"></path></svg>');function El(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Cv();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Pv(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var Tv=ue("<title> </title>"),Ev=ue('<svg><!><path d="M24,6H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>');function Ov(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Ev();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Tv(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var zv=ue("<title> </title>"),Rv=ue('<svg><!><path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"></path><path d="M20.59 22 15 16.41 15 7 17 7 17 15.58 22 20.59 20.59 22z"></path></svg>');function Mv(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Rv();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=zv(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(2),k(l),g(n,l),N()}function yo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ar=yo();function Ol(n){ar=n}var er={exec:()=>null};function De(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Zt.caret,"$1"),t=t.replace(r,o),s},getRegex:()=>new RegExp(t,e)};return s}var Iv=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Zt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},$v=/^(?:[ \t]*(?:\n|$))+/,Dv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Nv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,zl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rl=De(zl).replace(/bull/g,wo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Lv=De(zl).replace(/bull/g,wo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Bv=/^[^\n]+/,_o=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Hv=De(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",_o).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vv=De(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wo).getRegex(),Ks="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ko=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Wv=De("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ko).replace("tag",Ks).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ml=De(xo).replace("hr",qr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ks).getRegex(),Kv=De(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ml).getRegex(),So={blockquote:Kv,code:Dv,def:Hv,fences:Fv,heading:Nv,hr:qr,html:Wv,lheading:Rl,list:Vv,newline:$v,paragraph:Ml,table:er,text:Bv},xa=De("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ks).getRegex(),jv={...So,lheading:Lv,table:xa,paragraph:De(xo).replace("hr",qr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xa).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ks).getRegex()},Uv={...So,html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ko).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:er,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:De(xo).replace("hr",qr).replace("heading",` *#{1,6} *[^
|
|
29
|
-
]`).replace("lheading",
|
|
28
|
+
`:"";await Pc(b,_,z,{entity_type:_,entity_id:z,name:W,date:me,created_at:ke,updated_at:ke,created_by:"web",updated_by:"web"},be),await Z.refreshEntities(b),kn(`/${b}/${_}/${z}`)}catch(z){console.error("Failed to create entity:",z)}finally{m(Gs,!1)}}}function Xs(b,_){const z=b.id===i(nt)&&_===i(ht)&&!i(jt);Re.activeView==="graph"?Re.selectOnGraph(_,b.entityType,b.id):z?(Re.deselect(),kn("/")):(kr(_,b.entityType,b.id),b.hasSubContent&&Z.toggleEntity(_,b.entityType,b.id))}function Wl(b){if(!b)return"";const _=Date.now()-new Date(b).getTime(),z=Math.floor(_/6e4);if(z<1)return"now";if(z<60)return`${z}m`;const W=Math.floor(z/60);if(W<24)return`${W}h`;const ke=Math.floor(W/24);return ke<30?`${ke}d`:`${Math.floor(ke/30)}mo`}function Eo(b){const _=i(Pt).trim().toLowerCase();if(!_)return[{text:b,match:!1}];const z=b.toLowerCase().indexOf(_);if(z===-1)return[{text:b,match:!1}];const W=[];return z>0&&W.push({text:b.slice(0,z),match:!1}),W.push({text:b.slice(z,z+_.length),match:!0}),z+_.length<b.length&&W.push({text:b.slice(z+_.length),match:!1}),W}function Kl(b){const _=new Map;for(const z of b){const W=_.get(z.entityType)??[];W.push(z),_.set(z.entityType,W)}return Array.from(_.entries()).map(([z,W])=>({type:z,label:To(eu(z)),entities:W})).sort((z,W)=>z.label.localeCompare(W.label))}const Oo=30;function ur(b,_){return`${(_?20:50)+b*Oo}px`}function Yr(b){return`${30+b*Oo}px`}var Ro=Sv(),Qs=S(Ro),Js=P(Qs),zo=P(Js);{var jl=b=>{Qe(b,{variant:"ghost",class:"home-btn",title:"Home",onclick:()=>{Re.deselect(),Re.activeView!=="graph"&&kn("/")},children:(_,z)=>{var W=Yg(),ke=S(W),me=P(ke,!0);k(ke);var be=D(ke,2),At=P(be,!0);k(be),K(Ot=>{J(me,Ot),J(At,Z.name||"Studiograph")},[()=>(Z.name||"Studiograph")[0].toUpperCase()]),g(_,W)},$$slots:{default:!0}})};R(zo,b=>{Z.nameLoaded&&b(jl)})}var Mo=D(zo,2),Io=P(Mo);{var Ul=b=>{Qe(b,{variant:"ghost",size:"icon",class:"settings-btn",title:"Sync workspace",onclick:c,children:(_,z)=>{Qo(_,{size:14})},$$slots:{default:!0}})};R(Io,b=>{i(te)&&b(Ul)})}var ql=D(Io,2);{let b=x(()=>i(te)?"Workspace Settings":"Connectors");Qe(ql,{variant:"ghost",size:"icon",class:"settings-btn",get title(){return i(b)},href:"/settings",children:(_,z)=>{fu(_,{size:14})},$$slots:{default:!0}})}k(Mo),k(Js);var Do=D(Js,2);{var Zl=b=>{var _=rv(),z=P(_);q(z,()=>Mp,(W,ke)=>{ke(W,{get value(){return Re.settingsTab},onValueChange:me=>{Re.settingsTab=me},class:"flex-1",children:(me,be)=>{const At=x(()=>Dt.user?.role==="admin"||!Dt.authEnabled);var Ot=I(),dn=S(Ot);q(dn,()=>Ip,(Rt,nn)=>{nn(Rt,{orientation:"vertical",children:(rn,Ye)=>{var ut=nv(),Ut=S(ut);{var ze=ae=>{var ie=Jg(),ne=S(ie);q(ne,()=>zr,(oe,Pe)=>{Pe(oe,{value:"general",orientation:"vertical",children:(Ce,Ie)=>{var Le=Gg(),Ze=S(Le);zp(Ze,{size:14}),le(2),g(Ce,Le)},$$slots:{default:!0}})});var Ne=D(ne,2);q(Ne,()=>zr,(oe,Pe)=>{Pe(oe,{value:"users",orientation:"vertical",children:(Ce,Ie)=>{var Le=Xg(),Ze=S(Le);wp(Ze,{size:14}),le(2),g(Ce,Le)},$$slots:{default:!0}})});var re=D(Ne,2);q(re,()=>zr,(oe,Pe)=>{Pe(oe,{value:"collections",orientation:"vertical",children:(Ce,Ie)=>{var Le=Qg(),Ze=S(Le);kp(Ze,{size:14}),le(2),g(Ce,Le)},$$slots:{default:!0}})}),g(ae,ie)};R(Ut,ae=>{i(At)&&ae(ze)})}var Ge=D(Ut,2);q(Ge,()=>zr,(ae,ie)=>{ie(ae,{value:"connectors",orientation:"vertical",children:(ne,Ne)=>{var re=ev(),oe=S(re);Ep(oe,{size:14}),le(2),g(ne,re)},$$slots:{default:!0}})});var qe=D(Ge,2);{var je=ae=>{var ie=I(),ne=S(ie);q(ne,()=>zr,(Ne,re)=>{re(Ne,{value:"sources",orientation:"vertical",children:(oe,Pe)=>{var Ce=tv(),Ie=S(Ce);Ap(Ie,{size:14}),le(2),g(oe,Ce)},$$slots:{default:!0}})}),g(ae,ie)};R(qe,ae=>{i(At)&&ae(je)})}g(rn,ut)},$$slots:{default:!0}})}),g(me,Ot)},$$slots:{default:!0}})}),k(_),g(b,_)},Yl=b=>{var _=vv(),z=S(_),W=P(z),ke=P(W);Ra(ke,{size:14}),k(W);var me=D(W,2);ds(me,{class:"filter-input",type:"text",placeholder:"Search",oninput:lr,onkeydown:Zs,get ref(){return i(pn)},set ref(ze){m(pn,ze,!0)}});var be=D(me,2);{var At=ze=>{Qe(ze,{variant:"ghost",size:"icon",class:"filter-clear",onclick:Zn,title:"Clear filter",children:(Ge,qe)=>{vs(Ge,{size:13})},$$slots:{default:!0}})};R(be,ze=>{i(Pt)&&ze(At)})}var Ot=D(be,2);{let ze=x(()=>Z.sortMode==="recent"?"active":""),Ge=x(()=>Z.sortMode==="alpha"?"Sort by recent":"Sort alphabetically");Qe(Ot,{variant:"ghost",size:"icon",get class(){return`sort-toggle ${i(ze)??""}`},get title(){return i(Ge)},onclick:()=>{Z.sortMode=Z.sortMode==="alpha"?"recent":"alpha"},children:(qe,je)=>{var ae=I(),ie=S(ae);{var ne=re=>{pp(re,{size:14})},Ne=re=>{dp(re,{size:14})};R(ie,re=>{Z.sortMode==="alpha"?re(ne):re(Ne,!1)})}g(qe,ae)},$$slots:{default:!0}})}k(z);var dn=D(z,2),Rt=P(dn);{var nn=ze=>{var Ge=dv(),qe=S(Ge);xt(qe,17,()=>Z.recentEntities,ie=>`${ie.repo}/${ie.entityType}/${ie.id}`,(ie,ne)=>{const Ne=x(()=>i(ne).id===i(nt)&&i(ne).repo===i(ht)&&!i(jt)),re=x(()=>`entity:${i(ne).repo}/${i(ne).entityType}/${i(ne).id}`);var oe=cv(),Pe=P(oe);{let Ie=x(()=>i(Ne)?"selected":""),Le=x(()=>i(Nn)===i(re)?"focused":""),Ze=x(()=>`padding-left: 27px${i(Ne)?`; --active-color: ${dr(i(ne).entityType)}`:""}`);Qe(Pe,{variant:"ghost",get class(){return`tree-row ${i(Ie)??""} ${i(Le)??""}`},get"data-tree-key"(){return i(re)},get style(){return i(Ze)},onclick:()=>Xs(i(ne),i(ne).repo),children:(yt,Ct)=>{var pt=ov(),we=S(pt);let xe;var De=D(we,2),rt=P(De);{var gt=Ae=>{var Be=I(),vt=S(Be);xt(vt,17,()=>Eo(i(ne).title),Ft,(st,it)=>{var Xe=I(),Mt=S(Xe);{var dt=He=>{var lt=sv(),wt=P(lt,!0);k(lt),K(()=>J(wt,i(it).text)),g(He,lt)},It=He=>{var lt=Jt();K(()=>J(lt,i(it).text)),g(He,lt)};R(Mt,He=>{i(it).match?He(dt):He(It,!1)})}g(st,Xe)}),g(Ae,Be)},Ee=Ae=>{var Be=Jt();K(()=>J(Be,i(ne).title)),g(Ae,Be)};R(rt,Ae=>{i(Pt)?Ae(gt):Ae(Ee,!1)})}k(De);var zt=D(De,2);{var sn=Ae=>{var Be=iv(),vt=P(Be,!0);k(Be),K(st=>J(vt,st),[()=>Wl(i(ne).updatedAt)]),g(Ae,Be)};R(zt,Ae=>{i(ne).updatedAt&&Ae(sn)})}K(Ae=>xe=Wn(we,"",xe,Ae),[()=>({background:dr(i(ne).entityType)})]),g(yt,pt)},$$slots:{default:!0}})}var Ce=D(Pe,2);q(Ce,()=>ns,(Ie,Le)=>{Le(Ie,{onOpenChange:Ze=>{m(o,Ze?i(re):null,!0)},children:(Ze,yt)=>{var Ct=lv(),pt=S(Ct);{let xe=x(()=>i(o)===i(re)?"menu-open":"");q(pt,()=>rs,(De,rt)=>{rt(De,{get class(){return`entity-actions-btn ${i(xe)??""}`},onclick:gt=>gt.stopPropagation(),children:(gt,Ee)=>{Qr(gt,{size:12})},$$slots:{default:!0}})})}var we=D(pt,2);q(we,()=>ss,(xe,De)=>{De(xe,{children:(rt,gt)=>{var Ee=I(),zt=S(Ee);q(zt,()=>is,(sn,Ae)=>{Ae(sn,{class:"repo-actions-menu",sideOffset:12,align:"start",children:(Be,vt)=>{var st=I(),it=S(st);q(it,()=>Xn,(Xe,Mt)=>{Mt(Xe,{class:"repo-menu-item repo-menu-item-danger",onSelect:dt=>y(i(ne).repo,i(ne),dt),children:(dt,It)=>{var He=av(),lt=S(He);Dr(lt,{size:12}),le(),g(dt,He)},$$slots:{default:!0}})}),g(Be,st)},$$slots:{default:!0}})}),g(rt,Ee)},$$slots:{default:!0}})}),g(Ze,Ct)},$$slots:{default:!0}})}),k(oe),ln("mouseenter",oe,()=>{Re.hoveredEntityId=i(ne).id}),ln("mouseleave",oe,()=>{Re.hoveredEntityId=null}),g(ie,oe)});var je=D(qe,2);{var ae=ie=>{var ne=uv();g(ie,ne)};R(je,ie=>{i(Pt)&&Z.recentEntities.length===0&&ie(ae)})}g(ze,Ge)},rn=ze=>{var Ge=hv(),qe=S(Ge);xt(qe,17,()=>Z.sortedRepos,Ft,(ie,ne)=>{s(ie,()=>i(ne))});var je=D(qe,2);{var ae=ie=>{var ne=fv();g(ie,ne)};R(je,ie=>{i(Pt)&&Z.sortedRepos.length===0&&ie(ae)})}g(ze,Ge)};R(Rt,ze=>{Z.sortMode==="recent"?ze(nn):ze(rn,!1)})}var Ye=D(Rt,2);{var ut=ze=>{var Ge=pv(),qe=P(Ge);ds(qe,{class:"new-collection-input",type:"text",placeholder:"collection-name",onkeydown:Xt,onblur:()=>{!i(Me).trim()&&!i(ct)&&m(ge,!1)},get disabled(){return i(St)},get ref(){return i(Ke)},set ref(oe){m(Ke,oe,!0)},get value(){return i(Me)},set value(oe){m(Me,oe,!0)}});var je=D(qe,2);{var ae=oe=>{Qe(oe,{variant:"ghost",size:"icon",class:"new-collection-clear",title:"Clear",onclick:()=>{m(Me,""),m(ct,!1),m(ge,!1)},onmousedown:Pe=>Pe.preventDefault(),children:(Pe,Ce)=>{vs(Pe,{size:13})},$$slots:{default:!0}})},ie=x(()=>i(Me).trim());R(je,oe=>{i(ie)&&oe(ae)})}var ne=D(je,2);{var Ne=oe=>{{let Pe=x(()=>i(ct)?"active":""),Ce=x(()=>i(ct)?"Private (local-only)":"Make private");Qe(oe,{variant:"ghost",size:"icon",get class(){return`private-toggle ${i(Pe)??""}`},get title(){return i(Ce)},onclick:()=>{m(ct,!i(ct))},onmousedown:Ie=>Ie.preventDefault(),children:(Ie,Le)=>{var Ze=I(),yt=S(Ze);{var Ct=we=>{ni(we,{size:13})},pt=we=>{iu(we,{size:13})};R(yt,we=>{i(ct)?we(Ct):we(pt,!1)})}g(Ie,Ze)},$$slots:{default:!0}})}},re=oe=>{ni(oe,{size:13,class:"private-indicator"})};R(ne,oe=>{i(te)?oe(Ne):oe(re,!1)})}k(Ge),g(ze,Ge)};R(Ye,ze=>{i(ge)&&ze(ut)})}var Ut=D(Ye,2);Qe(Ut,{variant:"ghost",class:"repo-row new-collection-btn",onclick:()=>{m(ge,!0),i(te)||m(ct,!0),setTimeout(()=>i(Ke)?.focus(),0)},title:"New collection",children:(ze,Ge)=>{var qe=gv(),je=S(qe),ae=P(je);Xo(ae,{size:14}),k(je),le(2),g(ze,qe)},$$slots:{default:!0}}),k(dn),Ds(dn,ze=>m(Nt,ze),()=>i(Nt)),ln("scroll",dn,_r),g(b,_)};R(Do,b=>{Re.activeView==="settings"?b(Zl):b(Yl,!1)})}var Gl=D(Do,2);{var Xl=b=>{var _=mv(),z=P(_),W=P(z,!0);k(z);var ke=D(z,2);Qe(ke,{variant:"ghost",size:"icon",class:"footer-icon-btn",title:"Sign out",onclick:()=>{m(l,!0)},children:(me,be)=>{Xc(me,{size:14})},$$slots:{default:!0}}),k(_),K(()=>J(W,Dt.user.email)),g(b,_)};R(Gl,b=>{Dt.authEnabled&&Dt.user&&b(Xl)})}k(Qs);var Fo=D(Qs,2);{let b=x(()=>i(En)!==null),_=x(()=>i(En)??""),z=x(()=>Z.apps.flatMap(W=>W.entityTypes));cg(Fo,{get open(){return i(b)},get collection(){return i(_)},get appEntityTypes(){return i(z)},onselect:W=>{i(En)&&Vl(i(En),W)},oncancel:()=>{m(En,null)}})}var $o=D(Fo,2);{let b=x(()=>i(d)!==null),_=x(()=>`Delete "${i(d)}" and all its entities? This cannot be undone.`);os($o,{get open(){return i(b)},title:"Delete Collection",get message(){return i(_)},confirmLabel:"Delete",destructive:!0,onconfirm:f,oncancel:()=>{m(d,null)}})}var No=D($o,2);{let b=x(()=>i(v)!==null),_=x(()=>`Delete "${i(v)?.title}"? This cannot be undone.`);os(No,{get open(){return i(b)},title:"Delete Entity",get message(){return i(_)},confirmLabel:"Delete",destructive:!0,onconfirm:C,oncancel:()=>{m(v,null)}})}var Lo=D(No,2);{let b=x(()=>i(O)!==null),_=x(()=>i(O)?.label),z=x(()=>`Delete all ${i(O)?.count} ${i(O)?.label?.toLowerCase()} in this collection? This cannot be undone.`);os(Lo,{get open(){return i(b)},get title(){return`Delete All ${i(_)??""}`},get message(){return i(z)},confirmLabel:"Delete All",destructive:!0,onconfirm:A,oncancel:()=>{m(O,null)}})}var Bo=D(Lo,2);os(Bo,{get open(){return i(l)},title:"Sign Out",message:"Are you sure you want to sign out?",confirmLabel:"Sign Out",destructive:!0,onconfirm:async()=>{m(l,!1),await Dt.logout(),window.location.href="/login"},oncancel:()=>{m(l,!1)}});var Ql=D(Bo,2);{let b=x(()=>!!i(G));q(Ql,()=>mo,(_,z)=>{z(_,{get open(){return i(b)},onOpenChange:W=>{W||(m(G,null),m(j,[],!0))},children:(W,ke)=>{var me=I(),be=S(me);q(be,()=>bo,(At,Ot)=>{Ot(At,{class:"import-modal",children:(dn,Rt)=>{var nn=kv(),rn=S(nn);q(rn,()=>Cl,(ae,ie)=>{ie(ae,{children:(ne,Ne)=>{var re=bv(),oe=S(re);q(oe,()=>Tl,(Ce,Ie)=>{Ie(Ce,{children:(Le,Ze)=>{le();var yt=Jt();K(()=>J(yt,`Import files into ${i(G)??""}`)),g(Le,yt)},$$slots:{default:!0}})});var Pe=D(oe,2);q(Pe,()=>Jp,(Ce,Ie)=>{Ie(Ce,{children:(Le,Ze)=>{le();var yt=Jt("Supports .md, .txt, and .csv files.");g(Le,yt)},$$slots:{default:!0}})}),g(ne,re)},$$slots:{default:!0}})});var Ye=D(rn,2),ut=P(Ye),Ut=P(ut);{var ze=ae=>{var ie=yv(),ne=S(ie);Jo(ne,{size:24,style:"opacity: 0.4"});var Ne=D(ne,2),re=D(P(Ne));k(Ne),fr("click",re,()=>document.getElementById("import-file-input")?.click()),g(ae,ie)},Ge=ae=>{var ie=xv(),ne=S(ie);xt(ne,21,()=>i(j),Ft,(Ne,re,oe)=>{var Pe=wv(),Ce=P(Pe),Ie=P(Ce,!0);k(Ce);var Le=D(Ce,2);k(Pe),K(()=>J(Ie,i(re).filename)),fr("click",Le,()=>{m(j,i(j).filter((Ze,yt)=>yt!==oe),!0)}),g(Ne,Pe)}),k(ne),le(2),g(ae,ie)};R(Ut,ae=>{i(j).length===0?ae(ze):ae(Ge,!1)})}k(ut);var qe=D(ut,2);k(Ye);var je=D(Ye,2);q(je,()=>rg,(ae,ie)=>{ie(ae,{children:(ne,Ne)=>{var re=_v(),oe=S(re);Qe(oe,{variant:"ghost",onclick:()=>{m(G,null),m(j,[],!0)},children:(Ce,Ie)=>{le();var Le=Jt("Cancel");g(Ce,Le)},$$slots:{default:!0}});var Pe=D(oe,2);{let Ce=x(()=>i(j).length===0||i(Y));Qe(Pe,{get disabled(){return i(Ce)},onclick:()=>i(G)&&kt(i(G),i(j)),children:(Ie,Le)=>{le();var Ze=Jt();K(()=>J(Ze,i(Y)?"Importing...":`Import ${i(j).length} file${i(j).length!==1?"s":""}`)),g(Ie,Ze)},$$slots:{default:!0}})}g(ne,re)},$$slots:{default:!0}})}),ln("dragover",ut,ae=>{ae.preventDefault(),ae.dataTransfer&&(ae.dataTransfer.dropEffect="copy")}),ln("drop",ut,X),fr("change",qe,ve),g(dn,nn)},$$slots:{default:!0}})}),g(W,me)},$$slots:{default:!0}})})}g(n,Ro),L()}Ta(["dblclick","click","change"]);var Av=fe("<title> </title>"),Cv=fe('<svg><!><path d="M16 4 6 14 7.41 15.41 15 7.83 15 28 17 28 17 7.83 24.59 15.41 26 14 16 4z"></path></svg>');function El(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Cv();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Av(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var Tv=fe("<title> </title>"),Ev=fe('<svg><!><path d="M24,6H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z"></path></svg>');function Ov(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Ev();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Tv(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var Rv=fe("<title> </title>"),zv=fe('<svg><!><path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"></path><path d="M20.59 22 15 16.41 15 7 17 7 17 15.58 22 20.59 20.59 22z"></path></svg>');function Mv(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=zv();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Rv(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(2),k(l),g(n,l),L()}function yo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ar=yo();function Ol(n){ar=n}var er={exec:()=>null};function Fe(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Zt.caret,"$1"),t=t.replace(r,o),s},getRegex:()=>new RegExp(t,e)};return s}var Iv=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Zt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},Dv=/^(?:[ \t]*(?:\n|$))+/,Fv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$v=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ur=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Nv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Rl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zl=Fe(Rl).replace(/bull/g,wo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Lv=Fe(Rl).replace(/bull/g,wo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Bv=/^[^\n]+/,_o=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Hv=Fe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",_o).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vv=Fe(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wo).getRegex(),Ks="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ko=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Wv=Fe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ko).replace("tag",Ks).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ml=Fe(xo).replace("hr",Ur).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ks).getRegex(),Kv=Fe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ml).getRegex(),So={blockquote:Kv,code:Fv,def:Hv,fences:$v,heading:Nv,hr:Ur,html:Wv,lheading:zl,list:Vv,newline:Dv,paragraph:Ml,table:er,text:Bv},xa=Fe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ur).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ks).getRegex(),jv={...So,lheading:Lv,table:xa,paragraph:Fe(xo).replace("hr",Ur).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xa).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ks).getRegex()},Uv={...So,html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ko).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:er,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Fe(xo).replace("hr",Ur).replace("heading",` *#{1,6} *[^
|
|
29
|
+
]`).replace("lheading",zl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Il=/^( {2,}|\\)\n(?!\s*$)/,Yv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,js=/[\p{P}\p{S}]/u,Po=/[\s\p{P}\p{S}]/u,Dl=/[^\s\p{P}\p{S}]/u,Gv=Fe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Po).getRegex(),Fl=/(?!~)[\p{P}\p{S}]/u,Xv=/(?!~)[\s\p{P}\p{S}]/u,Qv=/(?:[^\s\p{P}\p{S}]|~)/u,$l=/(?![*_])[\p{P}\p{S}]/u,Jv=/(?![*_])[\s\p{P}\p{S}]/u,em=/(?:[^\s\p{P}\p{S}]|[*_])/u,tm=Fe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Iv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Nl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,nm=Fe(Nl,"u").replace(/punct/g,js).getRegex(),rm=Fe(Nl,"u").replace(/punct/g,Fl).getRegex(),Ll="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",sm=Fe(Ll,"gu").replace(/notPunctSpace/g,Dl).replace(/punctSpace/g,Po).replace(/punct/g,js).getRegex(),im=Fe(Ll,"gu").replace(/notPunctSpace/g,Qv).replace(/punctSpace/g,Xv).replace(/punct/g,Fl).getRegex(),om=Fe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Dl).replace(/punctSpace/g,Po).replace(/punct/g,js).getRegex(),am=Fe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,$l).getRegex(),lm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",cm=Fe(lm,"gu").replace(/notPunctSpace/g,em).replace(/punctSpace/g,Jv).replace(/punct/g,$l).getRegex(),um=Fe(/\\(punct)/,"gu").replace(/punct/g,js).getRegex(),dm=Fe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fm=Fe(ko).replace("(?:-->|$)","-->").getRegex(),hm=Fe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Os=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,pm=Fe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Os).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Bl=Fe(/^!?\[(label)\]\[(ref)\]/).replace("label",Os).replace("ref",_o).getRegex(),Hl=Fe(/^!?\[(ref)\](?:\[\])?/).replace("ref",_o).getRegex(),gm=Fe("reflink|nolink(?!\\()","g").replace("reflink",Bl).replace("nolink",Hl).getRegex(),_a=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ao={_backpedal:er,anyPunctuation:um,autolink:dm,blockSkip:tm,br:Il,code:Zv,del:er,delLDelim:er,delRDelim:er,emStrongLDelim:nm,emStrongRDelimAst:sm,emStrongRDelimUnd:om,escape:qv,link:pm,nolink:Hl,punctuation:Gv,reflink:Bl,reflinkSearch:gm,tag:hm,text:Yv,url:er},vm={...Ao,link:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",Os).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Os).getRegex()},bi={...Ao,emStrongRDelimAst:im,emStrongLDelim:rm,delLDelim:am,delRDelim:cm,url:Fe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_a).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Fe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",_a).getRegex()},mm={...bi,br:Fe(Il).replace("{2,}","*").getRegex(),text:Fe(bi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},as={normal:So,gfm:jv,pedantic:Uv},Mr={normal:Ao,gfm:bi,breaks:mm,pedantic:vm},bm={"&":"&","<":"<",">":">",'"':""","'":"'"},ka=n=>bm[n];function _n(n,e){if(e){if(Zt.escapeTest.test(n))return n.replace(Zt.escapeReplace,ka)}else if(Zt.escapeTestNoEncode.test(n))return n.replace(Zt.escapeReplaceNoEncode,ka);return n}function Sa(n){try{n=encodeURI(n).replace(Zt.percentDecode,"%")}catch{return null}return n}function Pa(n,e){let t=n.replace(Zt.findPipe,(a,o,c)=>{let l=!1,d=o;for(;--d>=0&&c[d]==="\\";)l=!l;return l?"|":" |"}),s=t.split(Zt.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Zt.slashPipe,"|");return s}function Ir(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function ym(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function wm(n,e=0){let t=e,s="";for(let r of n)if(r===" "){let a=4-t%4;s+=" ".repeat(a),t+=a}else s+=r,t++;return s}function Aa(n,e,t,s,r){let a=e.href,o=e.title||null,c=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:a,title:o,text:c,tokens:s.inlineTokens(c)};return s.state.inLink=!1,l}function xm(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
30
30
|
`).map(a=>{let o=a.match(t.other.beginningSpace);if(o===null)return a;let[c]=o;return c.length>=r.length?a.slice(r.length):a}).join(`
|
|
31
|
-
`)}var
|
|
31
|
+
`)}var Rs=class{options;rules;lexer;constructor(n){this.options=n||ar}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Ir(t,`
|
|
32
32
|
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=xm(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=Ir(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Ir(e[0],`
|
|
33
33
|
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Ir(e[0],`
|
|
34
34
|
`).split(`
|
|
@@ -44,13 +44,13 @@ ${h}`:h;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
44
44
|
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),s=t.length>1,r={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let a=this.rules.other.listItemRegex(t),o=!1;for(;n;){let l=!1,d="",h="";if(!(e=a.exec(n))||this.rules.block.hr.test(n))break;d=e[0],n=n.substring(d.length);let f=wm(e[2].split(`
|
|
45
45
|
`,1)[0],e[1].length),u=n.split(`
|
|
46
46
|
`,1)[0],p=!f.trim(),v=0;if(this.options.pedantic?(v=2,h=f.trimStart()):p?v=e[1].length+1:(v=f.search(this.rules.other.nonSpaceChar),v=v>4?1:v,h=f.slice(v),v+=e[1].length),p&&this.rules.other.blankLine.test(u)&&(d+=u+`
|
|
47
|
-
`,n=n.substring(u.length+1),l=!0),!l){let y=this.rules.other.nextBulletRegex(v),C=this.rules.other.hrRegex(v),
|
|
48
|
-
`,1)[0],V;if(u=
|
|
49
|
-
`+V.slice(v);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||
|
|
50
|
-
`+u}p=!u.trim(),d+=
|
|
51
|
-
`,n=n.substring(
|
|
52
|
-
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<t.length;o++)a.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:a.align[o]});for(let o of r)a.rows.push(
|
|
53
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let a=Ir(t.slice(0,-1),"\\");if((t.length-a.length)%2===0)return}else{let a=ym(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),
|
|
47
|
+
`,n=n.substring(u.length+1),l=!0),!l){let y=this.rules.other.nextBulletRegex(v),C=this.rules.other.hrRegex(v),O=this.rules.other.fencesBeginRegex(v),T=this.rules.other.headingBeginRegex(v),F=this.rules.other.htmlBeginRegex(v),A=this.rules.other.blockquoteBeginRegex(v);for(;n;){let B=n.split(`
|
|
48
|
+
`,1)[0],V;if(u=B,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),V=u):V=u.replace(this.rules.other.tabCharGlobal," "),O.test(u)||T.test(u)||F.test(u)||A.test(u)||y.test(u)||C.test(u))break;if(V.search(this.rules.other.nonSpaceChar)>=v||!u.trim())h+=`
|
|
49
|
+
`+V.slice(v);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||O.test(f)||T.test(f)||C.test(f))break;h+=`
|
|
50
|
+
`+u}p=!u.trim(),d+=B+`
|
|
51
|
+
`,n=n.substring(B.length+1),f=V.slice(v)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),r.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),r.raw+=d}let c=r.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(l.raw);if(d){let h={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};l.checked=h.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=h.raw+l.tokens[0].raw,l.tokens[0].text=h.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(h)):l.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):l.tokens.unshift(h)}}if(!r.loose){let d=l.tokens.filter(f=>f.type==="space"),h=d.length>0&&d.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=h}}if(r.loose)for(let l of r.items){l.loose=!0;for(let d of l.tokens)d.type==="text"&&(d.type="paragraph")}return r}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:r}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Pa(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
52
|
+
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<t.length;o++)a.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:a.align[o]});for(let o of r)a.rows.push(Pa(o,a.header.length).map((c,l)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[l]})));return a}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
53
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let a=Ir(t.slice(0,-1),"\\");if((t.length-a.length)%2===0)return}else{let a=ym(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),Aa(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let a=t[0].charAt(0);return{type:"text",raw:a,text:a}}return Aa(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,a,o,c=r,l=0,d=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+r);(s=d.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(o=[...a].length,s[3]||s[4]){c+=o;continue}else if((s[5]||s[6])&&r%3&&!((r+o)%3)){l+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+l);let h=[...s[0]][0].length,f=n.slice(0,r+s.index+h+o);if(Math.min(r,o)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,a,o,c=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*n.length+r);(s=l.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a||(o=[...a].length,o!==r))continue;if(s[3]||s[4]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let d=[...s[0]][0].length,h=n.slice(0,r+s.index+d+o),f=h.slice(r,-r);return{type:"del",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},vn=class yi{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ar,this.options.tokenizer=this.options.tokenizer||new Rs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Zt,block:as.normal,inline:Mr.normal};this.options.pedantic?(t.block=as.pedantic,t.inline=Mr.pedantic):this.options.gfm&&(t.block=as.gfm,this.options.breaks?t.inline=Mr.breaks:t.inline=Mr.gfm),this.tokenizer.rules=t}static get rules(){return{block:as,inline:Mr}}static lex(e,t){return new yi(t).lex(e)}static lexInline(e,t){return new yi(t).inlineTokens(e)}lex(e){e=e.replace(Zt.carriageReturn,`
|
|
54
54
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.options.pedantic&&(e=e.replace(Zt.tabCharGlobal," ").replace(Zt.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let o=t.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
|
|
55
55
|
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
56
56
|
`)?"":`
|
|
@@ -64,7 +64,7 @@ ${h}`:h;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
64
64
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(r),s=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
65
65
|
`)?"":`
|
|
66
66
|
`)+r.raw,o.text+=`
|
|
67
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)a=r[2]?r[2].length:0,s=s.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let o=!1,c="";for(;e;){o||(c=""),o=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let h=t.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,c)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,s,c)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let d=e;if(this.options.extensions?.startInline){let h=1/0,f=e.slice(1),u;this.options.extensions.startInline.forEach(p=>{u=p.call({lexer:this},f),typeof u=="number"&&u>=0&&(h=Math.min(h,u))}),h<1/0&&h>=0&&(d=e.substring(0,h+1))}if(l=this.tokenizer.inlineText(d)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(c=l.raw.slice(-1)),o=!0;let h=t.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):t.push(l);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},
|
|
67
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)a=r[2]?r[2].length:0,s=s.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let o=!1,c="";for(;e;){o||(c=""),o=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let h=t.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,c)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,s,c)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let d=e;if(this.options.extensions?.startInline){let h=1/0,f=e.slice(1),u;this.options.extensions.startInline.forEach(p=>{u=p.call({lexer:this},f),typeof u=="number"&&u>=0&&(h=Math.min(h,u))}),h<1/0&&h>=0&&(d=e.substring(0,h+1))}if(l=this.tokenizer.inlineText(d)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(c=l.raw.slice(-1)),o=!0;let h=t.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):t.push(l);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},zs=class{options;parser;constructor(n){this.options=n||ar}space(n){return""}code({text:n,lang:e,escaped:t}){let s=(e||"").match(Zt.notSpaceStart)?.[0],r=n.replace(Zt.endingNewline,"")+`
|
|
68
68
|
`;return s?'<pre><code class="language-'+_n(s)+'">'+(t?r:_n(r,!0))+`</code></pre>
|
|
69
69
|
`:"<pre><code>"+(t?r:_n(r,!0))+`</code></pre>
|
|
70
70
|
`}blockquote({tokens:n}){return`<blockquote>
|
|
@@ -82,10 +82,10 @@ ${this.parser.parse(n)}</blockquote>
|
|
|
82
82
|
`}tablerow({text:n}){return`<tr>
|
|
83
83
|
${n}</tr>
|
|
84
84
|
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
85
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${_n(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=Sa(n);if(r===null)return s;n=r;let a='<a href="'+n+'"';return e&&(a+=' title="'+_n(e)+'"'),a+=">"+s+"</a>",a}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=Sa(n);if(r===null)return _n(t);n=r;let a=`<img src="${n}" alt="${_n(t)}"`;return e&&(a+=` title="${_n(e)}"`),a+=">",a}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:_n(n.text)}},Co=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},mn=class wi{options;renderer;textRenderer;constructor(e){this.options=e||ar,this.options.renderer=this.options.renderer||new
|
|
86
|
-
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+_n(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ir=new _m;function Ue(n,e){return ir.parse(n,e)}Ue.options=Ue.setOptions=function(n){return ir.setOptions(n),Ue.defaults=ir.defaults,Ol(Ue.defaults),Ue};Ue.getDefaults=yo;Ue.defaults=ar;Ue.use=function(...n){return ir.use(...n),Ue.defaults=ir.defaults,Ol(Ue.defaults),Ue};Ue.walkTokens=function(n,e){return ir.walkTokens(n,e)};Ue.parseInline=ir.parseInline;Ue.Parser=mn;Ue.parser=mn.parse;Ue.Renderer=
|
|
87
|
-
`);o=d.pop()??"";for(const h of d)if(h.startsWith("data: "))try{const f=JSON.parse(h.slice(6));e(f)}catch{}}}).catch(s=>{s.name!=="AbortError"&&e({type:"error",message:s.message})})}const xi="sg-chat-sessions",_i="sg-chat-version",Sm=14;function Qn(){try{const n=localStorage.getItem(xi);if(!n)return[];if(localStorage.getItem(_i)==="2")return JSON.parse(n);const s=JSON.parse(n).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(a=>a.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(xi,JSON.stringify(s)),localStorage.setItem(_i,"2"),s}catch{return[]}}function
|
|
85
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${_n(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=Sa(n);if(r===null)return s;n=r;let a='<a href="'+n+'"';return e&&(a+=' title="'+_n(e)+'"'),a+=">"+s+"</a>",a}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=Sa(n);if(r===null)return _n(t);n=r;let a=`<img src="${n}" alt="${_n(t)}"`;return e&&(a+=` title="${_n(e)}"`),a+=">",a}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:_n(n.text)}},Co=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},mn=class wi{options;renderer;textRenderer;constructor(e){this.options=e||ar,this.options.renderer=this.options.renderer||new zs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Co}static parse(e,t){return new wi(t).parse(e)}static parseInline(e,t){return new wi(t).parseInline(e)}parse(e){let t="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let o=r,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){t+=c||"";continue}}let a=r;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){let s="";for(let r=0;r<e.length;r++){let a=e[r];if(this.options.extensions?.renderers?.[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=c||"";continue}}let o=a;switch(o.type){case"escape":{s+=t.text(o);break}case"html":{s+=t.html(o);break}case"link":{s+=t.link(o);break}case"image":{s+=t.image(o);break}case"checkbox":{s+=t.checkbox(o);break}case"strong":{s+=t.strong(o);break}case"em":{s+=t.em(o);break}case"codespan":{s+=t.codespan(o);break}case"br":{s+=t.br(o);break}case"del":{s+=t.del(o);break}case"text":{s+=t.text(o);break}default:{let c='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},$r=class{options;block;constructor(n){this.options=n||ar}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?vn.lex:vn.lexInline}provideParser(){return this.block?mn.parse:mn.parseInline}},_m=class{defaults=yo();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=mn;Renderer=zs;TextRenderer=Co;Lexer=vn;Tokenizer=Rs;Hooks=$r;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(let s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let a of r.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of r.rows)for(let o of a)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=s;t=t.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let o=r[a].flat(1/0);t=t.concat(this.walkTokens(o,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=e.renderers[r.name];a?e.renderers[r.name]=function(...o){let c=r.renderer.apply(this,o);return c===!1&&(c=a.apply(this,o)),c}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[r.level];a?a.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new zs(this.defaults);for(let a in t.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,c=t.renderer[o],l=r[o];r[o]=(...d)=>{let h=c.apply(r,d);return h===!1&&(h=l.apply(r,d)),h||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new Rs(this.defaults);for(let a in t.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,c=t.tokenizer[o],l=r[o];r[o]=(...d)=>{let h=c.apply(r,d);return h===!1&&(h=l.apply(r,d)),h}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new $r;for(let a in t.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,c=t.hooks[o],l=r[o];$r.passThroughHooks.has(a)?r[o]=d=>{if(this.defaults.async&&$r.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await c.call(r,d);return l.call(r,f)})();let h=c.call(r,d);return l.call(r,h)}:r[o]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(r,d);return f===!1&&(f=await l.apply(r,d)),f})();let h=c.apply(r,d);return h===!1&&(h=l.apply(r,d)),h}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,a=t.walkTokens;s.walkTokens=function(o){let c=[];return c.push(a.call(this,o)),r&&(c=c.concat(r.call(this,o))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return vn.lex(n,e??this.defaults)}parser(n,e){return mn.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,c=await(r.hooks?await r.hooks.provideLexer():n?vn.lex:vn.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(c):c;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let d=await(r.hooks?await r.hooks.provideParser():n?mn.parse:mn.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(d):d})().catch(a);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer():n?vn.lex:vn.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let c=(r.hooks?r.hooks.provideParser():n?mn.parse:mn.parseInline)(o,r);return r.hooks&&(c=r.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(n,e){return t=>{if(t.message+=`
|
|
86
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+_n(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ir=new _m;function Ue(n,e){return ir.parse(n,e)}Ue.options=Ue.setOptions=function(n){return ir.setOptions(n),Ue.defaults=ir.defaults,Ol(Ue.defaults),Ue};Ue.getDefaults=yo;Ue.defaults=ar;Ue.use=function(...n){return ir.use(...n),Ue.defaults=ir.defaults,Ol(Ue.defaults),Ue};Ue.walkTokens=function(n,e){return ir.walkTokens(n,e)};Ue.parseInline=ir.parseInline;Ue.Parser=mn;Ue.parser=mn.parse;Ue.Renderer=zs;Ue.TextRenderer=Co;Ue.Lexer=vn;Ue.lexer=vn.lex;Ue.Tokenizer=Rs;Ue.Hooks=$r;Ue.parse=Ue;Ue.options;Ue.setOptions;Ue.use;Ue.walkTokens;Ue.parseInline;mn.parse;vn.lex;function km(n,e,t){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:t}).then(async s=>{if(!s.ok){e({type:"error",message:`HTTP ${s.status}`});return}const r=s.body?.getReader();if(!r){e({type:"error",message:"No response body"});return}const a=new TextDecoder;let o="";for(;;){const{done:c,value:l}=await r.read();if(c)break;o+=a.decode(l,{stream:!0});const d=o.split(`
|
|
87
|
+
`);o=d.pop()??"";for(const h of d)if(h.startsWith("data: "))try{const f=JSON.parse(h.slice(6));e(f)}catch{}}}).catch(s=>{s.name!=="AbortError"&&e({type:"error",message:s.message})})}const xi="sg-chat-sessions",_i="sg-chat-version",Sm=14;function Qn(){try{const n=localStorage.getItem(xi);if(!n)return[];if(localStorage.getItem(_i)==="2")return JSON.parse(n);const s=JSON.parse(n).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(a=>a.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(xi,JSON.stringify(s)),localStorage.setItem(_i,"2"),s}catch{return[]}}function hs(n){const t=[...n].sort((s,r)=>r.updatedAt.localeCompare(s.updatedAt)).slice(0,Sm);try{localStorage.setItem(xi,JSON.stringify(t)),localStorage.setItem(_i,"2")}catch{}}function ls(n,e){const t=Qn(),s=e.map(({streaming:a,...o})=>o),r=t.findIndex(a=>a.id===n);r>=0&&(t[r].messages=s,t[r].updatedAt=new Date().toISOString()),hs(t)}function Pm(){const e=Qn().sort((A,B)=>B.updatedAt.localeCompare(A.updatedAt))[0];let t=$(en(e?e.messages.map(A=>({...A,streaming:!1})):[])),s=$(en(e?.id??null)),r=$(!1),a=$(0),o=$(0),c=$(null),l=null,d=$(""),h=$(en(!!e));const f=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function u(){y();const A=crypto.randomUUID();m(s,A,!0),m(t,[],!0),m(h,!1)}function p(){if(i(s)&&i(h))return i(s);const A=i(s)||crypto.randomUUID();m(s,A,!0);const B=new Date().toISOString(),V=Qn();return V.push({id:A,createdAt:B,updatedAt:B,title:"New chat",messages:[]}),hs(V),m(h,!0),A}function v(A){if(!A.trim()||i(r))return;m(c,null);const B=p();i(t).push({role:"user",content:A}),i(t).push({role:"agent",content:"",segments:[],streaming:!0}),m(r,!0);const V=Qn(),Q=V.find(U=>U.id===B);Q&&Q.title==="New chat"&&(Q.title=A.slice(0,50),hs(V)),ls(B,i(t));let he=!1,ee=null;l=new AbortController;const pe=Re.selectedSubPath?`${Re.selectedRepo}/${Re.selectedType}/${Re.selectedId}/${Re.selectedSubPath}`:Re.selectedId?`${Re.selectedRepo}/${Re.selectedType}/${Re.selectedId}`:null,te=i(t).slice(0,-2).map(U=>({role:U.role==="agent"?"assistant":U.role,content:U.content})),ge={message:A,context:pe??void 0,sessionId:B,history:te.length>0?te:void 0};km(ge,U=>{const G=i(t)[i(t).length-1];if(!G||G.role!=="agent")return;const j=G.segments;switch(U.type){case"token":{G.content+=U.text??"";const Y=j[j.length-1];Y&&Y.type==="text"?Y.content+=U.text??"":j.push({type:"text",content:U.text??""}),G.segments=j,tr(o);break}case"tool_start":if(U.name){f.has(U.name)&&(he=!0);const Y=j[j.length-1];Y&&Y.type==="tools"?Y.names=[...Y.names,U.name]:j.push({type:"tools",names:[U.name]}),G.segments=j,tr(o)}break;case"mutation":he=!0,U.action==="created"&&U.repo&&U.entityType&&U.entityId&&(ee={repo:U.repo,entityType:U.entityType,entityId:U.entityId}),window.StudioChrome?.emitMutation?.({action:U.action,repo:U.repo,entityType:U.entityType,entityId:U.entityId});break;case"highlight":m(c,U.entityIds&&U.entityIds.length>0?new Set(U.entityIds):null,!0);break;case"done":U.message&&!G.content&&(G.content=U.message,G.segments=[{type:"text",content:U.message}]),G.streaming=!1,m(r,!1),ls(B,i(t)),he&&(Sc().then(()=>{tr(a)}),Z.refreshAll().then(()=>{ee&&kn(`/${ee.repo}/${ee.entityType}/${ee.entityId}`)}));break;case"error":G.content+=`
|
|
88
88
|
|
|
89
|
-
Error: ${U.message}`,G.streaming=!1,m(r,!1),
|
|
89
|
+
Error: ${U.message}`,G.streaming=!1,m(r,!1),ls(B,i(t));break}},l.signal)}function y(){l?.abort(),m(r,!1);const A=i(t)[i(t).length-1];A?.streaming&&(A.streaming=!1),fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{})}function C(){y(),m(t,[],!0),i(s)&&i(h)&&ls(i(s),i(t))}function O(A){const V=Qn().filter(Q=>Q.id!==A);if(hs(V),i(s)===A){const Q=V.sort((he,ee)=>ee.updatedAt.localeCompare(he.updatedAt));Q.length>0?(m(s,Q[0].id,!0),m(t,Q[0].messages.map(he=>({...he,streaming:!1})),!0),m(h,!0)):(m(s,null),m(t,[],!0),m(h,!1))}}function T(A){const V=Qn().find(Q=>Q.id===A);V&&(y(),m(s,V.id,!0),m(t,V.messages.map(Q=>({...Q,streaming:!1})),!0),m(h,!0))}function F(){return Qn().sort((A,B)=>B.updatedAt.localeCompare(A.updatedAt)).map(A=>({id:A.id,title:A.title,createdAt:A.createdAt,updatedAt:A.updatedAt,preview:A.messages.find(B=>B.role==="user")?.content.slice(0,80)||"",count:A.messages.length,active:A.id===i(s)}))}return{get messages(){return i(t)},get streaming(){return i(r)},get mutationCount(){return i(a)},get scrollTick(){return i(o)},get highlightedIds(){return i(c)},get activeSessionId(){return i(s)},get draftInput(){return i(d)},set draftInput(A){m(d,A,!0)},send:v,stop:y,clear:C,newSession:u,deleteSession:O,getSessions:F,loadSession:T}}const Wt=Pm();var Am=E('<span class="session-title svelte-1xwj6s7"> </span>'),Cm=E('<div class="session-row svelte-1xwj6s7"><!> <!></div>'),Tm=E('<div class="session-dropdown svelte-1xwj6s7"><div class="session-list svelte-1xwj6s7"></div></div>'),Em=E('<div class="empty-state svelte-1xwj6s7"><div class="seed-prompts svelte-1xwj6s7"></div></div>'),Om=E('<div class="user-bubble svelte-1xwj6s7"> </div>'),Rm=E('<span class="tool-call svelte-1xwj6s7"> </span>'),zm=E('<div class="tool-calls svelte-1xwj6s7"></div>'),Mm=E('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),Im=E('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),Dm=E('<span class="streaming-dot svelte-1xwj6s7"></span>'),Fm=E('<div class="agent-content svelte-1xwj6s7"><!> <!></div>'),$m=E('<div class="message-group svelte-1xwj6s7"><!></div>'),Nm=E('<div class="context-chip svelte-1xwj6s7"> </div>'),Lm=E('<aside class="chat-panel svelte-1xwj6s7"><div class="chat-header svelte-1xwj6s7"><div class="chat-header-left svelte-1xwj6s7"><!> <!></div> <!> <!></div> <div class="chat-messages svelte-1xwj6s7"><!></div> <div class="chat-input-area svelte-1xwj6s7"><!> <div class="text-input svelte-1xwj6s7"><textarea class="input-field svelte-1xwj6s7" rows="1"></textarea> <!></div></div></aside>');function Bm(n,e){N(e,!0);const t=/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?/gu,s=/^\|[\s:|-]+\|$/,r=/^[ ]{0,3}([-*_])\s*(\1\s*){2,}$/;function a(X){return X.replace(t,"").replace(/^ +/gm,ve=>ve.replace(/ +/," ")).split(`
|
|
90
90
|
`).map(ve=>s.test(ve)||r.test(ve)?ve:ve.replace(/--/g,"—")).join(`
|
|
91
|
-
`)}const o=Lr("chat");let c=x(()=>Wt.draftInput);function l(X){Wt.draftInput=X}let d=L(!1);const h=x(()=>(Wt.activeSessionId,Wt.getSessions().length>0));let f,u=!0;function p(){f&&(u=f.scrollHeight-f.scrollTop-f.clientHeight<40)}const v=x(()=>{if(ze.selectedSubPath)return["Summarize this document","Extract key points","What actions are here?","What decisions were made?"];if(ze.selectedId){const X=ze.selectedType??"entity";return[`Summarize this ${X}`,`What's related to this ${X}?`,"What actions should I take?","What decisions were made?"]}return ze.activeView==="graph"?["What are the key relationships?","Which entities are most connected?","Find gaps in my graph","What decisions have been made recently?"]:["What's in my graph?","Summarize recent meetings","Who's working on what?","What decisions have been made recently?"]});async function y(){const X=i(c).trim();X&&(l(""),u=!0,Wt.send(X),await us(),E())}function C(X){X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),y())}function E(){f&&(f.scrollTop=f.scrollHeight)}Is(()=>{us().then(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>E())})})}),mt(()=>{Wt.scrollTick,u&&E()});var $=Lm(),z=S($),P=S(z),H=S(P);Ge(H,{variant:"ghost",size:"icon",class:"size-6",onclick:()=>Wt.newSession(),children:(X,ve)=>{Ra(X,{size:14})},$$slots:{default:!0}});var V=D(H,2);{var J=X=>{{let ve=x(()=>i(d)?"history-active":"");Ge(X,{variant:"ghost",size:"icon",get class(){return`size-6 ${i(ve)??""}`},onclick:()=>m(d,!i(d)),children:(Me,ct)=>{Mv(Me,{size:14})},$$slots:{default:!0}})}};O(V,X=>{i(h)&&X(J)})}k(P);var he=D(P,2);Ge(he,{variant:"ghost",size:"icon",class:"size-6",get onclick(){return o.close},children:(X,ve)=>{vs(X,{size:14})},$$slots:{default:!0}});var ee=D(he,2);{var pe=X=>{var ve=Tm(),Me=S(ve);xt(Me,21,()=>Wt.getSessions(),Dt,(ct,Ke)=>{var St=Cm(),hn=S(St);{let ht=x(()=>i(Ke).active?"active":"");Ge(hn,{variant:"ghost",get class(){return`session-item ${i(ht)??""}`},onclick:()=>{Wt.loadSession(i(Ke).id),m(d,!1)},children:(nt,jt)=>{var At=Pm(),pn=S(At,!0);k(At),W(()=>Q(pn,i(Ke).title)),g(nt,At)},$$slots:{default:!0}})}var Xt=D(hn,2);Ge(Xt,{variant:"ghost",size:"icon",class:"session-delete-btn",title:"Delete session",onclick:ht=>{ht.stopPropagation(),Wt.deleteSession(i(Ke).id)},children:(ht,nt)=>{$r(ht,{size:12})},$$slots:{default:!0}}),k(St),g(ct,St)}),k(Me),k(ve),g(X,ve)};O(ee,X=>{i(d)&&X(pe)})}k(z);var te=D(z,2),ge=S(te);{var U=X=>{var ve=Em(),Me=S(ve);xt(Me,21,()=>i(v),Dt,(ct,Ke)=>{Ge(ct,{variant:"outline",class:"seed-prompt",onclick:()=>{u=!0,Wt.send(i(Ke)),us().then(()=>E())},children:(St,hn)=>{de();var Xt=Jt();W(()=>Q(Xt,i(Ke))),g(St,Xt)},$$slots:{default:!0}})}),k(Me),k(ve),g(X,ve)},G=X=>{var ve=I(),Me=A(ve);xt(Me,17,()=>Wt.messages,Dt,(ct,Ke)=>{var St=Fm(),hn=S(St);{var Xt=nt=>{var jt=Om(),At=S(jt,!0);k(jt),W(()=>Q(At,i(Ke).content)),g(nt,jt)},ht=nt=>{var jt=Dm(),At=S(jt);{var pn=bt=>{var We=I(),Nn=A(We);xt(Nn,17,()=>i(Ke).segments,Dt,(Zr,wn)=>{var Yr=I(),Us=A(Yr);{var qs=tn=>{var Nt=Rm();xt(Nt,21,()=>i(wn).names,Dt,(_r,Ys)=>{var kr=zm(),En=S(kr,!0);k(kr),W(()=>Q(En,i(Ys))),g(_r,kr)}),k(Nt),g(tn,Nt)},Zs=tn=>{var Nt=Mm(),_r=S(Nt);Uo(_r,()=>Ue.parse(a(i(wn).content))),k(Nt),g(tn,Nt)};O(Us,tn=>{i(wn).type==="tools"?tn(qs):i(wn).type==="text"&&i(wn).content&&tn(Zs,1)})}g(Zr,Yr)}),g(bt,We)},lr=bt=>{var We=Im(),Nn=S(We);Uo(Nn,()=>Ue.parse(a(i(Ke).content))),k(We),g(bt,We)};O(At,bt=>{i(Ke).segments&&i(Ke).segments.length>0?bt(pn):i(Ke).content&&bt(lr,1)})}var Zn=D(At,2);{var cr=bt=>{var We=$m();g(bt,We)};O(Zn,bt=>{i(Ke).streaming&&bt(cr)})}k(jt),g(nt,jt)};O(hn,nt=>{i(Ke).role==="user"?nt(Xt):nt(ht,!1)})}k(St),g(ct,St)}),g(X,ve)};O(ge,X=>{Wt.messages.length===0?X(U):X(G,!1)})}k(te),$s(te,X=>f=X,()=>f);var j=D(te,2),Y=S(j);{var we=X=>{var ve=Nm(),Me=S(ve);k(ve),W(()=>Q(Me,`${ze.selectedType??""}/${ze.selectedId??""}`)),g(X,ve)};O(Y,X=>{ze.selectedId&&X(we)})}var Se=D(Y,2),Oe=S(Se);wc(Oe);var at=D(Oe,2);{var ft=X=>{Ge(X,{variant:"ghost",size:"icon",class:"size-7 stop-btn send-btn",onclick:()=>Wt.stop(),children:(ve,Me)=>{Ov(ve,{size:16})},$$slots:{default:!0}})},kt=X=>{Ge(X,{variant:"ghost",size:"icon",class:"size-7 send-btn",onclick:y,children:(ve,Me)=>{El(ve,{size:14})},$$slots:{default:!0}})};O(at,X=>{Wt.streaming?X(ft):X(kt,!1)})}k(Se),k(j),k($),W(()=>{ds(Oe,"placeholder",ze.selectedId?"Ask about this entity...":"Ask about your workspace..."),kc(Oe,i(c)),Oe.disabled=Wt.streaming}),ln("scroll",te,p),fr("input",Oe,X=>l(X.target.value)),fr("keydown",Oe,C),g(n,$),N()}Ta(["input","keydown"]);var Hm=ue("<title> </title>"),Vm=ue('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function Wm(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Vm();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Hm(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(3),k(l),g(n,l),N()}var Km=T('<aside class="chat-rail svelte-5o41j5"><!></aside>');function jm(n,e){F(e,!1);const t=Lr("chat");Xe();var s=Km(),r=S(s);Ge(r,{variant:"default",size:"icon",class:"size-8 rounded-[6px]",get onclick(){return t.toggle},children:(a,o)=>{Wm(a,{size:16})},$$slots:{default:!0}}),k(s),g(n,s),N()}var Um=ue("<title> </title>"),qm=ue('<svg><!><path d="M24.59 16.59 17 24.17 17 4 15 4 15 24.17 7.41 16.59 6 18 16 28 26 18 24.59 16.59z"></path></svg>');function Zm(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=qm();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Um(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}var Ym=ue("<title> </title>"),Gm=ue('<svg><!><path d="m22,8v2c2.2061,0,4,1.7944,4,4s-1.7939,4-4,4h-12v-5l-6,6,6,6v-5h12c3.3086,0,6-2.6914,6-6s-2.6914-6-6-6Z"></path></svg>');function Xm(n,e){const t=ce(e,["children","$$slots","$$events","$$legacy"]),s=ce(t,["size","title"]);F(e,!1);const r=le(),a=le();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ae(()=>(B(t),B(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ae(()=>(i(r),B(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),Xe();var l=Gm();ye(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=S(l);{var h=f=>{var u=Ym(),p=S(u,!0);k(u),W(()=>Q(p,c())),g(f,u)};O(d,f=>{c()&&f(h)})}de(),k(l),g(n,l),N()}function Qm(n){const e=new URLSearchParams;return n.q&&e.set("q",n.q),n.type&&e.set("type",n.type),n.tags&&e.set("tags",n.tags),n.repos&&e.set("repos",n.repos),Kt(`/api/search?${e.toString()}`)}var Jm=T('<div class="empty-results svelte-1xems06">No results found</div>'),e0=T('<div class="result-body svelte-1xems06"><div class="result-title-row svelte-1xems06"><span class="result-title svelte-1xems06"> </span> <span class="entity-tag svelte-1xems06"> </span></div> <div class="result-meta svelte-1xems06"><span class="result-path"> </span></div></div>'),t0=T('<div class="search-header svelte-1xems06"><!> <!> <kbd class="esc-badge svelte-1xems06">esc</kbd></div> <div class="results-list svelte-1xems06"><!> <!></div> <div class="search-footer svelte-1xems06"><div class="shortcut-group svelte-1xems06"><kbd class="shortcut-key svelte-1xems06"><!></kbd> <kbd class="shortcut-key svelte-1xems06"><!></kbd> <span class="shortcut-label svelte-1xems06">Navigate</span></div> <div class="shortcut-group svelte-1xems06"><kbd class="shortcut-key svelte-1xems06"><!></kbd> <span class="shortcut-label svelte-1xems06">Open</span></div></div>',1);function n0(n,e){F(e,!0);let t=w(e,"open",15),s=L(""),r=L(en([])),a=L(0),o=null;function c(u){const p=u.target;if(m(s,p.value,!0),m(a,0),o&&clearTimeout(o),!i(s).trim()){m(r,[],!0);return}o=setTimeout(async()=>{try{m(r,await Qm({q:i(s)}),!0)}catch{m(r,[],!0)}},200)}function l(u){if(u.key==="Escape")e.onclose();else if(u.key==="ArrowDown")u.preventDefault(),m(a,Math.min(i(a)+1,i(r).length-1),!0);else if(u.key==="ArrowUp")u.preventDefault(),m(a,Math.max(i(a)-1,0),!0);else if(u.key==="Enter"){u.preventDefault();const p=i(r)[i(a)];p&&d(p)}}function d(u){const p=u.repoName??"";p&&kn(`/${p}/${u.entityType}/${u.id}`),e.onclose()}var h=I();ln("keydown",Oa,u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),t()&&e.onclose())});var f=A(h);q(f,()=>mo,(u,p)=>{p(u,{onOpenChange:v=>{v||e.onclose()},get open(){return t()},set open(v){t(v)},children:(v,y)=>{var C=I(),E=A(C);q(E,()=>bo,($,z)=>{z($,{size:"lg",children:(P,H)=>{var V=t0(),J=A(V),he=S(J);za(he,{size:16});var ee=D(he,2);fs(ee,{type:"text",class:"search-input",placeholder:"Search entities...",get value(){return i(s)},oninput:c,onkeydown:l,autofocus:!0}),de(2),k(J);var pe=D(J,2),te=S(pe);{var ge=ve=>{var Me=Jm();g(ve,Me)},U=x(()=>i(r).length===0&&i(s).trim());O(te,ve=>{i(U)&&ve(ge)})}var G=D(te,2);xt(G,17,()=>i(r),Dt,(ve,Me,ct)=>{{let Ke=x(()=>ct===i(a)?"selected":"");Ge(ve,{variant:"ghost",get class(){return`result-row ${i(Ke)??""}`},onclick:()=>d(i(Me)),children:(St,hn)=>{var Xt=e0(),ht=S(Xt),nt=S(ht),jt=S(nt,!0);k(nt);var At=D(nt,2),pn=S(At,!0);k(At),k(ht);var lr=D(ht,2),Zn=S(lr),cr=S(Zn,!0);k(Zn),k(lr),k(Xt),W(()=>{Q(jt,i(Me).data?.name??i(Me).data?.title??i(Me).id),Q(pn,i(Me).entityType),Q(cr,i(Me).id)}),g(St,Xt)},$$slots:{default:!0}})}}),k(pe);var j=D(pe,2),Y=S(j),we=S(Y),Se=S(we);El(Se,{size:10}),k(we);var Oe=D(we,2),at=S(Oe);Zm(at,{size:10}),k(Oe),de(2),k(Y);var ft=D(Y,2),kt=S(ft),X=S(kt);Xm(X,{size:10}),k(kt),de(2),k(ft),k(j),g(P,V)},$$slots:{default:!0}})}),g(v,C)},$$slots:{default:!0}})}),g(n,h),N()}function r0(){let n=L(en({}));function e(r){r.action==="join"?i(n)[r.user.id]=r.user:delete i(n)[r.user.id]}function t(){m(n,{},!0)}const s=x(()=>Object.values(i(n)));return{handleOnlineEvent:e,reset:t,get allOnline(){return i(s)}}}const Ms=r0();Qt.setOnlineHandler(n=>Ms.handleOnlineEvent(n));Qt.addConnectHandler(()=>Ms.reset());var s0=T('<div id="sg-chrome-footer"></div>'),i0=T('<div class="app-frame svelte-vr1z90"><div class="app-body svelte-vr1z90"><!> <main class="main-content svelte-vr1z90"><!></main> <!></div> <!></div> <!>',1);function I0(n,e){F(e,!0);const t=Lr("chat");let s=w(e,"showSidebar",3,!0),r=w(e,"showStatusBar",3,!0),a=L(!1);Is(()=>{const z=window.StudioChrome;z&&z.mountFooter()}),mt(()=>{const z=$t.user?String($t.user.id):void 0,P=z?Ms.allOnline.filter(V=>V.id!==z):Ms.allOnline,H=window.StudioChrome;H?.setCollaborators&&H.setCollaborators(P)});var o=i0();ln("keydown",Oa,z=>{(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),m(a,!i(a)))});var c=A(o),l=S(c),d=S(l);{var h=z=>{Av(z,{})};O(d,z=>{s()&&z(h)})}var f=D(d,2),u=S(f);se(u,()=>e.children),k(f);var p=D(f,2);{var v=z=>{Bm(z,{})},y=z=>{jm(z,{})};O(p,z=>{t.open?z(v):z(y,!1)})}k(l);var C=D(l,2);{var E=z=>{var P=s0();g(z,P)};O(C,z=>{r()&&z(E)})}k(c);var $=D(c,2);n0($,{get open(){return i(a)},onclose:()=>{m(a,!1)}}),g(n,o),N()}export{ed as $,I0 as A,Tt as B,Wm as C,Rn as D,jr as E,Ei as F,Ua as G,Gt as H,Xn as I,Ve as J,tt as K,Pi as L,g0 as M,Mn as N,Zd as O,is as P,cl as Q,rs as R,w0 as S,ss as T,ll as U,Xd as V,ms as W,Br as X,nd as Y,td as Z,Wa as _,os as a,Va as a0,v0 as a1,m0 as a2,b0 as a3,y0 as a4,br as a5,ya as a6,ta as a7,Xu as a8,Lh as a9,Nh as aa,Rh as ab,Mh as ac,Qr as ad,Ni as ae,k0 as af,S0 as ag,bo as ah,Cl as ai,Tl as aj,tg as ak,rg as al,Tc as am,mo as an,E0 as ao,Qo as ap,Np as aq,Ra as ar,T0 as as,O0 as at,A0 as au,P0 as av,M0 as aw,C0 as ax,z0 as ay,R0 as az,$r as b,Xr as c,Xo as d,vs as e,Wt as f,Up as g,Wp as h,Fp as i,qp as j,Hp as k,Lp as l,$p as m,_0 as n,dr as o,pr as p,Fn as q,x0 as r,Da as s,Ft as t,hi as u,M as v,jn as w,Ti as x,yr as y,Ci as z};
|
|
91
|
+
`)}const o=ps("chat");let c=x(()=>Wt.draftInput);function l(X){Wt.draftInput=X}let d=$(!1);const h=x(()=>(Wt.activeSessionId,Wt.getSessions().length>0));let f,u=!0;function p(){f&&(u=f.scrollHeight-f.scrollTop-f.clientHeight<40)}const v=x(()=>{if(Re.selectedSubPath)return["Summarize this document","Extract key points","What actions are here?","What decisions were made?"];if(Re.selectedId){const X=Re.selectedType??"entity";return[`Summarize this ${X}`,`What's related to this ${X}?`,"What actions should I take?","What decisions were made?"]}return Re.activeView==="graph"?["What are the key relationships?","Which entities are most connected?","Find gaps in my graph","What decisions have been made recently?"]:["What's in my graph?","Summarize recent meetings","Who's working on what?","What decisions have been made recently?"]});async function y(){const X=i(c).trim();X&&(l(""),u=!0,Wt.send(X),await cs(),O())}function C(X){X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),y())}function O(){f&&(f.scrollTop=f.scrollHeight)}Is(()=>{cs().then(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>O())})})}),mt(()=>{Wt.scrollTick,u&&O()});var T=Lm(),F=P(T),A=P(F),B=P(A);Qe(B,{variant:"ghost",size:"icon",class:"size-6",onclick:()=>Wt.newSession(),children:(X,ve)=>{za(X,{size:14})},$$slots:{default:!0}});var V=D(B,2);{var Q=X=>{{let ve=x(()=>i(d)?"history-active":"");Qe(X,{variant:"ghost",size:"icon",get class(){return`size-6 ${i(ve)??""}`},onclick:()=>m(d,!i(d)),children:(Me,ct)=>{Mv(Me,{size:14})},$$slots:{default:!0}})}};R(V,X=>{i(h)&&X(Q)})}k(A);var he=D(A,2);Qe(he,{variant:"ghost",size:"icon",class:"size-6",get onclick(){return o.close},children:(X,ve)=>{vs(X,{size:14})},$$slots:{default:!0}});var ee=D(he,2);{var pe=X=>{var ve=Tm(),Me=P(ve);xt(Me,21,()=>Wt.getSessions(),Ft,(ct,Ke)=>{var St=Cm(),hn=P(St);{let ht=x(()=>i(Ke).active?"active":"");Qe(hn,{variant:"ghost",get class(){return`session-item ${i(ht)??""}`},onclick:()=>{Wt.loadSession(i(Ke).id),m(d,!1)},children:(nt,jt)=>{var Pt=Am(),pn=P(Pt,!0);k(Pt),K(()=>J(pn,i(Ke).title)),g(nt,Pt)},$$slots:{default:!0}})}var Xt=D(hn,2);Qe(Xt,{variant:"ghost",size:"icon",class:"session-delete-btn",title:"Delete session",onclick:ht=>{ht.stopPropagation(),Wt.deleteSession(i(Ke).id)},children:(ht,nt)=>{Dr(ht,{size:12})},$$slots:{default:!0}}),k(St),g(ct,St)}),k(Me),k(ve),g(X,ve)};R(ee,X=>{i(d)&&X(pe)})}k(F);var te=D(F,2),ge=P(te);{var U=X=>{var ve=Em(),Me=P(ve);xt(Me,21,()=>i(v),Ft,(ct,Ke)=>{Qe(ct,{variant:"outline",class:"seed-prompt",onclick:()=>{u=!0,Wt.send(i(Ke)),cs().then(()=>O())},children:(St,hn)=>{le();var Xt=Jt();K(()=>J(Xt,i(Ke))),g(St,Xt)},$$slots:{default:!0}})}),k(Me),k(ve),g(X,ve)},G=X=>{var ve=I(),Me=S(ve);xt(Me,17,()=>Wt.messages,Ft,(ct,Ke)=>{var St=$m(),hn=P(St);{var Xt=nt=>{var jt=Om(),Pt=P(jt,!0);k(jt),K(()=>J(Pt,i(Ke).content)),g(nt,jt)},ht=nt=>{var jt=Fm(),Pt=P(jt);{var pn=bt=>{var We=I(),Nn=S(We);xt(Nn,17,()=>i(Ke).segments,Ft,(qr,wn)=>{var Zr=I(),Us=S(Zr);{var qs=tn=>{var Nt=zm();xt(Nt,21,()=>i(wn).names,Ft,(_r,Ys)=>{var kr=Rm(),En=P(kr,!0);k(kr),K(()=>J(En,i(Ys))),g(_r,kr)}),k(Nt),g(tn,Nt)},Zs=tn=>{var Nt=Mm(),_r=P(Nt);Uo(_r,()=>Ue.parse(a(i(wn).content))),k(Nt),g(tn,Nt)};R(Us,tn=>{i(wn).type==="tools"?tn(qs):i(wn).type==="text"&&i(wn).content&&tn(Zs,1)})}g(qr,Zr)}),g(bt,We)},lr=bt=>{var We=Im(),Nn=P(We);Uo(Nn,()=>Ue.parse(a(i(Ke).content))),k(We),g(bt,We)};R(Pt,bt=>{i(Ke).segments&&i(Ke).segments.length>0?bt(pn):i(Ke).content&&bt(lr,1)})}var Zn=D(Pt,2);{var cr=bt=>{var We=Dm();g(bt,We)};R(Zn,bt=>{i(Ke).streaming&&bt(cr)})}k(jt),g(nt,jt)};R(hn,nt=>{i(Ke).role==="user"?nt(Xt):nt(ht,!1)})}k(St),g(ct,St)}),g(X,ve)};R(ge,X=>{Wt.messages.length===0?X(U):X(G,!1)})}k(te),Ds(te,X=>f=X,()=>f);var j=D(te,2),Y=P(j);{var ye=X=>{var ve=Nm(),Me=P(ve);k(ve),K(()=>J(Me,`${Re.selectedType??""}/${Re.selectedId??""}`)),g(X,ve)};R(Y,X=>{Re.selectedId&&X(ye)})}var Se=D(Y,2),Oe=P(Se);wc(Oe);var at=D(Oe,2);{var ft=X=>{Qe(X,{variant:"ghost",size:"icon",class:"size-7 stop-btn send-btn",onclick:()=>Wt.stop(),children:(ve,Me)=>{Ov(ve,{size:16})},$$slots:{default:!0}})},kt=X=>{Qe(X,{variant:"ghost",size:"icon",class:"size-7 send-btn",onclick:y,children:(ve,Me)=>{El(ve,{size:14})},$$slots:{default:!0}})};R(at,X=>{Wt.streaming?X(ft):X(kt,!1)})}k(Se),k(j),k(T),K(()=>{us(Oe,"placeholder",Re.selectedId?"Ask about this entity...":"Ask about your workspace..."),_c(Oe,i(c)),Oe.disabled=Wt.streaming}),ln("scroll",te,p),fr("input",Oe,X=>l(X.target.value)),fr("keydown",Oe,C),g(n,T),L()}Ta(["input","keydown"]);var Hm=fe("<title> </title>"),Vm=fe('<svg><!><path d="M24.59 16.59 17 24.17 17 4 15 4 15 24.17 7.41 16.59 6 18 16 28 26 18 24.59 16.59z"></path></svg>');function Wm(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=Vm();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Hm(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}var Km=fe("<title> </title>"),jm=fe('<svg><!><path d="m22,8v2c2.2061,0,4,1.7944,4,4s-1.7939,4-4,4h-12v-5l-6,6,6,6v-5h12c3.3086,0,6-2.6914,6-6s-2.6914-6-6-6Z"></path></svg>');function Um(n,e){const t=de(e,["children","$$slots","$$events","$$legacy"]),s=de(t,["size","title"]);N(e,!1);const r=ue(),a=ue();let o=w(e,"size",8,16),c=w(e,"title",8,void 0);ce(()=>(H(t),H(c())),()=>{m(r,t["aria-label"]||t["aria-labelledby"]||c())}),ce(()=>(i(r),H(t)),()=>{m(a,{"aria-hidden":i(r)?void 0:!0,role:i(r)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),et(),tt();var l=jm();_e(l,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:o(),height:o(),...i(a),...s}));var d=P(l);{var h=f=>{var u=Km(),p=P(u,!0);k(u),K(()=>J(p,c())),g(f,u)};R(d,f=>{c()&&f(h)})}le(),k(l),g(n,l),L()}function qm(n){const e=new URLSearchParams;return n.q&&e.set("q",n.q),n.type&&e.set("type",n.type),n.tags&&e.set("tags",n.tags),n.repos&&e.set("repos",n.repos),Kt(`/api/search?${e.toString()}`)}var Zm=E('<div class="empty-results svelte-1xems06">No results found</div>'),Ym=E('<div class="result-body svelte-1xems06"><div class="result-title-row svelte-1xems06"><span class="result-title svelte-1xems06"> </span> <span class="entity-tag svelte-1xems06"> </span></div> <div class="result-meta svelte-1xems06"><span class="result-path"> </span></div></div>'),Gm=E('<div class="search-header svelte-1xems06"><!> <!> <kbd class="esc-badge svelte-1xems06">esc</kbd></div> <div class="results-list svelte-1xems06"><!> <!></div> <div class="search-footer svelte-1xems06"><div class="shortcut-group svelte-1xems06"><kbd class="shortcut-key svelte-1xems06"><!></kbd> <kbd class="shortcut-key svelte-1xems06"><!></kbd> <span class="shortcut-label svelte-1xems06">Navigate</span></div> <div class="shortcut-group svelte-1xems06"><kbd class="shortcut-key svelte-1xems06"><!></kbd> <span class="shortcut-label svelte-1xems06">Open</span></div></div>',1);function Xm(n,e){N(e,!0);let t=w(e,"open",15),s=$(""),r=$(en([])),a=$(0),o=null;function c(u){const p=u.target;if(m(s,p.value,!0),m(a,0),o&&clearTimeout(o),!i(s).trim()){m(r,[],!0);return}o=setTimeout(async()=>{try{m(r,await qm({q:i(s)}),!0)}catch{m(r,[],!0)}},200)}function l(u){if(u.key==="Escape")e.onclose();else if(u.key==="ArrowDown")u.preventDefault(),m(a,Math.min(i(a)+1,i(r).length-1),!0);else if(u.key==="ArrowUp")u.preventDefault(),m(a,Math.max(i(a)-1,0),!0);else if(u.key==="Enter"){u.preventDefault();const p=i(r)[i(a)];p&&d(p)}}function d(u){const p=u.repoName??"";p&&kn(`/${p}/${u.entityType}/${u.id}`),e.onclose()}var h=I();ln("keydown",Oa,u=>{(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),t()&&e.onclose())});var f=S(h);q(f,()=>mo,(u,p)=>{p(u,{onOpenChange:v=>{v||e.onclose()},get open(){return t()},set open(v){t(v)},children:(v,y)=>{var C=I(),O=S(C);q(O,()=>bo,(T,F)=>{F(T,{size:"lg",children:(A,B)=>{var V=Gm(),Q=S(V),he=P(Q);Ra(he,{size:16});var ee=D(he,2);ds(ee,{type:"text",class:"search-input",placeholder:"Search entities...",get value(){return i(s)},oninput:c,onkeydown:l,autofocus:!0}),le(2),k(Q);var pe=D(Q,2),te=P(pe);{var ge=ve=>{var Me=Zm();g(ve,Me)},U=x(()=>i(r).length===0&&i(s).trim());R(te,ve=>{i(U)&&ve(ge)})}var G=D(te,2);xt(G,17,()=>i(r),Ft,(ve,Me,ct)=>{{let Ke=x(()=>ct===i(a)?"selected":"");Qe(ve,{variant:"ghost",get class(){return`result-row ${i(Ke)??""}`},onclick:()=>d(i(Me)),children:(St,hn)=>{var Xt=Ym(),ht=P(Xt),nt=P(ht),jt=P(nt,!0);k(nt);var Pt=D(nt,2),pn=P(Pt,!0);k(Pt),k(ht);var lr=D(ht,2),Zn=P(lr),cr=P(Zn,!0);k(Zn),k(lr),k(Xt),K(()=>{J(jt,i(Me).data?.name??i(Me).data?.title??i(Me).id),J(pn,i(Me).entityType),J(cr,i(Me).id)}),g(St,Xt)},$$slots:{default:!0}})}}),k(pe);var j=D(pe,2),Y=P(j),ye=P(Y),Se=P(ye);El(Se,{size:10}),k(ye);var Oe=D(ye,2),at=P(Oe);Wm(at,{size:10}),k(Oe),le(2),k(Y);var ft=D(Y,2),kt=P(ft),X=P(kt);Um(X,{size:10}),k(kt),le(2),k(ft),k(j),g(A,V)},$$slots:{default:!0}})}),g(v,C)},$$slots:{default:!0}})}),g(n,h),L()}function Qm(){let n=$(en({}));function e(r){r.action==="join"?i(n)[r.user.id]=r.user:delete i(n)[r.user.id]}function t(){m(n,{},!0)}const s=x(()=>Object.values(i(n)));return{handleOnlineEvent:e,reset:t,get allOnline(){return i(s)}}}const Ms=Qm();Qt.setOnlineHandler(n=>Ms.handleOnlineEvent(n));Qt.addConnectHandler(()=>Ms.reset());var Jm=E('<div id="sg-chrome-footer"></div>'),eb=E('<div class="app-frame svelte-vr1z90"><div class="app-body svelte-vr1z90"><!> <main class="main-content svelte-vr1z90"><!></main> <!></div> <!></div> <!>',1);function Ob(n,e){N(e,!0);const t=ps("chat");let s=w(e,"showSidebar",3,!0),r=w(e,"showStatusBar",3,!0),a=$(!1);Is(()=>{const T=window.StudioChrome;T&&T.mountFooter()}),mt(()=>{const T=Dt.user?String(Dt.user.id):void 0,F=T?Ms.allOnline.filter(B=>B.id!==T):Ms.allOnline,A=window.StudioChrome;A?.setCollaborators&&A.setCollaborators(F)});var o=eb();ln("keydown",Oa,T=>{(T.metaKey||T.ctrlKey)&&T.key==="k"&&(T.preventDefault(),m(a,!i(a)))});var c=S(o),l=P(c),d=P(l);{var h=T=>{Pv(T,{})};R(d,T=>{s()&&T(h)})}var f=D(d,2),u=P(f);se(u,()=>e.children),k(f);var p=D(f,2);{var v=T=>{Bm(T,{})};R(p,T=>{t.open&&T(v)})}k(l);var y=D(l,2);{var C=T=>{var F=Jm();g(T,F)};R(y,T=>{r()&&T(C)})}k(c);var O=D(c,2);Xm(O,{get open(){return i(a)},onclose:()=>{m(a,!1)}}),g(n,o),L()}export{Va as $,Ob as A,zn as B,is as C,Ei as D,Kr as E,Ua as F,Gt as G,Ve as H,Xn as I,Je as J,Ai as K,db as L,Mn as M,Zd as N,cl as O,ss as P,ll as Q,ns as R,vb as S,rs as T,Xd as U,ms as V,Lr as W,nd as X,td as Y,Wa as Z,ed as _,Dr as a,fb as a0,hb as a1,pb as a2,gb as a3,br as a4,ya as a5,ta as a6,Xu as a7,Lh as a8,Nh as a9,zh as aa,Mh as ab,Xr as ac,Ni as ad,yb as ae,wb as af,bo as ag,Cl as ah,Tl as ai,tg as aj,rg as ak,Tc as al,mo as am,Pb as an,Qo as ao,Np as ap,za as aq,Sb as ar,Ab as as,xb as at,_b as au,Eb as av,kb as aw,Cb as ax,Tb as ay,Gr as b,Xo as c,vs as d,Wt as e,Up as f,Wp as g,$p as h,qp as i,Hp as j,Lp as k,Dp as l,bb as m,dr as n,$n as o,pr as p,$t as q,mb as r,Fa as s,hi as t,M as u,jn as v,Ti as w,yr as x,Ci as y,Tt as z};
|