PageSourceSearch

https://merve-owl-tracking.hf.space/assets/Login-b1c4b659.js

js merve-owl-tracking.hf.space collected 2026-10-03 10:19:45 UTC 13,381 bytes, 614 lines download raw bytes

1import Index$1 from './Index-0d7ad3de.js';
2import { T as Textbox } from './Textbox-4503493e.js';
3import { a as Button, B as Block } from './Button-0502e555.js';
4import { $ as $format } from './Index-4c82ea7b.js';
5/* empty css                                                */import Index from './Index-24a33ce1.js';
6import './BlockTitle-a8a324e7.js';
7import './Info-2d9cfe3f.js';
8import './Check-f7edb5d9.js';
9import './Copy-a69620a8.js';
10import './index-7f1ea29b.js';
11import './svelte/svelte.js';
12
13const Login_svelte_svelte_type_style_lang = '';
14
15/* src/Login.svelte generated by Svelte v4.2.2 */
16const {
17	SvelteComponent,
18	add_flush_callback,
19	append,
20	attr,
21	bind,
22	binding_callbacks,
23	component_subscribe,
24	create_component,
25	destroy_component,
26	detach,
27	element,
28	init,
29	insert,
30	mount_component,
31	safe_not_equal,
32	set_data,
33	space,
34	text,
35	toggle_class,
36	transition_in,
37	transition_out
38} = window.__gradio__svelte__internal;
39function create_if_block_2(ctx) {
40	let p;
41	let t;
42
43	return {
44		c() {
45			p = element("p");
46			t = text(/*auth_message*/ ctx[0]);
47			attr(p, "class", "auth svelte-1ogxbi0");
48		},
49		m(target, anchor) {
50			insert(target, p, anchor);
51			append(p, t);
52		},
53		p(ctx, dirty) {
54			if (dirty & /*auth_message*/ 1) set_data(t, /*auth_message*/ ctx[0]);
55		},
56		d(detaching) {
57			if (detaching) {
58				detach(p);
59			}
60		}
61	};
62}
63
64// (39:2) {#if space_id}
65function create_if_block_1(ctx) {
66	let p;
67	let t_value = /*$_*/ ctx[6]("login.enable_cookies") + "";
68	let t;
69
70	return {
71		c() {
72			p = element("p");
73			t = text(t_value);
74			attr(p, "class", "auth svelte-1ogxbi0");
75		},
76		m(target, anchor) {
77			insert(target, p, anchor);
78			append(p, t);
79		},
80		p(ctx, dirty) {
81			if (dirty & /*$_*/ 64 && t_value !== (t_value = /*$_*/ ctx[6]("login.enable_cookies") + "")) set_data(t, t_value);
82		},
83		d(detaching) {
84			if (detaching) {
85				detach(p);
86			}
87		}
88	};
89}
90
91// (44:2) {#if incorrect_credentials}
92function create_if_block(ctx) {
93	let p;
94	let t_value = /*$_*/ ctx[6]("login.incorrect_credentials") + "";
95	let t;
96
97	return {
98		c() {
99			p = element("p");
100			t = text(t_value);
101			attr(p, "class", "creds svelte-1ogxbi0");
102		},
103		m(target, anchor) {
104			insert(target, p, anchor);
105			append(p, t);
106		},
107		p(ctx, dirty) {
108			if (dirty & /*$_*/ 64 && t_value !== (t_value = /*$_*/ ctx[6]("login.incorrect_credentials") + "")) set_data(t, t_value);
109		},
110		d(detaching) {
111			if (detaching) {
112				detach(p);
113			}
114		}
115	};
116}
117
118// (48:3) <Block>
119function create_default_slot_4(ctx) {
120	let textbox;
121	let updating_value;
122	let current;
123
124	function textbox_value_binding(value) {
125		/*textbox_value_binding*/ ctx[9](value);
126	}
127
128	let textbox_props = {
129		label: "username",
130		lines: 1,
131		show_label: true,
132		max_lines: 1
133	};
134
135	if (/*username*/ ctx[3] !== void 0) {
136		textbox_props.value = /*username*/ ctx[3];
137	}
138
139	textbox = new Textbox({ props: textbox_props });
140	binding_callbacks.push(() => bind(textbox, 'value', textbox_value_binding));
141	textbox.$on("submit", /*submit*/ ctx[7]);
142
143	return {
144		c() {
145			create_component(textbox.$$.fragment);
146		},
147		m(target, anchor) {
148			mount_component(textbox, target, anchor);
149			current = true;
150		},
151		p(ctx, dirty) {
152			const textbox_changes = {};
153
154			if (!updating_value && dirty & /*username*/ 8) {
155				updating_value = true;
156				textbox_changes.value = /*username*/ ctx[3];
157				add_flush_callback(() => updating_value = false);
158			}
159
160			textbox.$set(textbox_changes);
161		},
162		i(local) {
163			if (current) return;
164			transition_in(textbox.$$.fragment, local);
165			current = true;
166		},
167		o(local) {
168			transition_out(textbox.$$.fragment, local);
169			current = false;
170		},
171		d(detaching) {
172			destroy_component(textbox, detaching);
173		}
174	};
175}
176
177// (59:3) <Block>
178function create_default_slot_3(ctx) {
179	let textbox;
180	let updating_value;
181	let current;
182
183	function textbox_value_binding_1(value) {
184		/*textbox_value_binding_1*/ ctx[10](value);
185	}
186
187	let textbox_props = {
188		label: "password",
189		lines: 1,
190		show_label: true,
191		max_lines: 1,
192		type: "password"
193	};
194
195	if (/*password*/ ctx[4] !== void 0) {
196		textbox_props.value = /*password*/ ctx[4];
197	}
198
199	textbox = new Textbox({ props: textbox_props });
200	binding_callbacks.push(() => bind(textbox, 'value', textbox_value_binding_1));
201	textbox.$on("submit", /*submit*/ ctx[7]);
202
203	return {
204		c() {
205			create_component(textbox.$$.fragment);
206		},
207		m(target, anchor) {
208			mount_component(textbox, target, anchor);
209			current = true;
210		},
211		p(ctx, dirty) {
212			const textbox_changes = {};
213
214			if (!updating_value && dirty & /*password*/ 16) {
215				updating_value = true;
216				textbox_changes.value = /*password*/ ctx[4];
217				add_flush_callback(() => updating_value = false);
218			}
219
220			textbox.$set(textbox_changes);
221		},
222		i(local) {
223			if (current) return;
224			transition_in(textbox.$$.fragment, local);
225			current = true;
226		},
227		o(local) {
228			transition_out(textbox.$$.fragment, local);
229			current = false;
230		},
231		d(detaching) {
232			destroy_component(textbox, detaching);
233		}
234	};
235}
236
237// (47:2) <Form>
238function create_default_slot_2(ctx) {
239	let block0;
240	let t;
241	let block1;
242	let current;
243
244	block0 = new Block({
245			props: {
246				$$slots: { default: [create_default_slot_4] },
247				$$scope: { ctx }
248			}
249		});
250
251	block1 = new Block({
252			props: {
253				$$slots: { default: [create_default_slot_3] },
254				$$scope: { ctx }
255			}
256		});
257
258	return {
259		c() {
260			create_component(block0.$$.fragment);
261			t = space();
262			create_component(block1.$$.fragment);
263		},
264		m(target, anchor) {
265			mount_component(block0, target, anchor);
266			insert(target, t, anchor);
267			mount_component(block1, target, anchor);
268			current = true;
269		},
270		p(ctx, dirty) {
271			const block0_changes = {};
272
273			if (dirty & /*$$scope, username*/ 2056) {
274				block0_changes.$$scope = { dirty, ctx };
275			}
276
277			block0.$set(block0_changes);
278			const block1_changes = {};
279
280			if (dirty & /*$$scope, password*/ 2064) {
281				block1_changes.$$scope = { dirty, ctx };
282			}
283
284			block1.$set(block1_changes);
285		},
286		i(local) {
287			if (current) return;
288			transition_in(block0.$$.fragment, local);
289			transition_in(block1.$$.fragment, local);
290			current = true;
291		},
292		o(local) {
293			transition_out(block0.$$.fragment, local);
294			transition_out(block1.$$.fragment, local);
295			current = false;
296		},
297		d(detaching) {
298			if (detaching) {
299				detach(t);
300			}
301
302			destroy_component(block0, detaching);
303			destroy_component(block1, detaching);
304		}
305	};
306}
307
308// (72:2) <BaseButton size="lg" variant="primary" on:click={submit}    >
309function create_default_slot_1(ctx) {
310	let t_value = /*$_*/ ctx[6]("login.login") + "";
311	let t;
312
313	return {
314		c() {
315			t = text(t_value);
316		},
317		m(target, anchor) {
318			insert(target, t, anchor);
319		},
320		p(ctx, dirty) {
321			if (dirty & /*$_*/ 64 && t_value !== (t_value = /*$_*/ ctx[6]("login.login") + "")) set_data(t, t_value);
322		},
323		d(detaching) {
324			if (detaching) {
325				detach(t);
326			}
327		}
328	};
329}
330
331// (34:1) <Column variant="panel" min_width={480}>
332function create_default_slot(ctx) {
333	let h2;
334	let t0_value = /*$_*/ ctx[6]("login.login") + "";
335	let t0;
336	let t1;
337	let t2;
338	let t3;
339	let t4;
340	let form;
341	let t5;
342	let basebutton;
343	let current;
344	let if_block0 = /*auth_message*/ ctx[0] && create_if_block_2(ctx);
345	let if_block1 = /*space_id*/ ctx[2] && create_if_block_1(ctx);
346	let if_block2 = /*incorrect_credentials*/ ctx[5] && create_if_block(ctx);
347
348	form = new Index$1({
349			props: {
350				$$slots: { default: [create_default_slot_2] },
351				$$scope: { ctx }
352			}
353		});
354
355	basebutton = new Button({
356			props: {
357				size: "lg",
358				variant: "primary",
359				$$slots: { default: [create_default_slot_1] },
360				$$scope: { ctx }
361			}
362		});
363
364	basebutton.$on("click", /*submit*/ ctx[7]);
365
366	return {
367		c() {
368			h2 = element("h2");
369			t0 = text(t0_value);
370			t1 = space();
371			if (if_block0) if_block0.c();
372			t2 = space();
373			if (if_block1) if_block1.c();
374			t3 = space();
375			if (if_block2) if_block2.c();
376			t4 = space();
377			create_component(form.$$.fragment);
378			t5 = space();
379			create_component(basebutton.$$.fragment);
380			attr(h2, "class", "svelte-1ogxbi0");
381		},
382		m(target, anchor) {
383			insert(target, h2, anchor);
384			append(h2, t0);
385			insert(target, t1, anchor);
386			if (if_block0) if_block0.m(target, anchor);
387			insert(target, t2, anchor);
388			if (if_block1) if_block1.m(target, anchor);
389			insert(target, t3, anchor);
390			if (if_block2) if_block2.m(target, anchor);
391			insert(target, t4, anchor);
392			mount_component(form, target, anchor);
393			insert(target, t5, anchor);
394			mount_component(basebutton, target, anchor);
395			current = true;
396		},
397		p(ctx, dirty) {
398			if ((!current || dirty & /*$_*/ 64) && t0_value !== (t0_value = /*$_*/ ctx[6]("login.login") + "")) set_data(t0, t0_value);
399
400			if (/*auth_message*/ ctx[0]) {
401				if (if_block0) {
402					if_block0.p(ctx, dirty);
403				} else {
404					if_block0 = create_if_block_2(ctx);
405					if_block0.c();
406					if_block0.m(t2.parentNode, t2);
407				}
408			} else if (if_block0) {
409				if_block0.d(1);
410				if_block0 = null;
411			}
412
413			if (/*space_id*/ ctx[2]) {
414				if (if_block1) {
415					if_block1.p(ctx, dirty);
416				} else {
417					if_block1 = create_if_block_1(ctx);
418					if_block1.c();
419					if_block1.m(t3.parentNode, t3);
420				}
421			} else if (if_block1) {
422				if_block1.d(1);
423				if_block1 = null;
424			}
425
426			if (/*incorrect_credentials*/ ctx[5]) {
427				if (if_block2) {
428					if_block2.p(ctx, dirty);
429				} else {
430					if_block2 = create_if_block(ctx);
431					if_block2.c();
432					if_block2.m(t4.parentNode, t4);
433				}
434			} else if (if_block2) {
435				if_block2.d(1);
436				if_block2 = null;
437			}
438
439			const form_changes = {};
440
441			if (dirty & /*$$scope, password, username*/ 2072) {
442				form_changes.$$scope = { dirty, ctx };
443			}
444
445			form.$set(form_changes);
446			const basebutton_changes = {};
447
448			if (dirty & /*$$scope, $_*/ 2112) {
449				basebutton_changes.$$scope = { dirty, ctx };
450			}
451
452			basebutton.$set(basebutton_changes);
453		},
454		i(local) {
455			if (current) return;
456			transition_in(form.$$.fragment, local);
457			transition_in(basebutton.$$.fragment, local);
458			current = true;
459		},
460		o(local) {
461			transition_out(form.$$.fragment, local);
462			transition_out(basebutton.$$.fragment, local);
463			current = false;
464		},
465		d(detaching) {
466			if (detaching) {
467				detach(h2);
468				detach(t1);
469				detach(t2);
470				detach(t3);
471				detach(t4);
472				detach(t5);
473			}
474
475			if (if_block0) if_block0.d(detaching);
476			if (if_block1) if_block1.d(detaching);
477			if (if_block2) if_block2.d(detaching);
478			destroy_component(form, detaching);
479			destroy_component(basebutton, detaching);
480		}
481	};
482}
483
484function create_fragment(ctx) {
485	let div;
486	let column;
487	let current;
488
489	column = new Index({
490			props: {
491				variant: "panel",
492				min_width: 480,
493				$$slots: { default: [create_default_slot] },
494				$$scope: { ctx }
495			}
496		});
497
498	return {
499		c() {
500			div = element("div");
501			create_component(column.$$.fragment);
502			attr(div, "class", "wrap svelte-1ogxbi0");
503			toggle_class(div, "min-h-screen", /*app_mode*/ ctx[1]);
504		},
505		m(target, anchor) {
506			insert(target, div, anchor);
507			mount_component(column, div, null);
508			current = true;
509		},
510		p(ctx, [dirty]) {
511			const column_changes = {};
512
513			if (dirty & /*$$scope, $_, password, username, incorrect_credentials, space_id, auth_message*/ 2173) {
514				column_changes.$$scope = { dirty, ctx };
515			}
516
517			column.$set(column_changes);
518
519			if (!current || dirty & /*app_mode*/ 2) {
520				toggle_class(div, "min-h-screen", /*app_mode*/ ctx[1]);
521			}
522		},
523		i(local) {
524			if (current) return;
525			transition_in(column.$$.fragment, local);
526			current = true;
527		},
528		o(local) {
529			transition_out(column.$$.fragment, local);
530			current = false;
531		},
532		d(detaching) {
533			if (detaching) {
534				detach(div);
535			}
536
537			destroy_component(column);
538		}
539	};
540}
541
542function instance($$self, $$props, $$invalidate) {
543	let $_;
544	component_subscribe($$self, $format, $$value => $$invalidate(6, $_ = $$value));
545	let { root } = $$props;
546	let { auth_message } = $$props;
547	let { app_mode } = $$props;
548	let { space_id } = $$props;
549	let username = "";
550	let password = "";
551	let incorrect_credentials = false;
552
553	const submit = async () => {
554		const formData = new FormData();
555		formData.append("username", username);
556		formData.append("password", password);
557		let response = await fetch(root + "/login", { method: "POST", body: formData });
558
559		if (response.status === 400) {
560			$$invalidate(5, incorrect_credentials = true);
561			$$invalidate(3, username = "");
562			$$invalidate(4, password = "");
563		} else if (response.status == 200) {
564			location.reload();
565		}
566	};
567
568	function textbox_value_binding(value) {
569		username = value;
570		$$invalidate(3, username);
571	}
572
573	function textbox_value_binding_1(value) {
574		password = value;
575		$$invalidate(4, password);
576	}
577
578	$$self.$$set = $$props => {
579		if ('root' in $$props) $$invalidate(8, root = $$props.root);
580		if ('auth_message' in $$props) $$invalidate(0, auth_message = $$props.auth_message);
581		if ('app_mode' in $$props) $$invalidate(1, app_mode = $$props.app_mode);
582		if ('space_id' in $$props) $$invalidate(2, space_id = $$props.space_id);
583	};
584
585	return [
586		auth_message,
587		app_mode,
588		space_id,
589		username,
590		password,
591		incorrect_credentials,
592		$_,
593		submit,
594		root,
595		textbox_value_binding,
596		textbox_value_binding_1
597	];
598}
599
600class Login extends SvelteComponent {
601	constructor(options) {
602		super();
603
604		init(this, options, instance, create_fragment, safe_not_equal, {
605			root: 8,
606			auth_message: 0,
607			app_mode: 1,
608			space_id: 2
609		});
610	}
611}
612
613export { Login as default };
614//# sourceMappingURL=Login-b1c4b659.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.