import"./svelte/svelte_internal_flags_legacy.js";import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import"./index-Dw8Uzof1.js";import{I as z}from"./Image-Bdf4wQSw.js";import"./ImagePreview-CBoeGuoF.js";var C=e.from_html("<a><!> <!></a>"),D=e.from_html("<button><!> <!></button>");function K(q,r){e.push(r,!1);let v=e.prop(r,"elem_id",12,""),i=e.prop(r,"elem_classes",28,()=>[]),s=e.prop(r,"visible",12,!0),g=e.prop(r,"variant",12,"secondary"),b=e.prop(r,"size",12,"lg"),f=e.prop(r,"value",12,null),u=e.prop(r,"link",12,null),p=e.prop(r,"link_target",12,"_self"),a=e.prop(r,"icon",12,null),d=e.prop(r,"disabled",12,!1),_=e.prop(r,"scale",12,null),o=e.prop(r,"min_width",12,void 0);var j={get elem_id(){return v()},set elem_id(t){v(t),e.flush()},get elem_classes(){return i()},set elem_classes(t){i(t),e.flush()},get visible(){return s()},set visible(t){s(t),e.flush()},get variant(){return g()},set variant(t){g(t),e.flush()},get size(){return b()},set size(t){b(t),e.flush()},get value(){return f()},set value(t){f(t),e.flush()},get link(){return u()},set link(t){u(t),e.flush()},get link_target(){return p()},set link_target(t){p(t),e.flush()},get icon(){return a()},set icon(t){a(t),e.flush()},get disabled(){return d()},set disabled(t){d(t),e.flush()},get scale(){return _()},set scale(t){_(t),e.flush()},get min_width(){return o()},set min_width(t){o(t),e.flush()}};e.init();var y=e.comment(),B=e.first_child(y);{var I=t=>{var l=C();let c,m;var h=e.child(l);{var k=n=>{{let x=e.derived_safe_equal(()=>({alt:`${f()} icon`,class:"button-icon"}));z(n,{get src(){return e.deep_read_state(a()),e.untrack(()=>a().url)},get restProps(){return e.get(x)}})}};e.if(h,n=>{a()&&n(k)})}var w=e.sibling(h,2);e.slot(w,r,"default",{},null),e.reset(l),e.template_effect(n=>{e.set_attribute(l,"href",u()),e.set_attribute(l,"target",p()),e.set_attribute(l,"rel",p()==="_blank"?"noopener noreferrer":void 0),e.set_attribute(l,"aria-disabled",d()),c=e.set_class(l,1,`${b()??""} ${g()??""} ${n??""}`,"svelte-xzq5jh",c,{hidden:s()===!1||s()==="hidden",disabled:d()}),e.set_attribute(l,"id",v()),m=e.set_style(l,"",m,{"flex-grow":_(),"pointer-events":d()?"none":null,width:_()===0?"fit-content":null,"min-width":typeof o()=="number"?`calc(min(${o()}px, 100%))`:null})},[()=>(e.deep_read_state(i()),e.untrack(()=>i().join(" ")))]),e.append(t,l)},P=t=>{var l=D();let c,m;var h=e.child(l);{var k=n=>{{let x=e.derived_safe_equal(()=>({alt:`${f()} icon`})),A=e.derived_safe_equal(()=>[`button-icon ${f()?"right-padded":""}`]);z(n,{get restProps(){return e.get(x)},get class_names(){return e.get(A)},get src(){return e.deep_read_state(a()),e.untrack(()=>a().url)}})}};e.if(h,n=>{a()&&n(k)})}var w=e.sibling(h,2);e.slot(w,r,"default",{},null),e.reset(l),e.template_effect(n=>{c=e.set_class(l,1,`${b()??""} ${g()??""} ${n??""}`,"svelte-xzq5jh",c,{hidden:s()===!1||s()==="hidden"}),e.set_attribute(l,"id",v()),l.disabled=d(),m=e.set_style(l,"",m,{"flex-grow":_(),width:_()===0?"fit-content":null,"min-width":typeof o()=="number"?`calc(min(${o()}px, 100%))`:null})},[()=>(e.deep_read_state(i()),e.untrack(()=>i().join(" ")))]),e.event("click",l,function(n){e.bubble_event.call(this,r,n)}),e.append(t,l)};e.if(B,t=>{e.deep_read_state(u()),e.untrack(()=>u()&&u().length>0)?t(I):t(P,!1)})}return e.append(q,y),e.pop(j)}export{K as B};
