{#if importing} { try { if (importText == '') { throw new Error('Import is empty') } const parsed = JSON.parse(importText) const merged = { ...defaultSettings, ...parsed } Object.assign(settings, merged) toast({ content: $t('toast.settingsImport'), type: 'success' }) importing = false } catch (err) { toast({ content: err as string, type: 'error' }) } }} title={$t('routes.theme.import')} action={$t('routes.theme.import')} > {/if} {$t('settings.title')} {$t('settings.title')} {#snippet extended()} { importText = '' importing = true }} rounding="pill" > {#snippet prefix()} {/snippet} {$t('settings.import')} { const json = JSON.stringify(settings) navigator?.clipboard?.writeText?.(json) toast({ content: $t('toast.copied') }) }} rounding="pill" > {#snippet prefix()} {/snippet} {$t('settings.export')} { modal({ title: $t('settings.reset'), body: $t('toast.resetSettings'), actions: [ action({ action: () => Object.assign(settings, defaultSettings), close: true, type: 'danger', content: $t('settings.reset'), }), action({ content: $t('common.cancel'), }), ], }) }} rounding="pill" > {#snippet prefix()} {/snippet} {$t('settings.reset')} {/snippet} {@render children?.()}