import{c as le,e as me,a as de,p as a,i as o,y as K,x as f,s as U,t as ce,k as be,b as c,h as D,d as _e,v as C,f as p,w as O,m as s,D as ue,q as F,r as T}from"../../custom-element.js";import{o as ve}from"../../index-client.js";import{i as j}from"../../if.js";import{a as fe,s as pe}from"../../slot.js";import{c as ze}from"../../svelte-component.js";import{e as P}from"../../svelte-element.js";import{c as ge,a as Q}from"../../attributes.js";import{b as L}from"../../this.js";import{o as he,E as ke}from"../../Condition20.js";import{T as xe}from"../tooltip/Tooltip.js";import{u as we}from"../../floating-item.svelte.js";import{g as ye}from"../../sidebar-state.svelte.js";import"../../branches.js";import"../../media-query.js";var Ie=p('<span class="mc-sidebar__icon svelte-izmpz1"><!></span>'),Ee=p('<!> <span class="mc-sidebar__text svelte-izmpz1"> </span> <!>',1),Se=p('<div class="mc-sidebar__floating-item mc-sidebar__floating-item--tooltip mc-sidebar__floating-item--hidden svelte-izmpz1"><!></div>'),Be=p("<!> <!>",1);const Ue={hash:"svelte-izmpz1",code:`/**
 * Do not edit directly, this file was auto-generated.
 */
@media screen and (min-width: 680px) {
}
@media screen and (min-width: 680px) {
}
@media screen and (min-width: 680px) {
}.mc-sidebar__floating-item.svelte-izmpz1 {position:absolute;padding-left:1.25rem;left:3rem;}.mc-sidebar__floating-item--tooltip.svelte-izmpz1 {top:0.25rem;}
@media screen and (min-width: 680px) {
}.mc-sidebar__floating-item--hidden.svelte-izmpz1 {visibility:hidden;overflow:hidden;opacity:0;height:0;pointer-events:none;}
@media screen and (min-width: 680px) {
}
@media screen and (min-width: 680px) {
}
@media screen and (min-width: 680px) {
}.mc-sidebar__link.svelte-izmpz1 {display:flex;align-items:center;gap:0.25rem;height:2.5rem;width:100%;padding-left:0.25rem;text-align:left;text-decoration:none;font-size:var(--font-size-150, 1rem);font-weight:var(--font-weight-semi-bold, 600);color:var(--sidebar-color-section-item-text-default, #404040);border-radius:var(--border-radius-m, 0.5rem);background:transparent;border:none;cursor:pointer;}.mc-sidebar__link--selected.svelte-izmpz1 {color:var(--sidebar-color-section-item-text-selected, #006902);background:var(--sidebar-color-section-item-background-selected, #ebf5de);}.mc-sidebar__link--locked.svelte-izmpz1 {pointer-events:none;}.mc-sidebar__link.svelte-izmpz1:not(.mc-sidebar__link--selected):hover {background:var(--sidebar-color-section-item-background-hover, rgba(0, 0, 0, 0.05));}.mc-sidebar__link.svelte-izmpz1:focus-visible {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-sidebar__link.svelte-izmpz1:is(summary:where(.svelte-izmpz1)) .mc-sidebar__text:where(.svelte-izmpz1) {flex-grow:1;}.mc-sidebar__icon.svelte-izmpz1 {fill:currentcolor;width:1.5rem;height:1.5rem;}.mc-sidebar__text.svelte-izmpz1 {display:block;}.mc-sidebar__item.svelte-izmpz1 {position:relative;}.mc-sidebar__item--sub.mc-sidebar__item.svelte-izmpz1 .mc-sidebar__link:where(.svelte-izmpz1) {display:flex;align-items:center;justify-content:start;gap:0.25rem;padding-left:0.5rem;margin-bottom:0.125rem;height:2rem;text-decoration:none;color:var(--sidebar-color-section-item-text-default, #404040);border-radius:var(--border-radius-m, 0.5rem);background:transparent;border:none;cursor:pointer;}.mc-sidebar__item--sub.mc-sidebar__item.svelte-izmpz1 .mc-sidebar__link:where(.svelte-izmpz1) .mc-sidebar__text:where(.svelte-izmpz1) {display:block;font-size:var(--font-body-s, 0.875rem);font-weight:var(--font-weight-regular, 400);}.mc-sidebar__item--sub.mc-sidebar__item.svelte-izmpz1 .mc-sidebar__link--selected:where(.svelte-izmpz1) {color:var(--sidebar-color-section-item-text-selected, #006902);background:var(--sidebar-color-section-item-background-selected, #ebf5de);}.mc-sidebar__item--sub.mc-sidebar__item.svelte-izmpz1 .mc-sidebar__link:where(.svelte-izmpz1):not(.mc-sidebar__item--sub.mc-sidebar__item:where(.svelte-izmpz1) .mc-sidebar__link--selected:where(.svelte-izmpz1)):hover {background:var(--sidebar-color-section-item-background-hover, rgba(0, 0, 0, 0.05));}.mc-sidebar__item--sub.mc-sidebar__item.svelte-izmpz1 .mc-sidebar__link:where(.svelte-izmpz1):focus-visible {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-sidebar__item--collapsed.svelte-izmpz1 .mc-sidebar__text:where(.svelte-izmpz1) {display:none;}.mc-sidebar__item--collapsed.svelte-izmpz1 .mc-sidebar__link:where(.svelte-izmpz1) {padding-left:0;justify-content:center;}`};function De(M,t){const R=fe(t);me(t,!0),de(M,Ue);let z=a(t,"tag",7,"li"),g=a(t,"id",23,()=>crypto.randomUUID()),b=a(t,"label",7),l=a(t,"href",7),_=a(t,"locked",7),u=a(t,"external",7),h=a(t,"active",7),k=a(t,"onclick",7),n=a(t,"sub",7),x,w=C(null),y=C(null);const{hideFloatingItem:q,showFloatingItem:A}=we(()=>o(w),()=>o(y),{allowItemHover:!1}),V=O(()=>_()?he:ke);let I=C(!1);function W(){k()?.(),x.dispatchEvent(new CustomEvent("item-click",{bubbles:!0,composed:!0}))}const X=O(()=>{if(l())return u()?"_blank":"_self"});ve(()=>{if(n()!==void 0)return;const e=ue("SUB_ITEM");e!==void 0&&n(e??!1)});var Y={get tag(){return z()},set tag(e="li"){z(e),s()},get id(){return g()},set id(e=crypto.randomUUID()){g(e),s()},get label(){return b()},set label(e){b(e),s()},get href(){return l()},set href(e){l(e),s()},get locked(){return _()},set locked(e){_(e),s()},get external(){return u()},set external(e){u(e),s()},get active(){return h()},set active(e){h(e),s()},get onclick(){return k()},set onclick(e){k(e),s()},get sub(){return n()},set sub(e){n(e),s()}},H=K(),Z=f(H);return P(Z,z,!1,(e,$)=>{ge(e,()=>ye({setExpanded:i=>F(I,i,!0)})),L(e,i=>x=i,()=>x),Q(e,()=>({class:{"mc-sidebar__item":!0,"mc-sidebar__item--collapsed":!o(I)&&!n(),"mc-sidebar__item--sub":n()}}),void 0,void 0,void 0,"svelte-izmpz1");var N=Be(),G=f(N);P(G,()=>l()?"a":"button",!1,(i,m)=>{L(i,r=>F(w,r,!0),()=>o(w));var E=()=>W();Q(i,()=>({href:l(),role:l()?"link":"button",target:o(X),class:{"mc-sidebar__link":!0,"mc-sidebar__link--selected":h(),"mc-sidebar__link--locked":_()},"aria-label":b(),onmouseenter:A,onfocus:A,onmouseleave:q,onblur:q,onclick:E}),void 0,void 0,void 0,"svelte-izmpz1");var v=Ee(),J=f(v);{var ie=r=>{var d=Ie(),B=D(d);pe(B,t,"icon",{},null),T(d),c(r,d)};j(J,r=>{R.icon&&r(ie)})}var S=U(J,2),re=D(S,!0);T(S);var ae=U(S,2);{var se=r=>{var d=K(),B=f(d);ze(B,()=>o(V),(oe,ne)=>{ne(oe,{})}),c(r,d)};j(ae,r=>{(_()||u())&&r(se)})}ce(()=>be(re,b())),c(m,v)});var ee=U(G,2);{var te=i=>{var m=Se(),E=D(m);xe(E,{get id(){return g()},get text(){return b()},standalone:!0,pointer:!1}),T(m),L(m,v=>F(y,v),()=>o(y)),c(i,m)};j(ee,i=>{!o(I)&&!n()&&i(te)})}c($,N)}),c(M,H),_e(Y)}customElements.define("m-sidebar-nav-item",le(De,{locked:{attribute:"locked",reflect:!0,type:"Boolean"},external:{attribute:"external",reflect:!0,type:"Boolean"},active:{attribute:"active",reflect:!0,type:"Boolean"},sub:{attribute:"sub",reflect:!0,type:"Boolean"},tag:{},id:{},label:{},href:{},onclick:{}},["icon"],[],{mode:"open"}));export{De as S};
//# sourceMappingURL=SidebarNavItem.js.map
