PageSourceSearch

https://mike0021-deepspec-decoding-lab.hf.space/assets/Button-DxE-syeF.js

js mike0021-deepspec-decoding-lab.hf.space collected 2026-10-03 17:07:40 UTC 4,923 bytes, 184 lines download raw bytes

1import { p as prop, i as if_block, a as set_attribute, b as set_class, f as set_style } from './i18n-dpAHICcw.js';
2import { R as push, a6 as comment, S as first_child, a as append, T as pop, ak as delegate, V as child, X as sibling, Y as reset, t as template_effect, W as from_html, w as get, a5 as user_derived } from './index-CDZuCcOm.js';
3import { s as snippet } from './snippet-DVkMfmSq.js';
4import { I as Image } from './Image-CJziNDBt.js';
5import './ScrollFade.svelte_svelte_type_style_lang-DUvCSfRk.js';
6import './MarkdownCode.svelte_svelte_type_style_lang-GeNUGzep.js';
7/* empty css                                                    */
8
9var root_1 = from_html(`<a><!> <!></a>`);
10var root_4 = from_html(`<button><!> <!></button>`);
11
12function Button($$anchor, $$props) {
13	push($$props, true);
14
15	let elem_classes = prop($$props, 'elem_classes', 19, () => []),
16		onclick = prop($$props, 'onclick', 3, () => {});
17
18	var fragment = comment();
19	var node = first_child(fragment);
20
21	{
22		var consequent_2 = ($$anchor) => {
23			var a = root_1();
24			let classes;
25			let styles;
26			var node_1 = child(a);
27
28			{
29				var consequent = ($$anchor) => {
30					{
31						let $0 = user_derived(() => ({ alt: `${$$props.value} icon`, class: "button-icon" }));
32
33						Image($$anchor, {
34							get src() {
35								return $$props.icon.url;
36							},
37
38							get restProps() {
39								return get($0);
40							}
41						});
42					}
43				};
44
45				if_block(node_1, ($$render) => {
46					if ($$props.icon) $$render(consequent);
47				});
48			}
49
50			var node_2 = sibling(node_1, 2);
51
52			{
53				var consequent_1 = ($$anchor) => {
54					var fragment_2 = comment();
55					var node_3 = first_child(fragment_2);
56
57					snippet(node_3, () => $$props.children);
58					append($$anchor, fragment_2);
59				};
60
61				if_block(node_2, ($$render) => {
62					if ($$props.children) $$render(consequent_1);
63				});
64			}
65
66			reset(a);
67
68			template_effect(
69				($0) => {
70					set_attribute(a, 'href', $$props.link);
71					set_attribute(a, 'target', $$props.link_target);
72					set_attribute(a, 'rel', $$props.link_target === "_blank" ? "noopener noreferrer" : undefined);
73					set_attribute(a, 'aria-disabled', $$props.disabled);
74
75					classes = set_class(a, 1, `${$$props.size ?? ''} ${$$props.variant ?? ''} ${$0 ?? ''}`, 'svelte-xzq5jh', classes, {
76						hidden: $$props.visible === false || $$props.visible === "hidden",
77						disabled: $$props.disabled
78					});
79
80					set_attribute(a, 'id', $$props.elem_id);
81
82					styles = set_style(a, '', styles, {
83						'flex-grow': $$props.scale,
84						'pointer-events': $$props.disabled ? "none" : null,
85						width: $$props.scale === 0 ? "fit-content" : null,
86						'min-width': typeof $$props.min_width === "number" ? `calc(min(${$$props.min_width}px, 100%))` : null
87					});
88				},
89				[() => elem_classes().join(' ')]
90			);
91
92			append($$anchor, a);
93		};
94
95		var alternate = ($$anchor) => {
96			var button = root_4();
97
98			button.__click = function (...$$args) {
99				onclick()?.apply(this, $$args);
100			};
101
102			let classes_1;
103			let styles_1;
104			var node_4 = child(button);
105
106			{
107				var consequent_3 = ($$anchor) => {
108					{
109						let $0 = user_derived(() => ({ alt: `${$$props.value} icon` }));
110						let $1 = user_derived(() => [`button-icon ${$$props.value ? "right-padded" : ""}`]);
111
112						Image($$anchor, {
113							get restProps() {
114								return get($0);
115							},
116
117							get class_names() {
118								return get($1);
119							},
120
121							get src() {
122								return $$props.icon.url;
123							}
124						});
125					}
126				};
127
128				if_block(node_4, ($$render) => {
129					if ($$props.icon) $$render(consequent_3);
130				});
131			}
132
133			var node_5 = sibling(node_4, 2);
134
135			{
136				var consequent_4 = ($$anchor) => {
137					var fragment_4 = comment();
138					var node_6 = first_child(fragment_4);
139
140					snippet(node_6, () => $$props.children);
141					append($$anchor, fragment_4);
142				};
143
144				if_block(node_5, ($$render) => {
145					if ($$props.children) $$render(consequent_4);
146				});
147			}
148
149			reset(button);
150
151			template_effect(
152				($0) => {
153					classes_1 = set_class(button, 1, `${$$props.size ?? ''} ${$$props.variant ?? ''} ${$0 ?? ''}`, 'svelte-xzq5jh', classes_1, {
154						hidden: $$props.visible === false || $$props.visible === "hidden"
155					});
156
157					set_attribute(button, 'id', $$props.elem_id);
158					button.disabled = $$props.disabled;
159
160					styles_1 = set_style(button, '', styles_1, {
161						'flex-grow': $$props.scale,
162						width: $$props.scale === 0 ? "fit-content" : null,
163						'min-width': typeof $$props.min_width === "number" ? `calc(min(${$$props.min_width}px, 100%))` : null
164					});
165				},
166				[() => elem_classes().join(' ')]
167			);
168
169			append($$anchor, button);
170		};
171
172		if_block(node, ($$render) => {
173			if ($$props.link && $$props.link.length > 0) $$render(consequent_2); else $$render(alternate, false);
174		});
175	}
176
177	append($$anchor, fragment);
178	pop();
179}
180
181delegate(['click']);
182
183export { Button as B };
184//# sourceMappingURL=Button-DxE-syeF.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.