| 
									
										
										
										
											2024-10-17 04:06:03 +02:00
										 |  |  | import DetermineTheme from "./Logic/DetermineTheme" | 
					
						
							| 
									
										
										
										
											2025-01-23 14:27:02 +01:00
										 |  |  | import SingleThemeGui from "./UI/SingleThemeGui.svelte" | 
					
						
							|  |  |  | import CustomThemeError from "./UI/CustomThemeError.svelte" | 
					
						
							| 
									
										
										
										
											2024-01-16 23:03:33 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-18 15:59:28 +01:00
										 |  |  | async function main() { | 
					
						
							| 
									
										
										
										
											2025-01-23 13:15:52 +01:00
										 |  |  |     const target = document.getElementById("maindiv") | 
					
						
							|  |  |  |     const childs = Array.from(target.children) | 
					
						
							| 
									
										
										
										
											2024-02-18 15:59:28 +01:00
										 |  |  |     try { | 
					
						
							| 
									
										
										
										
											2025-01-23 12:30:42 +01:00
										 |  |  |         const theme = await DetermineTheme.getTheme() | 
					
						
							| 
									
										
										
										
											2025-01-23 13:03:12 +01:00
										 |  |  |         new SingleThemeGui({ | 
					
						
							| 
									
										
										
										
											2024-06-18 03:33:11 +02:00
										 |  |  |             target, | 
					
						
							| 
									
										
										
										
											2025-01-28 15:42:34 +01:00
										 |  |  |             props: { theme }, | 
					
						
							| 
									
										
										
										
											2024-06-15 02:21:18 +02:00
										 |  |  |         }) | 
					
						
							| 
									
										
										
										
											2024-06-20 04:21:29 +02:00
										 |  |  |         childs.forEach((ch) => target.removeChild(ch)) | 
					
						
							| 
									
										
										
										
											2024-04-13 02:40:21 +02:00
										 |  |  |         Array.from(document.getElementsByClassName("delete-on-load")).forEach((el) => { | 
					
						
							| 
									
										
										
										
											2024-03-21 22:39:36 +01:00
										 |  |  |             el.parentElement.removeChild(el) | 
					
						
							|  |  |  |         }) | 
					
						
							| 
									
										
										
										
											2024-02-18 15:59:28 +01:00
										 |  |  |     } catch (err) { | 
					
						
							|  |  |  |         console.error("Error while initializing: ", err, err.stack) | 
					
						
							| 
									
										
										
										
											2024-10-17 04:06:03 +02:00
										 |  |  |         const customDefinition = DetermineTheme.getCustomDefinition() | 
					
						
							| 
									
										
										
										
											2024-01-16 23:03:33 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-23 13:15:52 +01:00
										 |  |  |         new CustomThemeError({ | 
					
						
							|  |  |  |             target, | 
					
						
							|  |  |  |             props: { | 
					
						
							|  |  |  |                 stack: err.toString().split("\n"), | 
					
						
							| 
									
										
										
										
											2025-01-28 15:42:34 +01:00
										 |  |  |                 customDefinition, | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2025-01-23 13:15:52 +01:00
										 |  |  |         }) | 
					
						
							| 
									
										
										
										
											2024-02-18 15:59:28 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2023-06-26 11:11:22 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2024-02-18 15:59:28 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-13 02:40:21 +02:00
										 |  |  | main().then((_) => {}) |