import { For, Show, createEffect, createMemo, createSignal, mergeProps, on, onCleanup, onMount } from "solid-js";
import { createStore, produce, reconcile } from "solid-js/store";
//#region src/styles.css?inline
var styles_default = "html[dir=\"ltr\"], [data-sonner-toaster][dir=\"ltr\"] {\n  --toast-icon-margin-start: -3px;\n  --toast-icon-margin-end: 4px;\n  --toast-svg-margin-start: -1px;\n  --toast-svg-margin-end: 0px;\n  --toast-button-margin-start: auto;\n  --toast-button-margin-end: 0;\n  --toast-close-button-start: 0;\n  --toast-close-button-end: unset;\n  --toast-close-button-transform: translate(-35%, -35%);\n}\n\nhtml[dir=\"rtl\"], [data-sonner-toaster][dir=\"rtl\"] {\n  --toast-icon-margin-start: 4px;\n  --toast-icon-margin-end: -3px;\n  --toast-svg-margin-start: 0px;\n  --toast-svg-margin-end: -1px;\n  --toast-button-margin-start: 0;\n  --toast-button-margin-end: auto;\n  --toast-close-button-start: unset;\n  --toast-close-button-end: 0;\n  --toast-close-button-transform: translate(35%, -35%);\n}\n\n[data-sonner-toaster] {\n  width: var(--width);\n  --gray1: #fcfcfc;\n  --gray2: #f8f8f8;\n  --gray3: #f3f3f3;\n  --gray4: #ededed;\n  --gray5: #e8e8e8;\n  --gray6: #e2e2e2;\n  --gray7: #dbdbdb;\n  --gray8: #c7c7c7;\n  --gray9: #8f8f8f;\n  --gray10: #858585;\n  --gray11: #6f6f6f;\n  --gray12: #171717;\n  --border-radius: 8px;\n  box-sizing: border-box;\n  z-index: 999999999;\n  outline: none;\n  margin: 0;\n  padding: 0;\n  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n  list-style: none;\n  transition: transform .4s;\n  position: fixed;\n}\n\n@media (hover: none) and (pointer: coarse) {\n  [data-sonner-toaster][data-lifted=\"true\"] {\n    transform: none;\n  }\n}\n\n[data-sonner-toaster][data-x-position=\"right\"] {\n  right: var(--offset-right);\n}\n\n[data-sonner-toaster][data-x-position=\"left\"] {\n  left: var(--offset-left);\n}\n\n[data-sonner-toaster][data-x-position=\"center\"] {\n  left: 50%;\n  transform: translateX(-50%);\n}\n\n[data-sonner-toaster][data-y-position=\"top\"] {\n  top: var(--offset-top);\n}\n\n[data-sonner-toaster][data-y-position=\"bottom\"] {\n  bottom: var(--offset-bottom);\n}\n\n[data-sonner-toast] {\n  --y: translateY(100%);\n  --lift-amount: calc(var(--lift) * var(--gap));\n  z-index: var(--z-index);\n  opacity: 0;\n  transform: var(--y);\n  touch-action: none;\n  box-sizing: border-box;\n  overflow-wrap: anywhere;\n  outline: none;\n  transition: transform .4s, opacity .4s, height .4s, box-shadow .2s;\n  position: absolute;\n}\n\n[data-sonner-toast][data-styled=\"true\"] {\n  background: var(--normal-bg);\n  border: 1px solid var(--normal-border);\n  color: var(--normal-text);\n  border-radius: var(--border-radius);\n  width: var(--width);\n  align-items: center;\n  gap: 6px;\n  padding: 16px;\n  font-size: 13px;\n  display: flex;\n  box-shadow: 0 4px 12px #0000001a;\n}\n\n[data-sonner-toast]:focus-visible {\n  box-shadow: 0 4px 12px #0000001a, 0 0 0 2px #0003;\n}\n\n[data-sonner-toast][data-y-position=\"top\"] {\n  --y: translateY(-100%);\n  --lift: 1;\n  --lift-amount: calc(1 * var(--gap));\n  top: 0;\n}\n\n[data-sonner-toast][data-y-position=\"bottom\"] {\n  --y: translateY(100%);\n  --lift: -1;\n  --lift-amount: calc(var(--lift) * var(--gap));\n  bottom: 0;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-description] {\n  color: #3f3f3f;\n  font-weight: 400;\n  line-height: 1.4;\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-styled=\"true\"] [data-description] {\n  color: inherit;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-description] {\n  color: #e8e8e8;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-title] {\n  color: inherit;\n  font-weight: 500;\n  line-height: 1.5;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-icon] {\n  width: 16px;\n  height: 16px;\n  margin-left: var(--toast-icon-margin-start);\n  margin-right: var(--toast-icon-margin-end);\n  flex-shrink: 0;\n  justify-content: flex-start;\n  align-items: center;\n  display: flex;\n  position: relative;\n}\n\n[data-sonner-toast][data-promise=\"true\"] [data-icon] > svg {\n  opacity: 0;\n  transform-origin: center;\n  animation: .3s forwards sonner-fade-in;\n  transform: scale(.8);\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-icon] > * {\n  flex-shrink: 0;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-icon] svg {\n  margin-left: var(--toast-svg-margin-start);\n  margin-right: var(--toast-svg-margin-end);\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-content] {\n  flex-direction: column;\n  flex: 1;\n  gap: 2px;\n  min-width: 0;\n  display: flex;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-button] {\n  height: 24px;\n  color: var(--normal-bg);\n  background: var(--normal-text);\n  margin-left: var(--toast-button-margin-start);\n  margin-right: var(--toast-button-margin-end);\n  cursor: pointer;\n  border: none;\n  border-radius: 4px;\n  outline: none;\n  flex-shrink: 0;\n  align-items: center;\n  padding-left: 8px;\n  padding-right: 8px;\n  font-size: 12px;\n  font-weight: 500;\n  transition: opacity .4s, box-shadow .2s;\n  display: flex;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-button]:focus-visible {\n  box-shadow: 0 0 0 2px #0006;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-button]:first-of-type {\n  margin-left: var(--toast-button-margin-start);\n  margin-right: var(--toast-button-margin-end);\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-cancel] {\n  color: var(--normal-text);\n  background: #00000014;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast][data-styled=\"true\"] [data-cancel] {\n  background: #ffffff4d;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-close-button] {\n  left: var(--toast-close-button-start);\n  right: var(--toast-close-button-end);\n  width: 20px;\n  height: 20px;\n  color: var(--normal-text);\n  background: var(--normal-bg);\n  border: 1px solid var(--normal-border);\n  transform: var(--toast-close-button-transform);\n  cursor: pointer;\n  z-index: 1;\n  border-radius: 50%;\n  justify-content: center;\n  align-items: center;\n  padding: 0;\n  transition: opacity .1s, background .2s, border-color .2s;\n  display: flex;\n  position: absolute;\n  top: 0;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-close-button]:focus-visible {\n  box-shadow: 0 4px 12px #0000001a, 0 0 0 2px #0003;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-disabled=\"true\"] {\n  cursor: not-allowed;\n}\n\n[data-sonner-toast][data-styled=\"true\"]:hover [data-close-button]:hover {\n  background: var(--gray2);\n  border-color: var(--gray5);\n}\n\n[data-sonner-toast][data-swiping=\"true\"]:before {\n  content: \"\";\n  z-index: -1;\n  height: 100%;\n  position: absolute;\n  left: -100%;\n  right: -100%;\n}\n\n[data-sonner-toast][data-y-position=\"top\"][data-swiping=\"true\"]:before {\n  bottom: 50%;\n  transform: scaleY(3) translateY(50%);\n}\n\n[data-sonner-toast][data-y-position=\"bottom\"][data-swiping=\"true\"]:before {\n  top: 50%;\n  transform: scaleY(3) translateY(-50%);\n}\n\n[data-sonner-toast][data-swiping=\"false\"][data-removed=\"true\"]:before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  transform: scaleY(2);\n}\n\n[data-sonner-toast][data-expanded=\"true\"]:after {\n  content: \"\";\n  height: calc(var(--gap) + 1px);\n  width: 100%;\n  position: absolute;\n  bottom: 100%;\n  left: 0;\n}\n\n[data-sonner-toast][data-mounted=\"true\"] {\n  --y: translateY(0);\n  opacity: 1;\n}\n\n[data-sonner-toast][data-expanded=\"false\"][data-front=\"false\"] {\n  --scale: var(--toasts-before) * .05 + 1;\n  --y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));\n  height: var(--front-toast-height);\n}\n\n[data-sonner-toast] > * {\n  transition: opacity .4s;\n}\n\n[data-sonner-toast][data-x-position=\"right\"] {\n  right: 0;\n}\n\n[data-sonner-toast][data-x-position=\"left\"] {\n  left: 0;\n}\n\n[data-sonner-toast][data-expanded=\"false\"][data-front=\"false\"][data-styled=\"true\"] > * {\n  opacity: 0;\n}\n\n[data-sonner-toast][data-visible=\"false\"] {\n  opacity: 0;\n  pointer-events: none;\n}\n\n[data-sonner-toast][data-mounted=\"true\"][data-expanded=\"true\"] {\n  --y: translateY(calc(var(--lift) * var(--offset)));\n  height: var(--initial-height);\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"true\"][data-swipe-out=\"false\"] {\n  --y: translateY(calc(var(--lift) * -100%));\n  opacity: 0;\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"false\"][data-swipe-out=\"false\"][data-expanded=\"true\"] {\n  --y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));\n  opacity: 0;\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"false\"][data-swipe-out=\"false\"][data-expanded=\"false\"] {\n  --y: translateY(40%);\n  opacity: 0;\n  transition: transform .5s, opacity .2s;\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"false\"]:before {\n  height: calc(var(--initial-height) + 20%);\n}\n\n[data-sonner-toast][data-swiping=\"true\"] {\n  transform: var(--y) translateY(var(--swipe-amount-y, 0px)) translateX(var(--swipe-amount-x, 0px));\n  transition: none;\n}\n\n[data-sonner-toast][data-swiped=\"true\"] {\n  -webkit-user-select: none;\n  user-select: none;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-y-position=\"bottom\"], [data-sonner-toast][data-swipe-out=\"true\"][data-y-position=\"top\"] {\n  animation-duration: .2s;\n  animation-timing-function: ease-out;\n  animation-fill-mode: forwards;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"left\"] {\n  animation-name: swipe-out-left;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"right\"] {\n  animation-name: swipe-out-right;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"up\"] {\n  animation-name: swipe-out-up;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"down\"] {\n  animation-name: swipe-out-down;\n}\n\n@keyframes swipe-out-left {\n  from {\n    transform: var(--y) translateX(var(--swipe-amount-x));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateX(calc(var(--swipe-amount-x) - 100%));\n    opacity: 0;\n  }\n}\n\n@keyframes swipe-out-right {\n  from {\n    transform: var(--y) translateX(var(--swipe-amount-x));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateX(calc(var(--swipe-amount-x) + 100%));\n    opacity: 0;\n  }\n}\n\n@keyframes swipe-out-up {\n  from {\n    transform: var(--y) translateY(var(--swipe-amount-y));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateY(calc(var(--swipe-amount-y) - 100%));\n    opacity: 0;\n  }\n}\n\n@keyframes swipe-out-down {\n  from {\n    transform: var(--y) translateY(var(--swipe-amount-y));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateY(calc(var(--swipe-amount-y) + 100%));\n    opacity: 0;\n  }\n}\n\n@media (width <= 600px) {\n  [data-sonner-toaster] {\n    right: var(--mobile-offset-right);\n    left: var(--mobile-offset-left);\n    width: 100%;\n    position: fixed;\n  }\n\n  [data-sonner-toaster][dir=\"rtl\"] {\n    left: calc(var(--mobile-offset-left) * -1);\n  }\n\n  [data-sonner-toaster] [data-sonner-toast] {\n    width: calc(100% - var(--mobile-offset-left) * 2);\n    left: 0;\n    right: 0;\n  }\n\n  [data-sonner-toaster][data-x-position=\"left\"] {\n    left: var(--mobile-offset-left);\n  }\n\n  [data-sonner-toaster][data-y-position=\"bottom\"] {\n    bottom: var(--mobile-offset-bottom);\n  }\n\n  [data-sonner-toaster][data-y-position=\"top\"] {\n    top: var(--mobile-offset-top);\n  }\n\n  [data-sonner-toaster][data-x-position=\"center\"] {\n    left: var(--mobile-offset-left);\n    right: var(--mobile-offset-right);\n    transform: none;\n  }\n}\n\n[data-sonner-toaster][data-sonner-theme=\"light\"] {\n  --normal-bg: #fff;\n  --normal-border: var(--gray4);\n  --normal-text: var(--gray12);\n  --success-bg: #ecfdf3;\n  --success-border: #bffcd9;\n  --success-text: #008a2e;\n  --info-bg: #f0f8ff;\n  --info-border: #dde7fd;\n  --info-text: #0973dc;\n  --warning-bg: #fffcf0;\n  --warning-border: #fbeeb1;\n  --warning-text: #dc7609;\n  --error-bg: #fff0f0;\n  --error-border: #ffe0e1;\n  --error-text: #e60000;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"light\"] [data-sonner-toast][data-invert=\"true\"] {\n  --normal-bg: #000;\n  --normal-border: #333;\n  --normal-text: var(--gray1);\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast][data-invert=\"true\"] {\n  --normal-bg: #fff;\n  --normal-border: var(--gray3);\n  --normal-text: var(--gray12);\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] {\n  --normal-bg: #000;\n  --normal-bg-hover: #1f1f1f;\n  --normal-border: #333;\n  --normal-border-hover: #404040;\n  --normal-text: var(--gray1);\n  --success-bg: #001f0f;\n  --success-border: #003d1c;\n  --success-text: #59f3a6;\n  --info-bg: #000d1f;\n  --info-border: #19233e;\n  --info-text: #5896f3;\n  --warning-bg: #1d1f00;\n  --warning-border: #2e2e00;\n  --warning-text: #f3cf58;\n  --error-bg: #2d0607;\n  --error-border: #4d0408;\n  --error-text: #ff9ea1;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast] [data-close-button] {\n  background: var(--normal-bg);\n  border-color: var(--normal-border);\n  color: var(--normal-text);\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast] [data-close-button]:hover {\n  background: var(--normal-bg-hover);\n  border-color: var(--normal-border-hover);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"success\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"success\"] [data-close-button] {\n  background: var(--success-bg);\n  border-color: var(--success-border);\n  color: var(--success-text);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"info\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"info\"] [data-close-button] {\n  background: var(--info-bg);\n  border-color: var(--info-border);\n  color: var(--info-text);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"warning\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"warning\"] [data-close-button] {\n  background: var(--warning-bg);\n  border-color: var(--warning-border);\n  color: var(--warning-text);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"error\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"error\"] [data-close-button] {\n  background: var(--error-bg);\n  border-color: var(--error-border);\n  color: var(--error-text);\n}\n\n.sonner-loading-wrapper {\n  --size: 16px;\n  height: var(--size);\n  width: var(--size);\n  z-index: 10;\n  position: absolute;\n  inset: 0;\n}\n\n.sonner-loading-wrapper[data-visible=\"false\"] {\n  transform-origin: center;\n  animation: .2s forwards sonner-fade-out;\n}\n\n.sonner-spinner {\n  height: var(--size);\n  width: var(--size);\n  position: relative;\n  top: 50%;\n  left: 50%;\n}\n\n.sonner-loading-bar {\n  background: var(--gray11);\n  border-radius: 6px;\n  width: 24%;\n  height: 8%;\n  animation: 1.2s linear infinite sonner-spin;\n  position: absolute;\n  top: -3.9%;\n  left: -10%;\n}\n\n.sonner-loading-bar:first-child {\n  animation-delay: -1.2s;\n  transform: rotate(.0001deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(2) {\n  animation-delay: -1.1s;\n  transform: rotate(30deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(3) {\n  animation-delay: -1s;\n  transform: rotate(60deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(4) {\n  animation-delay: -.9s;\n  transform: rotate(90deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(5) {\n  animation-delay: -.8s;\n  transform: rotate(120deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(6) {\n  animation-delay: -.7s;\n  transform: rotate(150deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(7) {\n  animation-delay: -.6s;\n  transform: rotate(180deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(8) {\n  animation-delay: -.5s;\n  transform: rotate(210deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(9) {\n  animation-delay: -.4s;\n  transform: rotate(240deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(10) {\n  animation-delay: -.3s;\n  transform: rotate(270deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(11) {\n  animation-delay: -.2s;\n  transform: rotate(300deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(12) {\n  animation-delay: -.1s;\n  transform: rotate(330deg) translate(146%);\n}\n\n@keyframes sonner-fade-in {\n  0% {\n    opacity: 0;\n    transform: scale(.8);\n  }\n\n  100% {\n    opacity: 1;\n    transform: scale(1);\n  }\n}\n\n@keyframes sonner-fade-out {\n  0% {\n    opacity: 1;\n    transform: scale(1);\n  }\n\n  100% {\n    opacity: 0;\n    transform: scale(.8);\n  }\n}\n\n@keyframes sonner-spin {\n  0% {\n    opacity: 1;\n  }\n\n  100% {\n    opacity: .15;\n  }\n}\n\n@media (prefers-reduced-motion) {\n  [data-sonner-toast], [data-sonner-toast] > *, .sonner-loading-bar {\n    transition: none !important;\n    animation: none !important;\n  }\n}\n\n.sonner-loader {\n  transform-origin: center;\n  transition: opacity .2s, transform .2s;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.sonner-loader[data-visible=\"false\"] {\n  opacity: 0;\n  transform: scale(.8) translate(-50%, -50%);\n}\n";
//#endregion
//#region src/assets.tsx
const bars = Array(12).fill(0);
function Loader(props) {
	return <div class={["sonner-loading-wrapper", props.class ?? props.className].filter(Boolean).join(" ")} data-visible={props.visible}>
      <div class="sonner-spinner">
        <For each={bars}>{(_, i) => <div class="sonner-loading-bar" data-index={i()} />}</For>
      </div>
    </div>;
}
function SuccessIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
    </svg>;
}
function WarningIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" clip-rule="evenodd" />
    </svg>;
}
function InfoIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd" />
    </svg>;
}
function ErrorIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" />
    </svg>;
}
function getAsset(type) {
	switch (type) {
		case "success": return <SuccessIcon />;
		case "info": return <InfoIcon />;
		case "warning": return <WarningIcon />;
		case "error": return <ErrorIcon />;
		default: return null;
	}
}
function CloseIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
      <line x1="18" y1="6" x2="6" y2="18" />
      <line x1="6" y1="6" x2="18" y2="18" />
    </svg>;
}
//#endregion
//#region src/primitives.ts
function useIsDocumentHidden() {
	const [isDocumentHidden, setIsDocumentHidden] = createSignal(typeof document !== "undefined" ? document.hidden : false);
	onMount(() => {
		const callback = () => {
			setIsDocumentHidden(document.hidden);
		};
		document.addEventListener("visibilitychange", callback);
		onCleanup(() => {
			document.removeEventListener("visibilitychange", callback);
		});
	});
	return isDocumentHidden;
}
//#endregion
//#region src/state.ts
let toastsCounter = 1;
const MAX_HISTORY_SIZE = 100;
function getToastId(data) {
	return typeof data?.id === "number" || typeof data?.id === "string" && data.id.length > 0 ? data.id : toastsCounter++;
}
var Observer = class {
	subscribers;
	toasts;
	dismissedToasts;
	pendingDismissals;
	constructor() {
		this.subscribers = [];
		this.toasts = [];
		this.dismissedToasts = /* @__PURE__ */ new Set();
		this.pendingDismissals = /* @__PURE__ */ new Map();
	}
	subscribe = (subscriber) => {
		this.subscribers.push(subscriber);
		this.getActiveToasts().forEach((toast) => subscriber(toast));
		return () => {
			const index = this.subscribers.indexOf(subscriber);
			this.subscribers.splice(index, 1);
		};
	};
	publish = (data) => {
		this.subscribers.forEach((subscriber) => subscriber(data));
	};
	addToast = (data) => {
		this.publish(data);
		this.toasts = [...this.toasts, data];
		this.trimHistory();
	};
	trimHistory = () => {
		let toRemove = this.toasts.length - MAX_HISTORY_SIZE;
		if (toRemove <= 0) return;
		this.toasts = this.toasts.filter((toast) => {
			if (toRemove > 0 && this.dismissedToasts.has(toast.id)) {
				this.dismissedToasts.delete(toast.id);
				toRemove--;
				return false;
			}
			return true;
		});
	};
	create = (data) => {
		const { message, ...rest } = data;
		const id = getToastId(data);
		const pendingDismissal = this.pendingDismissals.get(id);
		if (pendingDismissal !== void 0) {
			cancelAnimationFrame(pendingDismissal);
			this.pendingDismissals.delete(id);
			this.dismissedToasts.delete(id);
		}
		const wasDismissed = this.dismissedToasts.has(id);
		const dismissible = data.dismissible === void 0 ? true : data.dismissible;
		if (wasDismissed) {
			this.dismissedToasts.delete(id);
			this.toasts = this.toasts.filter((toast) => toast.id !== id);
		}
		if (wasDismissed ? void 0 : this.toasts.find((toast) => {
			return toast.id === id;
		})) this.toasts = this.toasts.map((toast) => {
			if (toast.id === id) {
				this.publish({
					...toast,
					...data,
					id,
					title: message,
					dismissible
				});
				return {
					...toast,
					...data,
					id,
					dismissible,
					title: message
				};
			}
			return toast;
		});
		else this.addToast({
			title: message,
			...rest,
			dismissible,
			id
		});
		return id;
	};
	dismiss = (id) => {
		if (id === void 0 || id === null) {
			this.getActiveToasts().forEach((toast) => {
				this.dismissedToasts.add(toast.id);
				this.subscribers.forEach((subscriber) => subscriber({
					id: toast.id,
					dismiss: true
				}));
			});
			return id;
		}
		this.dismissedToasts.add(id);
		const alreadyPending = this.pendingDismissals.get(id);
		if (alreadyPending !== void 0) cancelAnimationFrame(alreadyPending);
		this.pendingDismissals.set(id, requestAnimationFrame(() => {
			this.pendingDismissals.delete(id);
			this.subscribers.forEach((subscriber) => subscriber({
				id,
				dismiss: true
			}));
		}));
		return id;
	};
	message = (message, data) => {
		return this.create({
			...data,
			message,
			type: void 0
		});
	};
	error = (message, data) => {
		return this.create({
			...data,
			message,
			type: "error"
		});
	};
	success = (message, data) => {
		return this.create({
			...data,
			type: "success",
			message
		});
	};
	info = (message, data) => {
		return this.create({
			...data,
			type: "info",
			message
		});
	};
	warning = (message, data) => {
		return this.create({
			...data,
			type: "warning",
			message
		});
	};
	loading = (message, data) => {
		return this.create({
			...data,
			type: "loading",
			message
		});
	};
	promise = (promise, data) => {
		if (!data) return;
		let id;
		if (data.loading !== void 0) id = this.create({
			...data,
			promise,
			type: "loading",
			message: data.loading,
			description: typeof data.description !== "function" ? data.description : void 0
		});
		const p = Promise.resolve(typeof promise === "function" ? promise() : promise);
		let shouldDismiss = id !== void 0;
		let result;
		const originalPromise = p.then(async (response) => {
			result = ["resolve", response];
			if (isValidElement(response)) {
				shouldDismiss = false;
				this.create({
					id,
					type: "default",
					message: response
				});
			} else if (isHttpResponse(response) && !response.ok) {
				shouldDismiss = false;
				const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
				const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "error",
					description,
					...toastSettings
				});
			} else if (response instanceof Error) {
				shouldDismiss = false;
				const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
				const description = typeof data.description === "function" ? await data.description(response) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "error",
					description,
					...toastSettings
				});
			} else if (data.success !== void 0) {
				shouldDismiss = false;
				const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
				const description = typeof data.description === "function" ? await data.description(response) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "success",
					description,
					...toastSettings
				});
			}
		}).catch(async (error) => {
			result = ["reject", error];
			if (data.error !== void 0) {
				shouldDismiss = false;
				const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
				const description = typeof data.description === "function" ? await data.description(error) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "error",
					description,
					...toastSettings
				});
			}
		}).finally(() => {
			if (shouldDismiss) {
				this.dismiss(id);
				id = void 0;
			}
			data.finally?.();
		});
		const unwrap = () => new Promise((resolve, reject) => {
			originalPromise.then(() => {
				if (result[0] === "reject") reject(result[1]);
				else resolve(result[1]);
			}).catch(reject);
		});
		if (typeof id !== "string" && typeof id !== "number") return { unwrap };
		return Object.assign(id, { unwrap });
	};
	custom = (jsx, data) => {
		const id = getToastId(data);
		this.create({
			...data,
			jsx: jsx(id),
			id,
			type: void 0
		});
		return id;
	};
	getActiveToasts = () => {
		return this.toasts.filter((toast) => !this.dismissedToasts.has(toast.id));
	};
};
function isHttpResponse(data) {
	return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
}
function isExtendedResult(value) {
	return typeof value === "object" && value !== null && "message" in value;
}
function isValidElement(value) {
	return typeof Node !== "undefined" && value instanceof Node;
}
const ToastState = new Observer();
function toastFunction(message, data) {
	return ToastState.message(message, data);
}
const basicToast = toastFunction;
const getHistory = () => ToastState.toasts;
const getToasts = () => ToastState.getActiveToasts();
const toast = Object.assign(basicToast, {
	success: ToastState.success,
	info: ToastState.info,
	warning: ToastState.warning,
	error: ToastState.error,
	custom: ToastState.custom,
	message: ToastState.message,
	promise: ToastState.promise,
	dismiss: ToastState.dismiss,
	loading: ToastState.loading
}, {
	getHistory,
	getToasts
});
//#endregion
//#region src/types.ts
function isAction(action) {
	return typeof action === "object" && action !== null && "label" in action;
}
//#endregion
//#region src/index.tsx
/*!
* Original code by Emil Kowalski
* MIT Licensed, Copyright 2023 Emil Kowalski, see https://github.com/emilkowalski/sonner/blob/main/LICENSE.md for details
*
* Credits:
* https://github.com/emilkowalski/sonner/blob/main/src/index.tsx
*/
if (typeof document !== "undefined" && !document.querySelector("style[data-sonner]")) {
	const styleTag = document.createElement("style");
	styleTag.setAttribute("data-sonner", "");
	styleTag.textContent = styles_default;
	document.head.appendChild(styleTag);
}
const VISIBLE_TOASTS_AMOUNT = 3;
const VIEWPORT_OFFSET = "24px";
const MOBILE_VIEWPORT_OFFSET = "16px";
const TOAST_LIFETIME = 4e3;
const TOAST_WIDTH = 356;
const GAP = 14;
const SWIPE_THRESHOLD = 45;
const TIME_BEFORE_UNMOUNT = 200;
function cn(...classes) {
	return classes.filter(Boolean).join(" ");
}
function resolveContent(content) {
	return typeof content === "function" ? content() : content;
}
function getDefaultSwipeDirections(position) {
	const [y, x] = position.split("-");
	const directions = [];
	if (y) directions.push(y);
	if (x) directions.push(x);
	return directions;
}
function getDocumentDirection() {
	if (typeof window === "undefined" || typeof document === "undefined") return "ltr";
	const dirAttribute = document.documentElement.getAttribute("dir");
	if (dirAttribute === "auto" || !dirAttribute) return window.getComputedStyle(document.documentElement).direction;
	return dirAttribute;
}
function assignOffset(defaultOffset, mobileOffset) {
	const styles = {};
	[defaultOffset, mobileOffset].forEach((offset, index) => {
		const isMobile = index === 1;
		const prefix = isMobile ? "--mobile-offset" : "--offset";
		const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
		const assignAll = (value) => {
			for (const key of [
				"top",
				"right",
				"bottom",
				"left"
			]) styles[`${prefix}-${key}`] = typeof value === "number" ? `${value}px` : value;
		};
		if (typeof offset === "number" || typeof offset === "string") {
			assignAll(offset);
			return;
		}
		if (typeof offset === "object" && offset !== null) {
			for (const key of [
				"top",
				"right",
				"bottom",
				"left"
			]) {
				const value = offset[key];
				styles[`${prefix}-${key}`] = value === void 0 ? defaultValue : typeof value === "number" ? `${value}px` : value;
			}
			return;
		}
		assignAll(defaultValue);
	});
	return styles;
}
function mergeClassNames(classNames, legacy) {
	return classNames ?? legacy;
}
function mergeDescriptionClassName(descriptionClassName, legacy) {
	return descriptionClassName ?? legacy ?? "";
}
function mergeClassName(className, legacy) {
	return className ?? legacy ?? "";
}
function useSonner() {
	const [activeToasts, setActiveToasts] = createSignal([]);
	onMount(() => {
		const unsubscribe = ToastState.subscribe((toastItem) => {
			if (toastItem.dismiss) {
				requestAnimationFrame(() => {
					setActiveToasts((toasts) => toasts.filter((t) => t.id !== toastItem.id));
				});
				return;
			}
			const nextToast = toastItem;
			setActiveToasts((toasts) => {
				const indexOfExistingToast = toasts.findIndex((t) => t.id === nextToast.id);
				if (indexOfExistingToast !== -1) return [
					...toasts.slice(0, indexOfExistingToast),
					{
						...toasts[indexOfExistingToast],
						...nextToast
					},
					...toasts.slice(indexOfExistingToast + 1)
				];
				return [nextToast, ...toasts];
			});
		});
		onCleanup(unsubscribe);
	});
	return { toasts: activeToasts };
}
function createToastTheme(theme) {
	return theme !== "system" ? theme : typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
}
function Toast(props) {
	const [mounted, setMounted] = createSignal(false);
	const [removed, setRemoved] = createSignal(false);
	const [swiping, setSwiping] = createSignal(false);
	const [swipeOut, setSwipeOut] = createSignal(false);
	const [isSwiped, setIsSwiped] = createSignal(false);
	const [swipeDirection, setSwipeDirection] = createSignal(null);
	const [swipeOutDirection, setSwipeOutDirection] = createSignal(null);
	const [offsetBeforeRemove, setOffsetBeforeRemove] = createSignal(0);
	const [initialHeight, setInitialHeight] = createSignal(0);
	let toastRef;
	let dragStartTime = null;
	let closeTimerStartTimeRef = 0;
	let lastCloseTimerStartTimeRef = 0;
	let remainingTime = TOAST_LIFETIME;
	const [pointerStartRef, setPointerStartRef] = createSignal(null);
	const isFront = () => props.index === 0;
	const isVisible = () => props.index + 1 <= props.visibleToasts;
	const toastType = () => props.toast.type;
	const dismissible = () => props.toast.dismissible !== false;
	const classNames = () => mergeClassNames(props.classNames, props.classes);
	const className = () => mergeClassName(props.className, props.class);
	const descriptionClassName = () => mergeDescriptionClassName(props.descriptionClassName, props.descriptionClass);
	const toastClassName = () => mergeClassName(props.toast.className, props.toast.class);
	const toastDescriptionClassName = () => mergeDescriptionClassName(props.toast.descriptionClassName, props.toast.descriptionClass);
	const toastClassNames = () => mergeClassNames(props.toast.classNames, props.toast.classes);
	const closeButton = () => props.toast.closeButton ?? props.closeButton;
	const duration = () => props.toast.duration ?? props.duration ?? TOAST_LIFETIME;
	const invert = () => props.toast.invert ?? props.invert;
	const disabled = () => toastType() === "loading";
	const toastTypeKey = () => toastType() ?? "default";
	const swipeDirections = () => props.swipeDirections ?? getDefaultSwipeDirections(props.position);
	const y = createMemo(() => props.position.split("-")[0]);
	const x = createMemo(() => props.position.split("-")[1]);
	const heightIndex = createMemo(() => Math.max(0, props.heights.findIndex((height) => height.toastId === props.toast.id)));
	const toastsHeightBefore = createMemo(() => {
		return props.heights.reduce((prev, curr, reducerIndex) => {
			if (reducerIndex >= heightIndex()) return prev;
			return prev + curr.height;
		}, 0);
	});
	const offset = createMemo(() => heightIndex() * (props.gap ?? GAP) + toastsHeightBefore());
	const isDocumentHidden = useIsDocumentHidden();
	createEffect(() => {
		remainingTime = duration();
	});
	function deleteToast() {
		setRemoved(true);
		setOffsetBeforeRemove(offset());
		props.setHeights((heights) => heights.filter((height) => height.toastId !== props.toast.id));
		window.setTimeout(() => {
			props.removeToast(props.toast);
		}, TIME_BEFORE_UNMOUNT);
	}
	function getLoadingIcon() {
		if (props.icons?.loading) return <div class={cn(classNames()?.loader, toastClassNames()?.loader, "sonner-loader")} data-visible={toastType() === "loading"}>
          {props.icons.loading}
        </div>;
		return <Loader class={cn(classNames()?.loader, toastClassNames()?.loader)} visible={toastType() === "loading"} />;
	}
	const icon = () => props.toast.icon ?? props.icons?.[toastType()] ?? getAsset(toastType());
	onMount(() => {
		setMounted(true);
	});
	createEffect(() => {
		if (!mounted() || true) return;
		resolveContent(props.toast.title);
		resolveContent(props.toast.description);
		const originalHeight = toastRef.style.height;
		toastRef.style.height = "auto";
		const nextHeight = toastRef.getBoundingClientRect().height;
		toastRef.style.height = originalHeight;
		setInitialHeight(nextHeight);
		props.setHeights((heights) => {
			if (!heights.find((height) => height.toastId === props.toast.id)) return [{
				toastId: props.toast.id,
				toasterId: props.toast.toasterId,
				height: nextHeight,
				position: props.toast.position
			}, ...heights];
			return heights.map((height) => height.toastId === props.toast.id ? {
				...height,
				height: nextHeight
			} : height);
		});
	});
	createEffect(on(() => [
		props.expanded,
		props.interacting,
		props.toast,
		toastType(),
		isDocumentHidden(),
		duration()
	], ([expanded, interacting, currentToast, currentType]) => {
		if (currentToast.promise && currentType === "loading" || currentToast.duration === Number.POSITIVE_INFINITY || currentType === "loading") return;
		let timeoutId;
		const pauseTimer = () => {
			if (lastCloseTimerStartTimeRef < closeTimerStartTimeRef) {
				const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef;
				remainingTime -= elapsedTime;
			}
			lastCloseTimerStartTimeRef = (/* @__PURE__ */ new Date()).getTime();
		};
		const startTimer = () => {
			if (remainingTime === Number.POSITIVE_INFINITY) return;
			closeTimerStartTimeRef = (/* @__PURE__ */ new Date()).getTime();
			timeoutId = setTimeout(() => {
				currentToast.onAutoClose?.(currentToast);
				deleteToast();
			}, remainingTime);
		};
		if (expanded || interacting || (props.pauseWhenPageIsHidden ?? true) && isDocumentHidden()) pauseTimer();
		else startTimer();
		onCleanup(() => {
			if (timeoutId) clearTimeout(timeoutId);
		});
	}));
	createEffect(on(() => props.toast.delete, (shouldDelete) => {
		if (shouldDelete) {
			deleteToast();
			props.toast.onDismiss?.(props.toast);
		}
	}));
	return <li tabIndex={0} ref={toastRef} class={cn(className(), toastClassName(), classNames()?.toast, toastClassNames()?.toast, classNames()?.[toastTypeKey()], toastClassNames()?.[toastTypeKey()])} data-sonner-toast="" data-rich-colors={props.toast.richColors ?? props.defaultRichColors} data-styled={!(props.toast.jsx || props.toast.unstyled || props.unstyled)} data-mounted={mounted()} data-promise={Boolean(props.toast.promise)} data-swiped={isSwiped()} data-removed={removed()} data-visible={isVisible()} data-y-position={y()} data-x-position={x()} data-index={props.index} data-front={isFront()} data-swiping={swiping()} data-dismissible={dismissible()} data-type={toastType()} data-invert={invert()} data-swipe-out={swipeOut()} data-swipe-direction={swipeOutDirection()} data-expanded={Boolean(props.expanded || props.expandByDefault && mounted())} data-testid={props.toast.testId} style={{
		"--index": props.index,
		"--toasts-before": props.index,
		"--z-index": props.toasts.length - props.index,
		"--offset": `${removed() ? offsetBeforeRemove() : offset()}px`,
		"--initial-height": props.expandByDefault ? "auto" : `${initialHeight()}px`,
		...props.style,
		...props.toast.style
	}} onDragEnd={() => {
		setSwiping(false);
		setSwipeDirection(null);
		setPointerStartRef(null);
	}} onPointerDown={(event) => {
		if (event.button === 2) return;
		if (disabled() || !dismissible()) return;
		if (event.target.closest("button")) return;
		dragStartTime = /* @__PURE__ */ new Date();
		setOffsetBeforeRemove(offset());
		event.currentTarget.setPointerCapture(event.pointerId);
		setSwiping(true);
		setPointerStartRef({
			x: event.clientX,
			y: event.clientY
		});
	}} onPointerUp={() => {
		if (swipeOut() || !dismissible()) return;
		setPointerStartRef(null);
		const swipeAmountX = 0;
		const swipeAmountY = 0;
		const timeTaken = Math.max(1, (/* @__PURE__ */ new Date()).getTime() - (dragStartTime?.getTime() ?? 0));
		const swipeAmount = swipeDirection() === "x" ? swipeAmountX : swipeAmountY;
		const velocity = Math.abs(swipeAmount) / timeTaken;
		if ((swipeDirection() === "x" ? swipeDirections().includes("left") : swipeDirections().includes("top")) && (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > .11)) {
			setOffsetBeforeRemove(offset());
			props.toast.onDismiss?.(props.toast);
			if (swipeDirection() === "x") setSwipeOutDirection("left");
			else setSwipeOutDirection("up");
			deleteToast();
			setSwipeOut(true);
			return;
		}
		setIsSwiped(false);
		setSwiping(false);
		setSwipeDirection(null);
	}} onPointerMove={(event) => {
		if (!pointerStartRef() || !dismissible()) return;
		if ((window.getSelection()?.toString().length ?? 0) > 0) return;
		const yDelta = event.clientY - pointerStartRef().y;
		const xDelta = event.clientX - pointerStartRef().x;
		if (!swipeDirection() && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
		const swipeAmount = {
			x: 0,
			y: 0
		};
		const getDampening = (delta) => {
			return 1 / (1.5 + Math.abs(delta) / 20);
		};
		if (swipeDirection() === "y") {
			if (swipeDirections().includes("top") || swipeDirections().includes("bottom")) {
				if (swipeDirections().includes("top") && yDelta < 0 || swipeDirections().includes("bottom") && yDelta > 0) swipeAmount.y = yDelta;
				else {
					const dampenedDelta = yDelta * getDampening(yDelta);
					swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
				}
			}
		} else if (swipeDirection() === "x") {
			if (swipeDirections().includes("left") || swipeDirections().includes("right")) {
				if (swipeDirections().includes("left") && xDelta < 0 || swipeDirections().includes("right") && xDelta > 0) swipeAmount.x = xDelta;
				else {
					const dampenedDelta = xDelta * getDampening(xDelta);
					swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
				}
			}
		}
		if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) setIsSwiped(true);
	}}>
      <Show when={closeButton() && !props.toast.jsx && toastType() !== "loading"}>
        <button aria-label={props.closeButtonAriaLabel ?? "Close toast"} data-disabled={disabled()} data-close-button onPointerDown={(event) => event.stopPropagation()} onPointerUp={(event) => event.stopPropagation()} onClick={() => {
		if (disabled() || !dismissible()) return;
		deleteToast();
		props.toast.onDismiss?.(props.toast);
	}} class={cn(classNames()?.closeButton, toastClassNames()?.closeButton)}>
          {props.icons?.close ?? <CloseIcon />}
        </button>
      </Show>

      <Show when={(toastType() || props.toast.icon || props.toast.promise) && props.toast.icon !== null && (props.icons?.[toastType()] !== null || props.toast.icon)}>
        <div data-icon="" class={cn(classNames()?.icon, toastClassNames()?.icon)}>
          {}
          {toastType() === "loading" ? props.toast.icon || getLoadingIcon() : props.toast.promise ? getLoadingIcon() : null}
          {toastType() !== "loading" ? icon() : null}
        </div>
      </Show>

      <div data-content="" class={cn(classNames()?.content, toastClassNames()?.content)}>
        <div data-title="" class={cn(classNames()?.title, toastClassNames()?.title)}>
          {props.toast.jsx ? props.toast.jsx : resolveContent(props.toast.title)}
        </div>
        <Show when={props.toast.description}>
          <div data-description="" class={cn(descriptionClassName(), toastDescriptionClassName(), classNames()?.description, toastClassNames()?.description)}>
            {resolveContent(props.toast.description)}
          </div>
        </Show>
      </div>

      <Show when={props.toast.cancel}>
        {(cancel) => <Show when={!isAction(cancel())} fallback={<button data-button data-cancel style={props.toast.cancelButtonStyle ?? props.cancelButtonStyle} onClick={(event) => {
		const currentCancel = cancel();
		if (!dismissible()) return;
		currentCancel.onClick?.(event);
		deleteToast();
	}} class={cn(classNames()?.cancelButton, toastClassNames()?.cancelButton)}>
                {cancel().label}
              </button>}>
            {cancel()}
          </Show>}
      </Show>

      <Show when={props.toast.action}>
        {(action) => <Show when={!isAction(action())} fallback={<button data-button data-action style={props.toast.actionButtonStyle ?? props.actionButtonStyle} onClick={(event) => {
		action().onClick?.(event);
		if (event.defaultPrevented) return;
		deleteToast();
	}} class={cn(classNames()?.actionButton, toastClassNames()?.actionButton)}>
                {action().label}
              </button>}>
            {action()}
          </Show>}
      </Show>
    </li>;
}
function Toaster(props) {
	const propsWithDefaults = mergeProps({
		position: "bottom-right",
		hotkey: ["altKey", "KeyT"],
		theme: "light",
		gap: GAP,
		visibleToasts: VISIBLE_TOASTS_AMOUNT,
		dir: getDocumentDirection(),
		containerAriaLabel: "Notifications"
	}, props);
	const initialTheme = createToastTheme(propsWithDefaults.theme);
	const [toastsStore, setToastsStore] = createStore({ toasts: [] });
	const filteredToasts = createMemo(() => {
		const toasts = toastsStore.toasts;
		if (propsWithDefaults.id) return toasts.filter((toast) => toast.toasterId === propsWithDefaults.id);
		return toasts.filter((toast) => !toast.toasterId);
	});
	const possiblePositions = createMemo(() => {
		return Array.from(/* @__PURE__ */ new Set([propsWithDefaults.position, ...filteredToasts().filter((toast) => toast.position).map((toast) => toast.position)]));
	});
	const [heights, setHeights] = createSignal([]);
	const [expanded, setExpanded] = createSignal(false);
	const [interacting, setInteracting] = createSignal(false);
	const [actualTheme, setActualTheme] = createSignal(initialTheme);
	const [lastFocusedElementRef, setLastFocusedElementRef] = createSignal(null);
	const [isFocusWithinRef, setIsFocusWithinRef] = createSignal(false);
	let listRef;
	const hotkeyLabel = () => propsWithDefaults.hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
	const className = () => mergeClassName(propsWithDefaults.className, propsWithDefaults.class);
	const toastOptions = () => propsWithDefaults.toastOptions;
	const toastClassNames = () => mergeClassNames(toastOptions()?.classNames, toastOptions()?.classes);
	const toastDescriptionClassName = () => mergeDescriptionClassName(toastOptions()?.descriptionClassName, toastOptions()?.descriptionClass);
	const toastClassName = () => mergeClassName(toastOptions()?.className, toastOptions()?.class);
	const removeToast = (toastToRemove) => {
		setToastsStore("toasts", (toasts) => {
			if (!toasts.find((toast) => toast.id === toastToRemove.id)?.delete) ToastState.dismiss(toastToRemove.id);
			return toasts.filter(({ id }) => id !== toastToRemove.id);
		});
	};
	onMount(() => {
		const unsubscribe = ToastState.subscribe((toastItem) => {
			if (toastItem.dismiss) {
				requestAnimationFrame(() => {
					setToastsStore("toasts", produce((toasts) => {
						toasts.forEach((toast) => {
							if (toast.id === toastItem.id) toast.delete = true;
						});
					}));
				});
				return;
			}
			const nextToast = toastItem;
			const indexOfExistingToast = toastsStore.toasts.findIndex((t) => t.id === nextToast.id);
			if (indexOfExistingToast !== -1) {
				setToastsStore("toasts", indexOfExistingToast, reconcile(nextToast));
				return;
			}
			setToastsStore("toasts", produce((toasts) => {
				toasts.unshift(nextToast);
			}));
		});
		onCleanup(unsubscribe);
	});
	createEffect(() => {
		const theme = propsWithDefaults.theme;
		if (theme !== "system") {
			setActualTheme(theme);
			return;
		}
		if (typeof window === "undefined") return;
		const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
		const updateTheme = ({ matches }) => {
			setActualTheme(matches ? "dark" : "light");
		};
		updateTheme(darkMediaQuery);
		try {
			darkMediaQuery.addEventListener("change", updateTheme);
			onCleanup(() => darkMediaQuery.removeEventListener("change", updateTheme));
		} catch {
			darkMediaQuery.addListener(updateTheme);
			onCleanup(() => darkMediaQuery.removeListener(updateTheme));
		}
	});
	createEffect(() => {
		if (filteredToasts().length <= 1) setExpanded(false);
	});
	onMount(() => {
		const handleKeyDown = (event) => {
			if (propsWithDefaults.hotkey.length > 0 && propsWithDefaults.hotkey.every((key) => event[key] || event.code === key)) setExpanded(true);
			if (event.code === "Escape" && (document.activeElement === listRef || void 0)) setExpanded(false);
		};
		document.addEventListener("keydown", handleKeyDown);
		onCleanup(() => document.removeEventListener("keydown", handleKeyDown));
	});
	onCleanup(() => {
		if (lastFocusedElementRef()) {
			lastFocusedElementRef()?.focus({ preventScroll: true });
			setLastFocusedElementRef(null);
			setIsFocusWithinRef(false);
		}
	});
	return <section aria-label={propsWithDefaults.customAriaLabel ?? `${propsWithDefaults.containerAriaLabel} ${hotkeyLabel()}`} tabIndex={-1} aria-live="polite" aria-relevant="additions text" aria-atomic="false" data-react-aria-top-layer>
      <For each={possiblePositions()}>
        {(position, index) => {
		const [y, x] = position.split("-");
		const toastsByPosition = createMemo(() => filteredToasts().filter((toast) => !toast.position && index() === 0 || toast.position === position));
		const heightsByPosition = createMemo(() => heights().filter((height) => index() === 0 && !height.position || height.position === position));
		return <Show when={filteredToasts().length > 0}>
              <ol tabIndex={-1} ref={listRef} dir={propsWithDefaults.dir === "auto" ? getDocumentDirection() : propsWithDefaults.dir} class={className()} data-sonner-toaster data-sonner-theme={actualTheme()} data-y-position={y} data-x-position={x} style={{
			"--front-toast-height": `${heightsByPosition()[0]?.height ?? 0}px`,
			"--width": `${TOAST_WIDTH}px`,
			"--gap": `${propsWithDefaults.gap}px`,
			...propsWithDefaults.style,
			...assignOffset(propsWithDefaults.offset, propsWithDefaults.mobileOffset)
		}} onBlur={(event) => {
			if (isFocusWithinRef() && !event.currentTarget.contains(event.relatedTarget)) {
				setIsFocusWithinRef(false);
				if (lastFocusedElementRef()) {
					lastFocusedElementRef()?.focus({ preventScroll: true });
					setLastFocusedElementRef(null);
				}
			}
		}} onFocus={(event) => {
			if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
			if (!isFocusWithinRef()) {
				setIsFocusWithinRef(true);
				setLastFocusedElementRef(event.relatedTarget);
			}
		}} onMouseEnter={() => setExpanded(true)} onMouseMove={() => setExpanded(true)} onMouseLeave={() => {
			if (!interacting()) setExpanded(false);
		}} onDragEnd={() => setExpanded(false)} onPointerDown={(event) => {
			if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
			setInteracting(true);
		}} onPointerUp={() => setInteracting(false)}>
                <For each={toastsByPosition()}>
                  {(toastItem, toastIndex) => <Toast icons={propsWithDefaults.icons} index={toastIndex()} toast={toastItem} defaultRichColors={propsWithDefaults.richColors} duration={toastOptions()?.duration ?? propsWithDefaults.duration} class={toastClassName()} descriptionClassName={toastDescriptionClassName()} invert={Boolean(propsWithDefaults.invert)} visibleToasts={propsWithDefaults.visibleToasts} closeButton={toastOptions()?.closeButton ?? propsWithDefaults.closeButton ?? false} interacting={interacting()} position={position} style={toastOptions()?.style} unstyled={toastOptions()?.unstyled} classNames={toastClassNames()} cancelButtonStyle={toastOptions()?.cancelButtonStyle} actionButtonStyle={toastOptions()?.actionButtonStyle} closeButtonAriaLabel={toastOptions()?.closeButtonAriaLabel} removeToast={removeToast} toasts={toastsByPosition()} heights={heightsByPosition()} setHeights={setHeights} expandByDefault={Boolean(propsWithDefaults.expand)} gap={propsWithDefaults.gap} expanded={expanded()} swipeDirections={propsWithDefaults.swipeDirections} pauseWhenPageIsHidden={propsWithDefaults.pauseWhenPageIsHidden} />}
                </For>
              </ol>
            </Show>;
	}}
      </For>
    </section>;
}
//#endregion
export { Toaster, toast, useSonner };
