import { I as Info } from './Info-b271c224.js'; import './Button-ab11cb83.js'; /* home/runner/work/gradio/gradio/js/atoms/src/BlockTitle.svelte generated by Svelte v4.2.2 */ const { SvelteComponent, attr, check_outros, create_component, create_slot, destroy_component, detach, element, empty, get_all_dirty_from_scope, get_slot_changes, group_outros, init, insert, mount_component, safe_not_equal, set_data, space, text, toggle_class, transition_in, transition_out, update_slot_base } = window.__gradio__svelte__internal; function create_if_block(ctx) { let info_1; let current; info_1 = new Info({ props: { $$slots: { default: [create_default_slot] }, $$scope: { ctx } } }); return { c() { create_component(info_1.$$.fragment); }, m(target, anchor) { mount_component(info_1, target, anchor); current = true; }, p(ctx, dirty) { const info_1_changes = {}; if (dirty & /*$$scope, info*/ 10) { info_1_changes.$$scope = { dirty, ctx }; } info_1.$set(info_1_changes); }, i(local) { if (current) return; transition_in(info_1.$$.fragment, local); current = true; }, o(local) { transition_out(info_1.$$.fragment, local); current = false; }, d(detaching) { destroy_component(info_1, detaching); } }; } // (15:1) function create_default_slot(ctx) { let t; return { c() { t = text(/*info*/ ctx[1]); }, m(target, anchor) { insert(target, t, anchor); }, p(ctx, dirty) { if (dirty & /*info*/ 2) set_data(t, /*info*/ ctx[1]); }, d(detaching) { if (detaching) { detach(t); } } }; } function create_fragment(ctx) { let span; let t; let if_block_anchor; let current; const default_slot_template = /*#slots*/ ctx[2].default; const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[3], null); let if_block = /*info*/ ctx[1] && create_if_block(ctx); return { c() { span = element("span"); if (default_slot) default_slot.c(); t = space(); if (if_block) if_block.c(); if_block_anchor = empty(); attr(span, "data-testid", "block-info"); attr(span, "class", "svelte-1gfkn6j"); toggle_class(span, "sr-only", !/*show_label*/ ctx[0]); toggle_class(span, "hide", !/*show_label*/ ctx[0]); toggle_class(span, "has-info", /*info*/ ctx[1] != null); }, m(target, anchor) { insert(target, span, anchor); if (default_slot) { default_slot.m(span, null); } insert(target, t, anchor); if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); current = true; }, p(ctx, [dirty]) { if (default_slot) { if (default_slot.p && (!current || dirty & /*$$scope*/ 8)) { update_slot_base( default_slot, default_slot_template, ctx, /*$$scope*/ ctx[3], !current ? get_all_dirty_from_scope(/*$$scope*/ ctx[3]) : get_slot_changes(default_slot_template, /*$$scope*/ ctx[3], dirty, null), null ); } } if (!current || dirty & /*show_label*/ 1) { toggle_class(span, "sr-only", !/*show_label*/ ctx[0]); } if (!current || dirty & /*show_label*/ 1) { toggle_class(span, "hide", !/*show_label*/ ctx[0]); } if (!current || dirty & /*info*/ 2) { toggle_class(span, "has-info", /*info*/ ctx[1] != null); } if (/*info*/ ctx[1]) { if (if_block) { if_block.p(ctx, dirty); if (dirty & /*info*/ 2) { transition_in(if_block, 1); } } else { if_block = create_if_block(ctx); if_block.c(); transition_in(if_block, 1); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } else if (if_block) { group_outros(); transition_out(if_block, 1, 1, () => { if_block = null; }); check_outros(); } }, i(local) { if (current) return; transition_in(default_slot, local); transition_in(if_block); current = true; }, o(local) { transition_out(default_slot, local); transition_out(if_block); current = false; }, d(detaching) { if (detaching) { detach(span); detach(t); detach(if_block_anchor); } if (default_slot) default_slot.d(detaching); if (if_block) if_block.d(detaching); } }; } function instance($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; let { show_label = true } = $$props; let { info = undefined } = $$props; $$self.$$set = $$props => { if ('show_label' in $$props) $$invalidate(0, show_label = $$props.show_label); if ('info' in $$props) $$invalidate(1, info = $$props.info); if ('$$scope' in $$props) $$invalidate(3, $$scope = $$props.$$scope); }; return [show_label, info, slots, $$scope]; } class BlockTitle extends SvelteComponent { constructor(options) { super(); init(this, options, instance, create_fragment, safe_not_equal, { show_label: 0, info: 1 }); } } export { BlockTitle as B }; //# sourceMappingURL=BlockTitle-05ec971b.js.map