{#snippet LoadingIcon()} {#if loadingIcon}
{@render loadingIcon()}
{:else}
{/if} {/snippet}
{#if closeButton && !toast.component && toastType !== 'loading' && closeIcon !== null}
{ if (disabled || !dismissible) return; deleteToast(); toast.onDismiss?.(toast); }} class={cn(classes?.closeButton, toast?.classes?.closeButton)} > {@render closeIcon?.()}
{/if} {#if toast.component} {@const Component = toast.component}
{:else} {#if (toastType || toast.icon || toast.promise) && toast.icon !== null && (icon !== null || toast.icon)}
{#if toast.promise || toastType === 'loading'} {#if toast.icon}
{:else} {@render LoadingIcon()} {/if} {/if} {#if toast.type !== 'loading'} {#if toast.icon}
{:else if toastType === 'success'} {@render successIcon?.()} {:else if toastType === 'error'} {@render errorIcon?.()} {:else if toastType === 'warning'} {@render warningIcon?.()} {:else if toastType === 'info'} {@render infoIcon?.()} {/if} {/if}
{/if}
{#if toast.title} {#if typeof toast.title !== 'string'} {@const Title = toast.title}
{:else} {toast.title} {/if} {/if}
{#if toast.description}
{#if typeof toast.description !== 'string'} {@const Description = toast.description}
{:else} {toast.description} {/if}
{/if}
{#if toast.cancel} {#if typeof toast.cancel === 'function'}
{:else if isAction(toast.cancel)}
{ if (!isAction(toast.cancel)) return; if (!dismissible) return; toast.cancel?.onClick?.(event); deleteToast(); }} > {toast.cancel.label}
{/if} {/if} {#if toast.action} {#if typeof toast.action === 'function'}
{:else if isAction(toast.action)}
{ if (!isAction(toast.action)) return; toast.action?.onClick(event); if (event.defaultPrevented) return; deleteToast(); }} > {toast.action.label}
{/if} {/if} {/if}