PageSourceSearch

https://emtenan-lima-last.hf.space/assets/Example-DYo_cEEb.js

js emtenan-lima-last.hf.space collected 2026-10-03 16:52:41 UTC 2,230 bytes, 99 lines download raw bytes

1import { p as prop, e as init, d as bind_this, b as set_class } from './i18n-CGlVUOvE.js';
2import { M as push, a8 as onMount, t as template_effect, y as deep_read_state, w as untrack, X as set_text, a as append, O as pop, P as flushSync, R as from_html, Q as child, $ as set, a0 as mutable_source, Z as get, T as reset } from './index-Bq2njFOY.js';
3import { b as bind_element_size } from './size-CWi277d_.js';
4/* empty css                                               */
5
6var root = from_html(`<div> </div>`);
7
8function Example($$anchor, $$props) {
9	push($$props, false);
10
11	let value = prop($$props, 'value', 12);
12	let type = prop($$props, 'type', 12);
13	let selected = prop($$props, 'selected', 12, false);
14	let size = mutable_source();
15	let el = mutable_source();
16
17	function set_styles(element, el_width) {
18		element.style.setProperty("--local-text-width", `${el_width && el_width < 150 ? el_width : 200}px`);
19		element.style.whiteSpace = "unset";
20	}
21
22	function truncate_text(text, max_length = 60) {
23		if (!text) return "";
24
25		const str = String(text);
26
27		if (str.length <= max_length) return str;
28
29		return str.slice(0, max_length) + "...";
30	}
31
32	onMount(() => {
33		set_styles(get(el), get(size));
34	});
35
36	var $$exports = {
37		get value() {
38			return value();
39		},
40
41		set value($$value) {
42			value($$value);
43			flushSync();
44		},
45
46		get type() {
47			return type();
48		},
49
50		set type($$value) {
51			type($$value);
52			flushSync();
53		},
54
55		get selected() {
56			return selected();
57		},
58
59		set selected($$value) {
60			selected($$value);
61			flushSync();
62		}
63	};
64
65	init();
66
67	var div = root();
68	let classes;
69	var text_1 = child(div, true);
70
71	reset(div);
72	bind_this(div, ($$value) => set(el, $$value), () => get(el));
73
74	template_effect(
75		($0) => {
76			classes = set_class(div, 1, 'svelte-xxobeb', null, classes, {
77				table: type() === "table",
78				gallery: type() === "gallery",
79				selected: selected()
80			});
81
82			set_text(text_1, $0);
83		},
84		[
85			() => (
86				deep_read_state(value()),
87				untrack(() => truncate_text(value()))
88			)
89		]
90	);
91
92	bind_element_size(div, 'clientWidth', ($$value) => set(size, $$value));
93	append($$anchor, div);
94
95	return pop($$exports);
96}
97
98export { Example as default };
99//# sourceMappingURL=Example-DYo_cEEb.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.