import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import"./i18n-CyvX8KmK.js";import{G as B}from"./utils.svelte-Ceck75cM.js";import"./svelte/svelte_internal_flags_legacy.js";import{createEventDispatcher as P,onMount as S}from"./svelte/svelte_svelte.js";import{S as C}from"./StreamingBar-C6ky6DsM.js";import{B as R}from"./Index.svelte_svelte_type_style_lang-DXctW2-r.js";import"./svelte/svelte_store.js";import"./index-Dw8Uzof1.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./IconButtonWrapper-D4LMIc_2.js";import"./MarkdownCode-C7jLnxqj.js";import"./prism-python-B1e-54E9.js";var k=e.from_html('<div><button class="toggle-button svelte-1uruprb" aria-label="Toggle Sidebar"><div class="chevron svelte-1uruprb"><span class="chevron-left svelte-1uruprb"></span></div></button> <div class="sidebar-content svelte-1uruprb"><!></div></div>');function z(v,s){e.push(s,!1);const g=e.mutable_source(),t=P();let i=e.prop(s,"open",12,!0),n=e.prop(s,"width",12),l=e.prop(s,"position",12,"left"),u=e.prop(s,"elem_classes",28,()=>[]),p=e.prop(s,"elem_id",12,""),o=e.mutable_source(!1),d=e.mutable_source(!1),a=e.mutable_source(),b=0,m=typeof n()=="number"?`${n()}px`:n(),_=e.mutable_source();function w(){if(!e.get(a).closest(".wrap"))return;const r=e.get(a).closest(".wrap")?.getBoundingClientRect();if(!r)return;const f=e.get(a).getBoundingClientRect(),h=l()==="left"?r.left:window.innerWidth-r.right;b=Math.max(0,f.width-h+30)}S(()=>{e.get(a).closest(".wrap")?.classList.add("sidebar-parent"),w(),window.addEventListener("resize",w),(()=>{document.documentElement.style.setProperty("--overlap-amount",`${b}px`)})(),e.set(o,!0);const f=window.matchMedia("(prefers-reduced-motion: reduce)");e.set(_,f.matches);const h=M=>{e.set(_,M.matches)};return f.addEventListener("change",h),()=>{window.removeEventListener("resize",w),f.removeEventListener("change",h)}}),e.legacy_pre_effect(()=>(e.get(o),e.deep_read_state(i())),()=>{e.get(o)&&e.set(d,i())}),e.legacy_pre_effect(()=>e.deep_read_state(u()),()=>{e.set(g,u()?.join(" ")||"")}),e.legacy_pre_effect_reset();var E={get open(){return i()},set open(r){i(r),e.flush()},get width(){return n()},set width(r){n(r),e.flush()},get position(){return l()},set position(r){l(r),e.flush()},get elem_classes(){return u()},set elem_classes(r){u(r),e.flush()},get elem_id(){return p()},set elem_id(r){p(r),e.flush()}};e.init();var c=k();let $;var x=e.child(c),y=e.sibling(x,2),L=e.child(y);return e.slot(L,s,"default",{},null),e.reset(y),e.reset(c),e.bind_this(c,r=>e.set(a,r),()=>e.get(a)),e.template_effect(()=>{$=e.set_class(c,1,`sidebar ${e.get(g)??""}`,"svelte-1uruprb",$,{open:e.get(d),right:l()==="right","reduce-motion":e.get(_)}),e.set_attribute(c,"id",p()),e.set_style(c,`width: ${m??""}; ${l()??""}: calc(${m??""} * -1)`)}),e.event("click",x,()=>{e.set(d,!e.get(d)),i(e.get(d)),e.get(d)?t("expand"):t("collapse")}),e.append(v,c),e.pop(E)}var G=e.from_html("<!> <!>",1);function ie(v,s){e.push(s,!0);const g=e.rest_props(s,["$$slots","$$events","$$legacy"]),t=new B(g);var i=G(),n=e.first_child(i);C(n,e.spread_props({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status));var l=e.sibling(n,2);{var u=p=>{z(p,{get width(){return t.props.width},get elem_classes(){return t.shared.elem_classes},get elem_id(){return t.shared.elem_id},get open(){return t.props.open},set open(o){t.props.open=o},get position(){return t.props.position},set position(o){t.props.position=o},$$events:{expand:()=>t.dispatch("expand"),collapse:()=>t.dispatch("collapse")},children:(o,d)=>{R(o,{children:(a,b)=>{var m=e.comment(),_=e.first_child(m);e.slot(_,s,"default",{},null),e.append(a,m)},$$slots:{default:!0}})},$$slots:{default:!0}})};e.if(l,p=>{t.shared.visible&&p(u)})}e.append(v,i),e.pop()}export{ie as default};
