react-toastify
Advanced tools
Comparing version 9.0.0-POC to 9.0.0-rc-1
@@ -1,158 +0,1 @@ | ||
import { ToastItem, Id } from 'react-toastify'; | ||
declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>; | ||
export interface NotificationCenterItem<Data = {}> extends Optional<ToastItem<Data>, 'content' | 'data'> { | ||
read: boolean; | ||
createdAt: number; | ||
} | ||
export declare type SortFn<Data> = (l: NotificationCenterItem<Data>, r: NotificationCenterItem<Data>) => number; | ||
export declare type FilterFn<Data = {}> = (item: NotificationCenterItem<Data>) => boolean; | ||
export interface UseNotificationCenterParams<Data = {}> { | ||
/** | ||
* initial data to rehydrate the notification center | ||
*/ | ||
data?: NotificationCenterItem<Data>[]; | ||
/** | ||
* By default, the notifications are sorted from the newest to the oldest using | ||
* the `createdAt` field. Use this to provide your own sort function | ||
* | ||
* Usage: | ||
* ``` | ||
* // old notifications first | ||
* useNotificationCenter({ | ||
* sort: ((l, r) => l.createdAt - r.createdAt) | ||
* }) | ||
* ``` | ||
*/ | ||
sort?: SortFn<Data>; | ||
/** | ||
* Keep the toast that meet the condition specified in the callback function. | ||
* | ||
* Usage: | ||
* ``` | ||
* // keep only the toasts when hidden is set to false | ||
* useNotificationCenter({ | ||
* filter: item => item.data.hidden === false | ||
* }) | ||
* ``` | ||
*/ | ||
filter?: FilterFn<Data>; | ||
} | ||
export interface UseNotificationCenter<Data> { | ||
/** | ||
* Contains all the notifications | ||
*/ | ||
notifications: NotificationCenterItem[]; | ||
/** | ||
* Clear all notifications | ||
*/ | ||
clear(): void; | ||
/** | ||
* Mark all notification as read | ||
*/ | ||
markAllAsRead(): void; | ||
/** | ||
* Mark all notification as read or not. | ||
* | ||
* Usage: | ||
* ``` | ||
* markAllAsRead(false) // mark all notification as not read | ||
* | ||
* markAllAsRead(true) // same as calling markAllAsRead() | ||
* ``` | ||
*/ | ||
markAllAsRead(read?: boolean): void; | ||
/** | ||
* Mark one or more notifications as read. | ||
* | ||
* Usage: | ||
* ``` | ||
* markAsRead("anId") | ||
* markAsRead(["a","list", "of", "id"]) | ||
* ``` | ||
*/ | ||
markAsRead(id: Id | Id[]): void; | ||
/** | ||
* Mark one or more notifications as read.The second parameter let you mark the notificaiton as read or not. | ||
* | ||
* Usage: | ||
* ``` | ||
* markAsRead("anId", false) | ||
* markAsRead(["a","list", "of", "id"], false) | ||
* | ||
* markAsRead("anId", true) // same as markAsRead("anId") | ||
* ``` | ||
*/ | ||
markAsRead(id: Id | Id[], read?: boolean): void; | ||
/** | ||
* Remove one or more notifications | ||
* | ||
* Usage: | ||
* ``` | ||
* remove("anId") | ||
* remove(["a","list", "of", "id"]) | ||
* ``` | ||
*/ | ||
remove(id: Id | Id[]): void; | ||
/** | ||
* Push a notification to the notification center. | ||
* Returns null when an item with the given id already exists | ||
* | ||
* Usage: | ||
* ``` | ||
* const id = add({id: "id", content: "test", data: { foo: "hello" } }) | ||
* | ||
* // Return the id of the notificaiton, generate one if none provided | ||
* const id = add({ data: {title: "a title", text: "some text"} }) | ||
* ``` | ||
*/ | ||
add(item: Partial<NotificationCenterItem<Data>>): Id | null; | ||
/** | ||
* Update the notification that match the id | ||
* Returns null when no matching notification found | ||
* | ||
* Usage: | ||
* ``` | ||
* const id = update("anId", {content: "test", data: { foo: "hello" } }) | ||
* | ||
* // It's also possible to update the id | ||
* const id = update("anId"m { id:"anotherOne", data: {title: "a title", text: "some text"} }) | ||
* ``` | ||
*/ | ||
update(id: Id, item: Partial<NotificationCenterItem<Data>>): Id | null; | ||
/** | ||
* Retrive one or more notifications | ||
* | ||
* Usage: | ||
* ``` | ||
* find("anId") | ||
* find(["a","list", "of", "id"]) | ||
* ``` | ||
*/ | ||
find(id: Id): NotificationCenterItem<Data> | undefined; | ||
/** | ||
* Retrive one or more notifications | ||
* | ||
* Usage: | ||
* ``` | ||
* find("anId") | ||
* find(["a","list", "of", "id"]) | ||
* ``` | ||
*/ | ||
find(id: Id[]): NotificationCenterItem<Data>[] | undefined; | ||
/** | ||
* Retrieve the count for unread notifications | ||
*/ | ||
unreadCount: number; | ||
/** | ||
* Sort notifications using the newly provided function | ||
* | ||
* Usage: | ||
* ``` | ||
* // old notifications first | ||
* sort((l, r) => l.createdAt - r.createdAt) | ||
* ``` | ||
*/ | ||
sort(sort: SortFn<Data>): void; | ||
} | ||
export declare function useNotificationCenter<Data = {}>(params?: UseNotificationCenterParams<Data>): UseNotificationCenter<Data>; | ||
export {}; | ||
export * from './useNotificationCenter'; |
@@ -1,2 +0,2 @@ | ||
import{useRef as r,useState as t,useEffect as e}from"react";import{toast as n}from"react-toastify";function d(d){void 0===d&&(d={});const c=r(d.sort||a),o=r(d.filter||null),[u,s]=t(()=>d.data?o.current?d.data.filter(o.current).sort(c.current):[...d.data].sort(c.current):[]);return e(()=>n.onChange(r=>{let{added:t}=r;if(t){const r=i(t);if(o.current&&!o.current(r))return;s(t=>{let e=[];const n=t.findIndex(t=>t.id===r.id);return-1!==n?(e=t.slice(),Object.assign(e[n],r,{createdAt:Date.now()})):e=0===t.length?[r]:[r,...t],e.sort(c.current)})}}),[]),{notifications:u,clear:()=>{s([])},markAllAsRead:function(r){void 0===r&&(r=!0),s(t=>t.map(t=>(t.read=r,t)))},markAsRead:function(r,t){void 0===t&&(t=!0);let e=e=>(e.id===r&&(e.read=t),e);Array.isArray(r)&&(e=e=>(r.includes(e.id)&&(e.read=t),e)),s(r=>r.map(e))},add:r=>{if(u.find(t=>t.id===r.id))return null;const t=i(r);return s(r=>[...r,t].sort(c.current)),t.id},update:(r,t)=>{const e=u.findIndex(t=>t.id===r);return-1!==e?(s(r=>{const n=[...r];return Object.assign(n[e],t,{createdAt:Date.now()}),n.sort(c.current)}),t.id):null},remove:r=>{s(t=>t.filter(Array.isArray(r)?t=>!r.includes(t.id):t=>t.id!==r))},find:r=>Array.isArray(r)?u.filter(t=>r.includes(t.id)):u.find(t=>t.id===r),sort:r=>{c.current=r,s(t=>t.slice().sort(r))},get unreadCount(){return u.reduce((r,t)=>t.read?r:r+1,0)}}}function i(r){return null==r.id&&(r.id=Date.now().toString(36).substring(2,9)),r.createdAt||(r.createdAt=Date.now()),null==r.read&&(r.read=!1),r}function a(r,t){return t.createdAt-r.createdAt}export{d as useNotificationCenter}; | ||
import{useRef as r,useState as t,useEffect as e}from"react";import{toast as n}from"react-toastify";function d(d){void 0===d&&(d={});const u=r(d.sort||a),c=r(d.filter||null),[o,s]=t(()=>d.data?c.current?d.data.filter(c.current).sort(u.current):[...d.data].sort(u.current):[]),l=r(o);return e(()=>{l.current=o},[o]),e(()=>n.onChange(r=>{if("added"===r.status||"updated"===r.status){const t=i(r);if(c.current&&!c.current(t))return;s(r=>{let e=[];const n=r.findIndex(r=>r.id===t.id);return-1!==n?(e=r.slice(),Object.assign(e[n],t,{createdAt:Date.now()})):e=0===r.length?[t]:[t,...r],e.sort(u.current)})}}),[]),{notifications:o,clear:()=>{s([])},markAllAsRead:function(r){void 0===r&&(r=!0),s(t=>t.map(t=>(t.read=r,t)))},markAsRead:function(r,t){void 0===t&&(t=!0);let e=e=>(e.id===r&&(e.read=t),e);Array.isArray(r)&&(e=e=>(r.includes(e.id)&&(e.read=t),e)),s(r=>r.map(e))},add:r=>{if(l.current.find(t=>t.id===r.id))return null;const t=i(r);return s(r=>[...r,t].sort(u.current)),t.id},update:(r,t)=>{const e=l.current.findIndex(t=>t.id===r);return-1!==e?(s(r=>{const n=[...r];return Object.assign(n[e],t,{createdAt:t.createdAt||Date.now()}),n.sort(u.current)}),t.id):null},remove:r=>{s(t=>t.filter(Array.isArray(r)?t=>!r.includes(t.id):t=>t.id!==r))},find:r=>Array.isArray(r)?l.current.filter(t=>r.includes(t.id)):l.current.find(t=>t.id===r),sort:r=>{u.current=r,s(t=>t.slice().sort(r))},get unreadCount(){return o.reduce((r,t)=>t.read?r:r+1,0)}}}function i(r){return null==r.id&&(r.id=Date.now().toString(36).substring(2,9)),r.createdAt||(r.createdAt=Date.now()),null==r.read&&(r.read=!1),r}function a(r,t){return t.createdAt-r.createdAt}export{d as useNotificationCenter}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
var r=require("react"),e=require("react-toastify");function t(r){return null==r.id&&(r.id=Date.now().toString(36).substring(2,9)),r.createdAt||(r.createdAt=Date.now()),null==r.read&&(r.read=!1),r}function n(r,e){return e.createdAt-r.createdAt}exports.useNotificationCenter=function(i){void 0===i&&(i={});const d=r.useRef(i.sort||n),a=r.useRef(i.filter||null),[u,c]=r.useState(()=>i.data?a.current?i.data.filter(a.current).sort(d.current):[...i.data].sort(d.current):[]);return r.useEffect(()=>e.toast.onChange(r=>{let{added:e}=r;if(e){const r=t(e);if(a.current&&!a.current(r))return;c(e=>{let t=[];const n=e.findIndex(e=>e.id===r.id);return-1!==n?(t=e.slice(),Object.assign(t[n],r,{createdAt:Date.now()})):t=0===e.length?[r]:[r,...e],t.sort(d.current)})}}),[]),{notifications:u,clear:()=>{c([])},markAllAsRead:function(r){void 0===r&&(r=!0),c(e=>e.map(e=>(e.read=r,e)))},markAsRead:function(r,e){void 0===e&&(e=!0);let t=t=>(t.id===r&&(t.read=e),t);Array.isArray(r)&&(t=t=>(r.includes(t.id)&&(t.read=e),t)),c(r=>r.map(t))},add:r=>{if(u.find(e=>e.id===r.id))return null;const e=t(r);return c(r=>[...r,e].sort(d.current)),e.id},update:(r,e)=>{const t=u.findIndex(e=>e.id===r);return-1!==t?(c(r=>{const n=[...r];return Object.assign(n[t],e,{createdAt:Date.now()}),n.sort(d.current)}),e.id):null},remove:r=>{c(e=>e.filter(Array.isArray(r)?e=>!r.includes(e.id):e=>e.id!==r))},find:r=>Array.isArray(r)?u.filter(e=>r.includes(e.id)):u.find(e=>e.id===r),sort:r=>{d.current=r,c(e=>e.slice().sort(r))},get unreadCount(){return u.reduce((r,e)=>e.read?r:r+1,0)}}}; | ||
var r=require("react"),t=require("react-toastify");function e(r){return null==r.id&&(r.id=Date.now().toString(36).substring(2,9)),r.createdAt||(r.createdAt=Date.now()),null==r.read&&(r.read=!1),r}function n(r,t){return t.createdAt-r.createdAt}exports.useNotificationCenter=function(d){void 0===d&&(d={});const i=r.useRef(d.sort||n),u=r.useRef(d.filter||null),[a,c]=r.useState(()=>d.data?u.current?d.data.filter(u.current).sort(i.current):[...d.data].sort(i.current):[]),s=r.useRef(a);return r.useEffect(()=>{s.current=a},[a]),r.useEffect(()=>t.toast.onChange(r=>{if("added"===r.status||"updated"===r.status){const t=e(r);if(u.current&&!u.current(t))return;c(r=>{let e=[];const n=r.findIndex(r=>r.id===t.id);return-1!==n?(e=r.slice(),Object.assign(e[n],t,{createdAt:Date.now()})):e=0===r.length?[t]:[t,...r],e.sort(i.current)})}}),[]),{notifications:a,clear:()=>{c([])},markAllAsRead:function(r){void 0===r&&(r=!0),c(t=>t.map(t=>(t.read=r,t)))},markAsRead:function(r,t){void 0===t&&(t=!0);let e=e=>(e.id===r&&(e.read=t),e);Array.isArray(r)&&(e=e=>(r.includes(e.id)&&(e.read=t),e)),c(r=>r.map(e))},add:r=>{if(s.current.find(t=>t.id===r.id))return null;const t=e(r);return c(r=>[...r,t].sort(i.current)),t.id},update:(r,t)=>{const e=s.current.findIndex(t=>t.id===r);return-1!==e?(c(r=>{const n=[...r];return Object.assign(n[e],t,{createdAt:t.createdAt||Date.now()}),n.sort(i.current)}),t.id):null},remove:r=>{c(t=>t.filter(Array.isArray(r)?t=>!r.includes(t.id):t=>t.id!==r))},find:r=>Array.isArray(r)?s.current.filter(t=>r.includes(t.id)):s.current.find(t=>t.id===r),sort:r=>{i.current=r,c(t=>t.slice().sort(r))},get unreadCount(){return a.reduce((r,t)=>t.read?r:r+1,0)}}}; | ||
//# sourceMappingURL=index.js.map |
import React from 'react'; | ||
import { ToastContainerProps } from '../types'; | ||
export declare const ToastContainer: React.FC<ToastContainerProps>; | ||
export declare const ToastContainer: React.ForwardRefExoticComponent<ToastContainerProps & React.RefAttributes<HTMLDivElement>>; |
@@ -17,8 +17,3 @@ /// <reference types="react" /> | ||
declare type OnWillUnmountCallback = OnDidMountCallback; | ||
export interface OnChangePayload { | ||
toasts: ToastItem[]; | ||
added?: ToastItem; | ||
removed?: ToastItem; | ||
} | ||
export declare type OnChangeCallback = (payload: OnChangePayload) => void; | ||
export declare type OnChangeCallback = (toast: ToastItem) => void; | ||
declare type Callback = OnShowCallback | OnClearCallback | OnClearWaitingQueue | OnDidMountCallback | OnWillUnmountCallback | OnChangeCallback; | ||
@@ -42,5 +37,5 @@ declare type TimeoutId = ReturnType<typeof setTimeout>; | ||
emit(event: Event.WillUnmount, containerInstance: ContainerInstance): void; | ||
emit(event: Event.Change, data: OnChangePayload): void; | ||
emit(event: Event.Change, data: ToastItem): void; | ||
} | ||
export declare const eventManager: EventManager; | ||
export {}; |
@@ -5,14 +5,14 @@ import { OnChangeCallback } from './eventManager'; | ||
declare namespace toast { | ||
var loading: (content: ToastContent, options?: ToastOptions<{}> | undefined) => Id; | ||
var loading: (content: ToastContent<unknown>, options?: ToastOptions<{}> | undefined) => Id; | ||
var promise: typeof handlePromise; | ||
var success: (content: ToastContent, options?: ToastOptions<{}> | undefined) => Id; | ||
var info: (content: ToastContent, options?: ToastOptions<{}> | undefined) => Id; | ||
var error: (content: ToastContent, options?: ToastOptions<{}> | undefined) => Id; | ||
var warning: (content: ToastContent, options?: ToastOptions<{}> | undefined) => Id; | ||
var warn: (content: ToastContent, options?: ToastOptions<{}> | undefined) => Id; | ||
var dark: (content: ToastContent, options?: ToastOptions<{}> | undefined) => Id; | ||
var success: (content: ToastContent<unknown>, options?: ToastOptions<{}> | undefined) => Id; | ||
var info: (content: ToastContent<unknown>, options?: ToastOptions<{}> | undefined) => Id; | ||
var error: (content: ToastContent<unknown>, options?: ToastOptions<{}> | undefined) => Id; | ||
var warning: (content: ToastContent<unknown>, options?: ToastOptions<{}> | undefined) => Id; | ||
var warn: (content: ToastContent<unknown>, options?: ToastOptions<{}> | undefined) => Id; | ||
var dark: (content: ToastContent<unknown>, options?: ToastOptions<{}> | undefined) => Id; | ||
var dismiss: (id?: Id | undefined) => void; | ||
var clearWaitingQueue: (params?: ClearWaitingQueueParams) => void; | ||
var isActive: (id: Id) => boolean; | ||
var update: (toastId: Id, options?: UpdateOptions) => void; | ||
var update: (toastId: Id, options?: UpdateOptions<unknown>) => void; | ||
var done: (id: Id) => void; | ||
@@ -36,8 +36,8 @@ var onChange: (callback: OnChangeCallback) => () => void; | ||
} | ||
export interface ToastPromiseParams { | ||
pending?: string | UpdateOptions; | ||
success?: string | UpdateOptions; | ||
error?: string | UpdateOptions; | ||
export interface ToastPromiseParams<T = unknown> { | ||
pending?: string | UpdateOptions<void>; | ||
success?: string | UpdateOptions<T>; | ||
error?: string | UpdateOptions<any>; | ||
} | ||
declare function handlePromise<T>(promise: Promise<T> | (() => Promise<T>), { pending, error, success }: ToastPromiseParams, options?: ToastOptions): Promise<T>; | ||
declare function handlePromise<T = unknown>(promise: Promise<T> | (() => Promise<T>), { pending, error, success }: ToastPromiseParams<T>, options?: ToastOptions): Promise<T>; | ||
export { toast }; |
export function injectStyle() { | ||
var style = ":root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error)}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:1em;left:1em}.Toastify__toast-container--top-center{top:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:1em;right:1em}.Toastify__toast-container--bottom-left{bottom:1em;left:1em}.Toastify__toast-container--bottom-center{bottom:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:1em;right:1em}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:0;margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:0;transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:0;transform:translateX(0)}.Toastify__toast-container--rtl{right:0;left:auto}}.Toastify__toast{position:relative;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:4px;box-shadow:0 1px 10px 0 rgba(0,0,0,.1),0 2px 15px 0 rgba(0,0,0,.05);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);overflow:hidden;font-family:var(--toastify-font-family);cursor:pointer;direction:ltr}.Toastify__toast--rtl{direction:rtl}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.7s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:5px;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,0,0)}to{opacity:0;transform:translate3d(-2000px,0,0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,-10px,0)}40%,45%{opacity:1;transform:translate3d(0,20px,0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,10px,0)}40%,45%{opacity:1;transform:translate3d(0,-20px,0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:perspective(400px)}30%{transform:perspective(400px) rotateX(-20deg);opacity:1}to{transform:perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideOutRight{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(110%,0,0)}}@keyframes Toastify__slideOutLeft{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(-110%,0,0)}}@keyframes Toastify__slideOutDown{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"; | ||
var style = ":root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error)}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:1em;left:1em}.Toastify__toast-container--top-center{top:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:1em;right:1em}.Toastify__toast-container--bottom-left{bottom:1em;left:1em}.Toastify__toast-container--bottom-center{bottom:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:1em;right:1em}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:0;margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:0;transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:0;transform:translateX(0)}.Toastify__toast-container--rtl{right:0;left:auto}}.Toastify__toast{position:relative;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:4px;box-shadow:0 1px 10px 0 rgba(0,0,0,.1),0 2px 15px 0 rgba(0,0,0,.05);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);overflow:hidden;font-family:var(--toastify-font-family);cursor:pointer;direction:ltr}.Toastify__toast--rtl{direction:rtl}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.7s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.f{--y:calc(var(--len) - var(--nth));position:absolute;bottom:0;right:0;width:100%;transform:translate3d(0,calc(var(--y) * -40%),0) scale(calc(1 - .05 * var(--y)));transition:all .3s;min-height:80px}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:5px;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,0,0)}to{opacity:0;transform:translate3d(-2000px,0,0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,-10px,0)}40%,45%{opacity:1;transform:translate3d(0,20px,0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,10px,0)}40%,45%{opacity:1;transform:translate3d(0,-20px,0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:perspective(400px)}30%{transform:perspective(400px) rotateX(-20deg);opacity:1}to{transform:perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideOutRight{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(110%,0,0)}}@keyframes Toastify__slideOutLeft{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(-110%,0,0)}}@keyframes Toastify__slideOutDown{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"; | ||
var css = document.createElement('style'); | ||
@@ -5,0 +5,0 @@ css.innerText = style; |
@@ -7,3 +7,3 @@ | ||
function injectStyle() { | ||
var style = ":root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error)}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:1em;left:1em}.Toastify__toast-container--top-center{top:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:1em;right:1em}.Toastify__toast-container--bottom-left{bottom:1em;left:1em}.Toastify__toast-container--bottom-center{bottom:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:1em;right:1em}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:0;margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:0;transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:0;transform:translateX(0)}.Toastify__toast-container--rtl{right:0;left:auto}}.Toastify__toast{position:relative;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:4px;box-shadow:0 1px 10px 0 rgba(0,0,0,.1),0 2px 15px 0 rgba(0,0,0,.05);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);overflow:hidden;font-family:var(--toastify-font-family);cursor:pointer;direction:ltr}.Toastify__toast--rtl{direction:rtl}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.7s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:5px;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,0,0)}to{opacity:0;transform:translate3d(-2000px,0,0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,-10px,0)}40%,45%{opacity:1;transform:translate3d(0,20px,0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,10px,0)}40%,45%{opacity:1;transform:translate3d(0,-20px,0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:perspective(400px)}30%{transform:perspective(400px) rotateX(-20deg);opacity:1}to{transform:perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideOutRight{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(110%,0,0)}}@keyframes Toastify__slideOutLeft{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(-110%,0,0)}}@keyframes Toastify__slideOutDown{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"; | ||
var style = ":root{--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-color-info:#3498db;--toastify-color-success:#07bc0c;--toastify-color-warning:#f1c40f;--toastify-color-error:#e74c3c;--toastify-color-transparent:hsla(0,0%,100%,.7);--toastify-icon-color-info:var(--toastify-color-info);--toastify-icon-color-success:var(--toastify-color-success);--toastify-icon-color-warning:var(--toastify-color-warning);--toastify-icon-color-error:var(--toastify-color-error);--toastify-toast-width:320px;--toastify-toast-background:#fff;--toastify-toast-min-height:64px;--toastify-toast-max-height:800px;--toastify-font-family:sans-serif;--toastify-z-index:9999;--toastify-text-color-light:#757575;--toastify-text-color-dark:#fff;--toastify-text-color-info:#fff;--toastify-text-color-success:#fff;--toastify-text-color-warning:#fff;--toastify-text-color-error:#fff;--toastify-spinner-color:#616161;--toastify-spinner-color-empty-area:#e0e0e0;--toastify-color-progress-light:linear-gradient(90deg,#4cd964,#5ac8fa,#007aff,#34aadc,#5856d6,#ff2d55);--toastify-color-progress-dark:#bb86fc;--toastify-color-progress-info:var(--toastify-color-info);--toastify-color-progress-success:var(--toastify-color-success);--toastify-color-progress-warning:var(--toastify-color-warning);--toastify-color-progress-error:var(--toastify-color-error)}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translateZ(var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:1em;left:1em}.Toastify__toast-container--top-center{top:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--top-right{top:1em;right:1em}.Toastify__toast-container--bottom-left{bottom:1em;left:1em}.Toastify__toast-container--bottom-center{bottom:1em;left:50%;transform:translateX(-50%)}.Toastify__toast-container--bottom-right{bottom:1em;right:1em}@media only screen and (max-width:480px){.Toastify__toast-container{width:100vw;padding:0;left:0;margin:0}.Toastify__toast-container--top-center,.Toastify__toast-container--top-left,.Toastify__toast-container--top-right{top:0;transform:translateX(0)}.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-right{bottom:0;transform:translateX(0)}.Toastify__toast-container--rtl{right:0;left:auto}}.Toastify__toast{position:relative;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:4px;box-shadow:0 1px 10px 0 rgba(0,0,0,.1),0 2px 15px 0 rgba(0,0,0,.05);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;max-height:var(--toastify-toast-max-height);overflow:hidden;font-family:var(--toastify-font-family);cursor:pointer;direction:ltr}.Toastify__toast--rtl{direction:rtl}.Toastify__toast-body{margin:auto 0;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.7s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width:480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.f{--y:calc(var(--len) - var(--nth));position:absolute;bottom:0;right:0;width:100%;transform:translate3d(0,calc(var(--y) * -40%),0) scale(calc(1 - .05 * var(--y)));transition:all .3s;min-height:80px}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--colored.Toastify__toast--default,.Toastify__toast-theme--light{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;-ms-flex-item-align:start;align-self:flex-start}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:focus,.Toastify__close-button:hover{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:5px;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:auto;transform-origin:right}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,0,0)}to{opacity:0;transform:translate3d(2000px,0,0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,0,0)}to{opacity:0;transform:translate3d(-2000px,0,0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,-10px,0)}40%,45%{opacity:1;transform:translate3d(0,20px,0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,10px,0)}40%,45%{opacity:1;transform:translate3d(0,-20px,0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--bottom-left,.Toastify__bounce-enter--top-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--bottom-right,.Toastify__bounce-enter--top-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--bottom-left,.Toastify__bounce-exit--top-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--bottom-right,.Toastify__bounce-exit--top-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:perspective(400px)}30%{transform:perspective(400px) rotateX(-20deg);opacity:1}to{transform:perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes Toastify__slideOutRight{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(110%,0,0)}}@keyframes Toastify__slideOutLeft{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(-110%,0,0)}}@keyframes Toastify__slideOutDown{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translateZ(0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--bottom-left,.Toastify__slide-enter--top-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--bottom-right,.Toastify__slide-enter--top-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--bottom-left,.Toastify__slide-exit--top-left{animation-name:Toastify__slideOutLeft}.Toastify__slide-exit--bottom-right,.Toastify__slide-exit--top-right{animation-name:Toastify__slideOutRight}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown}@keyframes Toastify__spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"; | ||
var css = document.createElement('style'); | ||
@@ -10,0 +10,0 @@ css.innerText = style; |
@@ -1,2 +0,2 @@ | ||
import e,{isValidElement as t,useRef as n,useLayoutEffect as o,useEffect as s,useReducer as a,useState as r,cloneElement as i}from"react";import c from"clsx";function l(e){return"number"==typeof e&&!isNaN(e)}function u(e){return"boolean"==typeof e}function d(e){return"string"==typeof e}function p(e){return"function"==typeof e}function m(e){return d(e)||p(e)?e:null}function f(e){return 0===e||e}function g(e){return t(e)||d(e)||p(e)||l(e)}const y={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},h={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function T(e,t,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition="all "+n+"ms",requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function v(t){let{enter:a,exit:r,appendPosition:i=!1,collapse:c=!0,collapseDuration:l=300}=t;return function(t){let{children:u,position:d,preventExitTransition:p,done:m,nodeRef:f,isIn:g}=t;const y=i?a+"--"+d:a,h=i?r+"--"+d:r,v=n(),E=n(0);function b(e){if(e.target!==f.current)return;const t=f.current;t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",b),t.removeEventListener("animationcancel",b),0===E.current&&(t.className=v.current)}function C(){const e=f.current;e.removeEventListener("animationend",C),c?T(e,m,l):m()}return o(()=>{!function(){const e=f.current;v.current=e.className,e.className+=" "+y,e.addEventListener("animationend",b),e.addEventListener("animationcancel",b)}()},[]),s(()=>{g||(p?C():function(){E.current=1;const e=f.current;e.className+=" "+h,e.addEventListener("animationend",C)}())},[g]),e.createElement(e.Fragment,null,u)}}function E(e){return{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon}}const b={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(e=>e!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},C=t=>{let{theme:n,type:o,...s}=t;return e.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===n?"currentColor":"var(--toastify-icon-color-"+o+")",...s})},_={info:function(t){return e.createElement(C,{...t},e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return e.createElement(C,{...t},e.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return e.createElement(C,{...t},e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return e.createElement(C,{...t},e.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return e.createElement("div",{className:"Toastify__spinner"})}};function I(e){const[,o]=a(e=>e+1,0),[c,y]=r([]),h=n(null),T=n(new Map).current,v=e=>-1!==c.indexOf(e),C=n({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:v,getToast:e=>T.get(e)}).current;function I(e){let{containerId:t}=e;const{limit:n}=C.props;!n||t&&C.containerId!==t||(C.count-=C.queue.length,C.queue=[])}function O(e){y(t=>f(e)?t.filter(t=>t!==e):[])}function L(){const{toastContent:e,toastProps:t,staleId:n}=C.queue.shift();P(e,t,n)}function N(e,n){let{delay:s,staleId:a,...r}=n;if(!g(e)||function(e){return!h.current||C.props.enableMultiContainer&&e.containerId!==C.props.containerId||T.has(e.toastId)&&null==e.updateId}(r))return;const{toastId:c,updateId:y,data:v}=r,{props:I}=C,N=()=>O(c),x=null==y;x&&C.count++;const B={toastId:c,updateId:y,containerId:r.containerId,isLoading:r.isLoading,theme:r.theme||I.theme,icon:null!=r.icon?r.icon:I.icon,isIn:!1,key:r.key||C.toastKey++,type:r.type,closeToast:N,closeButton:r.closeButton,rtl:I.rtl,position:r.position||I.position,transition:r.transition||I.transition,className:m(r.className||I.toastClassName),bodyClassName:m(r.bodyClassName||I.bodyClassName),style:r.style||I.toastStyle,bodyStyle:r.bodyStyle||I.bodyStyle,onClick:r.onClick||I.onClick,pauseOnHover:u(r.pauseOnHover)?r.pauseOnHover:I.pauseOnHover,pauseOnFocusLoss:u(r.pauseOnFocusLoss)?r.pauseOnFocusLoss:I.pauseOnFocusLoss,draggable:u(r.draggable)?r.draggable:I.draggable,draggablePercent:r.draggablePercent||I.draggablePercent,draggableDirection:r.draggableDirection||I.draggableDirection,closeOnClick:u(r.closeOnClick)?r.closeOnClick:I.closeOnClick,progressClassName:m(r.progressClassName||I.progressClassName),progressStyle:r.progressStyle||I.progressStyle,autoClose:!r.isLoading&&(R=r.autoClose,k=I.autoClose,!1===R||l(R)&&R>0?R:k),hideProgressBar:u(r.hideProgressBar)?r.hideProgressBar:I.hideProgressBar,progress:r.progress,role:r.role||I.role,deleteToast(){const e=E(T.get(c));T.delete(c),b.emit(4,{toasts:Array.from(T.values(),E),removed:e});const t=C.queue.length;if(C.count=f(c)?C.count-1:C.count-C.displayedToast,C.count<0&&(C.count=0),t>0){const e=f(c)?1:C.props.limit;if(1===t||1===e)C.displayedToast++,L();else{const n=e>t?t:e;C.displayedToast=n;for(let e=0;e<n;e++)L()}}else o()}};var R,k;const M=_[B.type],D={theme:B.theme,type:B.type};B.icon=M&&M(D),!1===B.icon?B.icon=void 0:p(B.icon)?B.icon=B.icon(D):t(B.icon)?B.icon=i(B.icon,D):d(B.icon)?B.icon=B.icon:B.isLoading&&(B.icon=_.spinner()),p(r.onOpen)&&(B.onOpen=r.onOpen),p(r.onClose)&&(B.onClose=r.onClose),B.closeButton=I.closeButton,!1===r.closeButton||g(r.closeButton)?B.closeButton=r.closeButton:!0===r.closeButton&&(B.closeButton=!g(I.closeButton)||I.closeButton);let w=e;t(e)&&!d(e.type)?w=i(e,{closeToast:N,toastProps:B,data:v}):p(e)&&(w=e({closeToast:N,toastProps:B,data:v})),I.limit&&I.limit>0&&C.count>I.limit&&x?C.queue.push({toastContent:w,toastProps:B,staleId:a}):l(s)?setTimeout(()=>{P(w,B,a)},s):P(w,B,a)}function P(e,t,n){const{toastId:o}=t;n&&T.delete(n);const s={content:e,props:t};T.set(o,s),y(e=>[...e,o].filter(e=>e!==n)),b.emit(4,{toasts:Array.from(T.values(),E),added:E(s)})}return s(()=>(C.containerId=e.containerId,b.cancelEmit(3).on(0,N).on(1,e=>h.current&&O(e)).on(5,I).emit(2,C),()=>b.emit(3,C)),[]),s(()=>{C.props=e,C.isToastActive=v,C.displayedToast=c.length}),{getToastToRender:function(t){const n=new Map,o=Array.from(T.values());return e.newestOnTop&&o.reverse(),o.forEach(e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},containerRef:h,isToastActive:v}}function O(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function L(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function N(e){const[o,a]=r(!1),[i,c]=r(!1),l=n(null),u=n({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,d=n(e),{autoClose:m,pauseOnHover:f,closeToast:g,onClick:y,closeOnClick:h}=e;function T(t){if(e.draggable){u.didMove=!1,document.addEventListener("mousemove",C),document.addEventListener("mouseup",_),document.addEventListener("touchmove",C),document.addEventListener("touchend",_);const n=l.current;u.canCloseOnClick=!0,u.canDrag=!0,u.boundingRect=n.getBoundingClientRect(),n.style.transition="",u.x=O(t.nativeEvent),u.y=L(t.nativeEvent),"x"===e.draggableDirection?(u.start=u.x,u.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(u.start=u.y,u.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function v(){if(u.boundingRect){const{top:t,bottom:n,left:o,right:s}=u.boundingRect;e.pauseOnHover&&u.x>=o&&u.x<=s&&u.y>=t&&u.y<=n?b():E()}}function E(){a(!0)}function b(){a(!1)}function C(t){const n=l.current;u.canDrag&&n&&(u.didMove=!0,o&&b(),u.x=O(t),u.y=L(t),u.delta="x"===e.draggableDirection?u.x-u.start:u.y-u.start,u.start!==u.x&&(u.canCloseOnClick=!1),n.style.transform="translate"+e.draggableDirection+"("+u.delta+"px)",n.style.opacity=""+(1-Math.abs(u.delta/u.removalDistance)))}function _(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",_);const t=l.current;if(u.canDrag&&u.didMove&&t){if(u.canDrag=!1,Math.abs(u.delta)>u.removalDistance)return c(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform="translate"+e.draggableDirection+"(0)",t.style.opacity="1"}}s(()=>{d.current=e}),s(()=>(l.current&&l.current.addEventListener("d",E,{once:!0}),p(e.onOpen)&&e.onOpen(t(e.children)&&e.children.props),()=>{const e=d.current;p(e.onClose)&&e.onClose(t(e.children)&&e.children.props)}),[]),s(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||b(),window.addEventListener("focus",E),window.addEventListener("blur",b)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",E),window.removeEventListener("blur",b))}),[e.pauseOnFocusLoss]);const I={onMouseDown:T,onTouchStart:T,onMouseUp:v,onTouchEnd:v};return m&&f&&(I.onMouseEnter=b,I.onMouseLeave=E),h&&(I.onClick=e=>{y&&y(e),u.canCloseOnClick&&g()}),{playToast:E,pauseToast:b,isRunning:o,preventExitTransition:i,toastRef:l,eventHandlers:I}}function P(t){let{closeToast:n,theme:o,ariaLabel:s="close"}=t;return e.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+o,type:"button",onClick:e=>{e.stopPropagation(),n(e)},"aria-label":s},e.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},e.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function x(t){let{delay:n,isRunning:o,closeToast:s,type:a,hide:r,className:i,style:l,controlledProgress:u,progress:d,rtl:m,isIn:f,theme:g}=t;const y={...l,animationDuration:n+"ms",animationPlayState:o?"running":"paused",opacity:r?0:1};u&&(y.transform="scaleX("+d+")");const h=c("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+g,"Toastify__progress-bar--"+a,{"Toastify__progress-bar--rtl":m}),T=p(i)?i({rtl:m,type:a,defaultClassName:h}):c(h,i);return e.createElement("div",{role:"progressbar","aria-hidden":r?"true":"false","aria-label":"notification timer",className:T,style:y,[u&&d>=1?"onTransitionEnd":"onAnimationEnd"]:u&&d<1?null:()=>{f&&s()}})}x.defaultProps={type:h.DEFAULT,hide:!1};const B=t=>{const{isRunning:n,preventExitTransition:o,toastRef:s,eventHandlers:a}=N(t),{closeButton:r,children:i,autoClose:l,onClick:u,type:d,hideProgressBar:m,closeToast:f,transition:g,position:y,className:h,style:T,bodyClassName:v,bodyStyle:E,progressClassName:b,progressStyle:C,updateId:_,role:I,progress:O,rtl:L,toastId:P,deleteToast:B,isIn:R,isLoading:k,icon:M,theme:D}=t,w=c("Toastify__toast","Toastify__toast-theme--"+D,"Toastify__toast--"+d,{"Toastify__toast--rtl":L}),A=p(h)?h({rtl:L,position:y,type:d,defaultClassName:w}):c(w,h),F=!!O;return e.createElement(g,{isIn:R,done:B,position:y,preventExitTransition:o,nodeRef:s},e.createElement("div",{id:P,onClick:u,className:A,...a,style:T,ref:s},e.createElement("div",{...R&&{role:I},className:p(v)?v({type:d}):c("Toastify__toast-body",v),style:E},M&&e.createElement("div",{className:c("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),e.createElement("div",null,i)),function(t){if(!t)return;const n={closeToast:f,type:d,theme:D};return p(t)?t(n):e.isValidElement(t)?e.cloneElement(t,n):void 0}(r),(l||F)&&e.createElement(x,{..._&&!F?{key:"pb-"+_}:{},rtl:L,theme:D,delay:l,isRunning:n,isIn:R,closeToast:f,hide:m,type:d,style:C,className:b,controlledProgress:F,progress:O})))},R=v({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),k=v({enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0}),M=v({enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"}),D=v({enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"}),w=t=>{const{getToastToRender:n,containerRef:o,isToastActive:s}=I(t),{className:a,style:r,rtl:i,containerId:l}=t;function u(e){const t=c("Toastify__toast-container","Toastify__toast-container--"+e,{"Toastify__toast-container--rtl":i});return p(a)?a({position:e,rtl:i,defaultClassName:t}):c(t,m(a))}return e.createElement("div",{ref:o,className:"Toastify",id:l},n((t,n)=>{const o=n.length?{...r}:{...r,pointerEvents:"none"};return e.createElement("div",{className:u(t),style:o,key:"container-"+t},n.map(t=>{let{content:n,props:o}=t;return e.createElement(B,{...o,isIn:s(o.toastId),key:"toast-"+o.key,closeButton:!0===o.closeButton?P:o.closeButton},n)}))}))};w.defaultProps={position:y.TOP_RIGHT,transition:R,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:P,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let A,F=new Map,S=[];function z(){return Math.random().toString(36).substring(2,9)}function H(e){return e&&(d(e.toastId)||l(e.toastId))?e.toastId:z()}function q(e,t){return F.size>0?b.emit(0,e,t):S.push({content:e,options:t}),t.toastId}function U(e,t){return{...t,type:t&&t.type||e,toastId:H(t)}}function Q(e){return(t,n)=>q(t,U(e,n))}function G(e,t){return q(e,U(h.DEFAULT,t))}G.loading=(e,t)=>q(e,U(h.DEFAULT,{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),G.promise=function(e,t,n){let o,{pending:s,error:a,success:r}=t;s&&(o=d(s)?G.loading(s,n):G.loading(s.render,{...n,...s}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(e,t,s)=>{if(null==t)return void G.dismiss(o);const a={type:e,...i,...n,data:s},r=d(t)?{render:t}:t;return o?G.update(o,{...a,...r}):G(r.render,{...a,...r}),s},l=p(e)?e():e;return l.then(e=>c("success",r,e)).catch(e=>c("error",a,e)),l},G.success=Q(h.SUCCESS),G.info=Q(h.INFO),G.error=Q(h.ERROR),G.warning=Q(h.WARNING),G.warn=G.warning,G.dark=(e,t)=>q(e,U(h.DEFAULT,{theme:"dark",...t})),G.dismiss=e=>b.emit(1,e),G.clearWaitingQueue=function(e){return void 0===e&&(e={}),b.emit(5,e)},G.isActive=e=>{let t=!1;return F.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},G.update=function(e,t){void 0===t&&(t={}),setTimeout(()=>{const n=function(e,t){let{containerId:n}=t;const o=F.get(n||A);return o?o.getToast(e):null}(e,t);if(n){const{props:o,content:s}=n,a={...o,...t,toastId:t.toastId||e,updateId:z()};a.toastId!==e&&(a.staleId=e);const r=a.render||s;delete a.render,q(r,a)}},0)},G.done=e=>{G.update(e,{progress:1})},G.onChange=e=>(b.on(4,e),()=>{b.off(4,e)}),G.POSITION=y,G.TYPE=h,b.on(2,e=>{A=e.containerId||e,F.set(A,e),S.forEach(e=>{b.emit(0,e.content,e.options)}),S=[]}).on(3,e=>{F.delete(e.containerId||e),0===F.size&&b.off(0).off(1).off(5)});export{R as Bounce,D as Flip,_ as Icons,k as Slide,w as ToastContainer,M as Zoom,T as collapseToast,v as cssTransition,G as toast,N as useToast,I as useToastContainer}; | ||
import e,{isValidElement as t,useRef as n,useLayoutEffect as o,useEffect as s,useReducer as a,useState as r,cloneElement as i,forwardRef as c}from"react";import l from"clsx";function u(e){return"number"==typeof e&&!isNaN(e)}function d(e){return"boolean"==typeof e}function p(e){return"string"==typeof e}function m(e){return"function"==typeof e}function f(e){return p(e)||m(e)?e:null}function g(e){return 0===e||e}function y(e){return t(e)||p(e)||m(e)||u(e)}const h={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},T={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function v(e,t,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition="all "+n+"ms",requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function E(t){let{enter:a,exit:r,appendPosition:i=!1,collapse:c=!0,collapseDuration:l=300}=t;return function(t){let{children:u,position:d,preventExitTransition:p,done:m,nodeRef:f,isIn:g}=t;const y=i?a+"--"+d:a,h=i?r+"--"+d:r,T=n(),E=n(0);function b(e){if(e.target!==f.current)return;const t=f.current;t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",b),t.removeEventListener("animationcancel",b),0===E.current&&"animationcancel"!==e.type&&(t.className=T.current)}function C(){const e=f.current;e.removeEventListener("animationend",C),c?v(e,m,l):m()}return o(()=>{!function(){const e=f.current;T.current=e.className,e.className+=" "+y,e.addEventListener("animationend",b),e.addEventListener("animationcancel",b)}()},[]),s(()=>{g||(p?C():function(){E.current=1;const e=f.current;e.className+=" "+h,e.addEventListener("animationend",C)}())},[g]),e.createElement(e.Fragment,null,u)}}function b(e,t){return{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}}const C={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(e=>e!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},_=t=>{let{theme:n,type:o,...s}=t;return e.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===n?"currentColor":"var(--toastify-icon-color-"+o+")",...s})},I={info:function(t){return e.createElement(_,{...t},e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return e.createElement(_,{...t},e.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return e.createElement(_,{...t},e.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return e.createElement(_,{...t},e.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return e.createElement("div",{className:"Toastify__spinner"})}};function O(e){const[,o]=a(e=>e+1,0),[c,l]=r([]),h=n(null),T=n(new Map).current,v=e=>-1!==c.indexOf(e),E=n({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:v,getToast:e=>T.get(e)}).current;function _(e){let{containerId:t}=e;const{limit:n}=E.props;!n||t&&E.containerId!==t||(E.count-=E.queue.length,E.queue=[])}function O(e){l(t=>g(e)?t.filter(t=>t!==e):[])}function L(){const{toastContent:e,toastProps:t,staleId:n}=E.queue.shift();P(e,t,n)}function N(e,n){let{delay:s,staleId:a,...r}=n;if(!y(e)||function(e){return!h.current||E.props.enableMultiContainer&&e.containerId!==E.props.containerId||T.has(e.toastId)&&null==e.updateId}(r))return;const{toastId:c,updateId:l,data:v}=r,{props:_}=E,N=()=>O(c),x=null==l;x&&E.count++;const B={toastId:c,updateId:l,containerId:r.containerId,isLoading:r.isLoading,theme:r.theme||_.theme,icon:null!=r.icon?r.icon:_.icon,isIn:!1,key:r.key||E.toastKey++,type:r.type,closeToast:N,closeButton:r.closeButton,rtl:_.rtl,position:r.position||_.position,transition:r.transition||_.transition,className:f(r.className||_.toastClassName),bodyClassName:f(r.bodyClassName||_.bodyClassName),style:r.style||_.toastStyle,bodyStyle:r.bodyStyle||_.bodyStyle,onClick:r.onClick||_.onClick,pauseOnHover:d(r.pauseOnHover)?r.pauseOnHover:_.pauseOnHover,pauseOnFocusLoss:d(r.pauseOnFocusLoss)?r.pauseOnFocusLoss:_.pauseOnFocusLoss,draggable:d(r.draggable)?r.draggable:_.draggable,draggablePercent:r.draggablePercent||_.draggablePercent,draggableDirection:r.draggableDirection||_.draggableDirection,closeOnClick:d(r.closeOnClick)?r.closeOnClick:_.closeOnClick,progressClassName:f(r.progressClassName||_.progressClassName),progressStyle:r.progressStyle||_.progressStyle,autoClose:!r.isLoading&&(R=r.autoClose,k=_.autoClose,!1===R||u(R)&&R>0?R:k),hideProgressBar:d(r.hideProgressBar)?r.hideProgressBar:_.hideProgressBar,progress:r.progress,role:r.role||_.role,deleteToast(){const e=b(T.get(c),"removed");T.delete(c),C.emit(4,e);const t=E.queue.length;if(E.count=g(c)?E.count-1:E.count-E.displayedToast,E.count<0&&(E.count=0),t>0){const e=g(c)?1:E.props.limit;if(1===t||1===e)E.displayedToast++,L();else{const n=e>t?t:e;E.displayedToast=n;for(let e=0;e<n;e++)L()}}else o()}};var R,k;const M=I[B.type],D={theme:B.theme,type:B.type};B.icon=M&&M(D),!1===B.icon?B.icon=void 0:m(B.icon)?B.icon=B.icon(D):t(B.icon)?B.icon=i(B.icon,D):p(B.icon)?B.icon=B.icon:B.isLoading&&(B.icon=I.spinner()),m(r.onOpen)&&(B.onOpen=r.onOpen),m(r.onClose)&&(B.onClose=r.onClose),B.closeButton=_.closeButton,!1===r.closeButton||y(r.closeButton)?B.closeButton=r.closeButton:!0===r.closeButton&&(B.closeButton=!y(_.closeButton)||_.closeButton);let w=e;t(e)&&!p(e.type)?w=i(e,{closeToast:N,toastProps:B,data:v}):m(e)&&(w=e({closeToast:N,toastProps:B,data:v})),_.limit&&_.limit>0&&E.count>_.limit&&x?E.queue.push({toastContent:w,toastProps:B,staleId:a}):u(s)?setTimeout(()=>{P(w,B,a)},s):P(w,B,a)}function P(e,t,n){const{toastId:o}=t;n&&T.delete(n);const s={content:e,props:t};T.set(o,s),l(e=>[...e,o].filter(e=>e!==n)),C.emit(4,b(s,null==s.props.updateId?"added":"updated"))}return s(()=>(E.containerId=e.containerId,C.cancelEmit(3).on(0,N).on(1,e=>h.current&&O(e)).on(5,_).emit(2,E),()=>C.emit(3,E)),[]),s(()=>{E.props=e,E.isToastActive=v,E.displayedToast=c.length}),{getToastToRender:function(t){const n=new Map,o=Array.from(T.values());return e.newestOnTop&&o.reverse(),o.forEach(e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},containerRef:h,isToastActive:v}}function L(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function N(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function P(e){const[o,a]=r(!1),[i,c]=r(!1),l=n(null),u=n({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,d=n(e),{autoClose:p,pauseOnHover:f,closeToast:g,onClick:y,closeOnClick:h}=e;function T(t){if(e.draggable){u.didMove=!1,document.addEventListener("mousemove",C),document.addEventListener("mouseup",_),document.addEventListener("touchmove",C),document.addEventListener("touchend",_);const n=l.current;u.canCloseOnClick=!0,u.canDrag=!0,u.boundingRect=n.getBoundingClientRect(),n.style.transition="",u.x=L(t.nativeEvent),u.y=N(t.nativeEvent),"x"===e.draggableDirection?(u.start=u.x,u.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(u.start=u.y,u.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function v(){if(u.boundingRect){const{top:t,bottom:n,left:o,right:s}=u.boundingRect;e.pauseOnHover&&u.x>=o&&u.x<=s&&u.y>=t&&u.y<=n?b():E()}}function E(){a(!0)}function b(){a(!1)}function C(t){const n=l.current;u.canDrag&&n&&(u.didMove=!0,o&&b(),u.x=L(t),u.y=N(t),u.delta="x"===e.draggableDirection?u.x-u.start:u.y-u.start,u.start!==u.x&&(u.canCloseOnClick=!1),n.style.transform="translate"+e.draggableDirection+"("+u.delta+"px)",n.style.opacity=""+(1-Math.abs(u.delta/u.removalDistance)))}function _(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",_);const t=l.current;if(u.canDrag&&u.didMove&&t){if(u.canDrag=!1,Math.abs(u.delta)>u.removalDistance)return c(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform="translate"+e.draggableDirection+"(0)",t.style.opacity="1"}}s(()=>{d.current=e}),s(()=>(l.current&&l.current.addEventListener("d",E,{once:!0}),m(e.onOpen)&&e.onOpen(t(e.children)&&e.children.props),()=>{const e=d.current;m(e.onClose)&&e.onClose(t(e.children)&&e.children.props)}),[]),s(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||b(),window.addEventListener("focus",E),window.addEventListener("blur",b)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",E),window.removeEventListener("blur",b))}),[e.pauseOnFocusLoss]);const I={onMouseDown:T,onTouchStart:T,onMouseUp:v,onTouchEnd:v};return p&&f&&(I.onMouseEnter=b,I.onMouseLeave=E),h&&(I.onClick=e=>{y&&y(e),u.canCloseOnClick&&g()}),{playToast:E,pauseToast:b,isRunning:o,preventExitTransition:i,toastRef:l,eventHandlers:I}}function x(t){let{closeToast:n,theme:o,ariaLabel:s="close"}=t;return e.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+o,type:"button",onClick:e=>{e.stopPropagation(),n(e)},"aria-label":s},e.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},e.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function B(t){let{delay:n,isRunning:o,closeToast:s,type:a,hide:r,className:i,style:c,controlledProgress:u,progress:d,rtl:p,isIn:f,theme:g}=t;const y={...c,animationDuration:n+"ms",animationPlayState:o?"running":"paused",opacity:r?0:1};u&&(y.transform="scaleX("+d+")");const h=l("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+g,"Toastify__progress-bar--"+a,{"Toastify__progress-bar--rtl":p}),T=m(i)?i({rtl:p,type:a,defaultClassName:h}):l(h,i);return e.createElement("div",{role:"progressbar","aria-hidden":r?"true":"false","aria-label":"notification timer",className:T,style:y,[u&&d>=1?"onTransitionEnd":"onAnimationEnd"]:u&&d<1?null:()=>{f&&s()}})}B.defaultProps={type:T.DEFAULT,hide:!1};const R=t=>{const{isRunning:n,preventExitTransition:o,toastRef:s,eventHandlers:a}=P(t),{closeButton:r,children:i,autoClose:c,onClick:u,type:d,hideProgressBar:p,closeToast:f,transition:g,position:y,className:h,style:T,bodyClassName:v,bodyStyle:E,progressClassName:b,progressStyle:C,updateId:_,role:I,progress:O,rtl:L,toastId:N,deleteToast:x,isIn:R,isLoading:k,icon:M,theme:D}=t,w=l("Toastify__toast","Toastify__toast-theme--"+D,"Toastify__toast--"+d,{"Toastify__toast--rtl":L}),A=m(h)?h({rtl:L,position:y,type:d,defaultClassName:w}):l(w,h),F=!!O;return e.createElement(g,{isIn:R,done:x,position:y,preventExitTransition:o,nodeRef:s},e.createElement("div",{id:N,onClick:u,className:A,...a,style:T,ref:s},e.createElement("div",{...R&&{role:I},className:m(v)?v({type:d}):l("Toastify__toast-body",v),style:E},M&&e.createElement("div",{className:l("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),e.createElement("div",null,i)),function(t){if(!t)return;const n={closeToast:f,type:d,theme:D};return m(t)?t(n):e.isValidElement(t)?e.cloneElement(t,n):void 0}(r),(c||F)&&e.createElement(B,{..._&&!F?{key:"pb-"+_}:{},rtl:L,theme:D,delay:c,isRunning:n,isIn:R,closeToast:f,hide:p,type:d,style:C,className:b,controlledProgress:F,progress:O})))},k=E({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),M=E({enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0}),D=E({enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"}),w=E({enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"}),A=c((t,n)=>{const{getToastToRender:o,containerRef:a,isToastActive:r}=O(t),{className:i,style:c,rtl:u,containerId:d}=t;function p(e){const t=l("Toastify__toast-container","Toastify__toast-container--"+e,{"Toastify__toast-container--rtl":u});return m(i)?i({position:e,rtl:u,defaultClassName:t}):l(t,f(i))}return s(()=>{n&&(n.current=a.current)},[]),e.createElement("div",{ref:a,className:"Toastify",id:d},o((t,n)=>{const o=n.length?{...c}:{...c,pointerEvents:"none"};return e.createElement("div",{className:p(t),style:o,key:"container-"+t},n.map((t,o)=>{let{content:s,props:a}=t;return e.createElement(R,{...a,isIn:r(a.toastId),style:{"--nth":o+1,"--len":n.length},key:"toast-"+a.key,closeButton:!0===a.closeButton?x:a.closeButton},s)}))}))});A.displayName="ToastContainer",A.defaultProps={position:h.TOP_RIGHT,transition:k,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:x,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let F,S=new Map,z=[];function H(){return Math.random().toString(36).substring(2,9)}function q(e){return e&&(p(e.toastId)||u(e.toastId))?e.toastId:H()}function U(e,t){return S.size>0?C.emit(0,e,t):z.push({content:e,options:t}),t.toastId}function Q(e,t){return{...t,type:t&&t.type||e,toastId:q(t)}}function G(e){return(t,n)=>U(t,Q(e,n))}function W(e,t){return U(e,Q(T.DEFAULT,t))}W.loading=(e,t)=>U(e,Q(T.DEFAULT,{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),W.promise=function(e,t,n){let o,{pending:s,error:a,success:r}=t;s&&(o=p(s)?W.loading(s,n):W.loading(s.render,{...n,...s}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null,delay:100},c=(e,t,s)=>{if(null==t)return void W.dismiss(o);const a={type:e,...i,...n,data:s},r=p(t)?{render:t}:t;return o?W.update(o,{...a,...r}):W(r.render,{...a,...r}),s},l=m(e)?e():e;return l.then(e=>c("success",r,e)).catch(e=>c("error",a,e)),l},W.success=G(T.SUCCESS),W.info=G(T.INFO),W.error=G(T.ERROR),W.warning=G(T.WARNING),W.warn=W.warning,W.dark=(e,t)=>U(e,Q(T.DEFAULT,{theme:"dark",...t})),W.dismiss=e=>C.emit(1,e),W.clearWaitingQueue=function(e){return void 0===e&&(e={}),C.emit(5,e)},W.isActive=e=>{let t=!1;return S.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},W.update=function(e,t){void 0===t&&(t={}),setTimeout(()=>{const n=function(e,t){let{containerId:n}=t;const o=S.get(n||F);return o?o.getToast(e):null}(e,t);if(n){const{props:o,content:s}=n,a={...o,...t,toastId:t.toastId||e,updateId:H()};a.toastId!==e&&(a.staleId=e);const r=a.render||s;delete a.render,U(r,a)}},0)},W.done=e=>{W.update(e,{progress:1})},W.onChange=e=>(C.on(4,e),()=>{C.off(4,e)}),W.POSITION=h,W.TYPE=T,C.on(2,e=>{F=e.containerId||e,S.set(F,e),z.forEach(e=>{C.emit(0,e.content,e.options)}),z=[]}).on(3,e=>{S.delete(e.containerId||e),0===S.size&&C.off(0).off(1).off(5)});export{k as Bounce,w as Flip,I as Icons,M as Slide,A as ToastContainer,D as Zoom,v as collapseToast,E as cssTransition,W as toast,P as useToast,O as useToastContainer}; | ||
//# sourceMappingURL=react-toastify.esm.js.map |
@@ -1,2 +0,2 @@ | ||
var e=require("react"),t=require("clsx");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/n(e),s=/*#__PURE__*/n(t);function a(e){return"number"==typeof e&&!isNaN(e)}function r(e){return"boolean"==typeof e}function i(e){return"string"==typeof e}function l(e){return"function"==typeof e}function c(e){return i(e)||l(e)?e:null}function u(e){return 0===e||e}function d(t){return e.isValidElement(t)||i(t)||l(t)||a(t)}const f={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},p={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function m(e,t,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition="all "+n+"ms",requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function g(t){let{enter:n,exit:s,appendPosition:a=!1,collapse:r=!0,collapseDuration:i=300}=t;return function(t){let{children:l,position:c,preventExitTransition:u,done:d,nodeRef:f,isIn:p}=t;const g=a?n+"--"+c:n,y=a?s+"--"+c:s,h=e.useRef(),T=e.useRef(0);function v(e){if(e.target!==f.current)return;const t=f.current;t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",v),t.removeEventListener("animationcancel",v),0===T.current&&(t.className=h.current)}function E(){const e=f.current;e.removeEventListener("animationend",E),r?m(e,d,i):d()}return e.useLayoutEffect(()=>{!function(){const e=f.current;h.current=e.className,e.className+=" "+g,e.addEventListener("animationend",v),e.addEventListener("animationcancel",v)}()},[]),e.useEffect(()=>{p||(u?E():function(){T.current=1;const e=f.current;e.className+=" "+y,e.addEventListener("animationend",E)}())},[p]),o.default.createElement(o.default.Fragment,null,l)}}function y(e){return{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon}}const h={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(e=>e!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},T=e=>{let{theme:t,type:n,...s}=e;return o.default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":"var(--toastify-icon-color-"+n+")",...s})},v={info:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return o.default.createElement("div",{className:"Toastify__spinner"})}};function E(t){const[,n]=e.useReducer(e=>e+1,0),[o,s]=e.useState([]),f=e.useRef(null),p=e.useRef(new Map).current,m=e=>-1!==o.indexOf(e),g=e.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:m,getToast:e=>p.get(e)}).current;function T(e){let{containerId:t}=e;const{limit:n}=g.props;!n||t&&g.containerId!==t||(g.count-=g.queue.length,g.queue=[])}function E(e){s(t=>u(e)?t.filter(t=>t!==e):[])}function b(){const{toastContent:e,toastProps:t,staleId:n}=g.queue.shift();_(e,t,n)}function C(t,o){let{delay:s,staleId:m,...T}=o;if(!d(t)||function(e){return!f.current||g.props.enableMultiContainer&&e.containerId!==g.props.containerId||p.has(e.toastId)&&null==e.updateId}(T))return;const{toastId:C,updateId:I,data:L}=T,{props:O}=g,x=()=>E(C),N=null==I;N&&g.count++;const R={toastId:C,updateId:I,containerId:T.containerId,isLoading:T.isLoading,theme:T.theme||O.theme,icon:null!=T.icon?T.icon:O.icon,isIn:!1,key:T.key||g.toastKey++,type:T.type,closeToast:x,closeButton:T.closeButton,rtl:O.rtl,position:T.position||O.position,transition:T.transition||O.transition,className:c(T.className||O.toastClassName),bodyClassName:c(T.bodyClassName||O.bodyClassName),style:T.style||O.toastStyle,bodyStyle:T.bodyStyle||O.bodyStyle,onClick:T.onClick||O.onClick,pauseOnHover:r(T.pauseOnHover)?T.pauseOnHover:O.pauseOnHover,pauseOnFocusLoss:r(T.pauseOnFocusLoss)?T.pauseOnFocusLoss:O.pauseOnFocusLoss,draggable:r(T.draggable)?T.draggable:O.draggable,draggablePercent:T.draggablePercent||O.draggablePercent,draggableDirection:T.draggableDirection||O.draggableDirection,closeOnClick:r(T.closeOnClick)?T.closeOnClick:O.closeOnClick,progressClassName:c(T.progressClassName||O.progressClassName),progressStyle:T.progressStyle||O.progressStyle,autoClose:!T.isLoading&&(P=T.autoClose,B=O.autoClose,!1===P||a(P)&&P>0?P:B),hideProgressBar:r(T.hideProgressBar)?T.hideProgressBar:O.hideProgressBar,progress:T.progress,role:T.role||O.role,deleteToast(){const e=y(p.get(C));p.delete(C),h.emit(4,{toasts:Array.from(p.values(),y),removed:e});const t=g.queue.length;if(g.count=u(C)?g.count-1:g.count-g.displayedToast,g.count<0&&(g.count=0),t>0){const e=u(C)?1:g.props.limit;if(1===t||1===e)g.displayedToast++,b();else{const n=e>t?t:e;g.displayedToast=n;for(let e=0;e<n;e++)b()}}else n()}};var P,B;const k=v[R.type],M={theme:R.theme,type:R.type};R.icon=k&&k(M),!1===R.icon?R.icon=void 0:l(R.icon)?R.icon=R.icon(M):e.isValidElement(R.icon)?R.icon=e.cloneElement(R.icon,M):i(R.icon)?R.icon=R.icon:R.isLoading&&(R.icon=v.spinner()),l(T.onOpen)&&(R.onOpen=T.onOpen),l(T.onClose)&&(R.onClose=T.onClose),R.closeButton=O.closeButton,!1===T.closeButton||d(T.closeButton)?R.closeButton=T.closeButton:!0===T.closeButton&&(R.closeButton=!d(O.closeButton)||O.closeButton);let D=t;e.isValidElement(t)&&!i(t.type)?D=e.cloneElement(t,{closeToast:x,toastProps:R,data:L}):l(t)&&(D=t({closeToast:x,toastProps:R,data:L})),O.limit&&O.limit>0&&g.count>O.limit&&N?g.queue.push({toastContent:D,toastProps:R,staleId:m}):a(s)?setTimeout(()=>{_(D,R,m)},s):_(D,R,m)}function _(e,t,n){const{toastId:o}=t;n&&p.delete(n);const a={content:e,props:t};p.set(o,a),s(e=>[...e,o].filter(e=>e!==n)),h.emit(4,{toasts:Array.from(p.values(),y),added:y(a)})}return e.useEffect(()=>(g.containerId=t.containerId,h.cancelEmit(3).on(0,C).on(1,e=>f.current&&E(e)).on(5,T).emit(2,g),()=>h.emit(3,g)),[]),e.useEffect(()=>{g.props=t,g.isToastActive=m,g.displayedToast=o.length}),{getToastToRender:function(e){const n=new Map,o=Array.from(p.values());return t.newestOnTop&&o.reverse(),o.forEach(e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,t=>e(t[0],t[1]))},containerRef:f,isToastActive:m}}function b(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function C(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function _(t){const[n,o]=e.useState(!1),[s,a]=e.useState(!1),r=e.useRef(null),i=e.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,c=e.useRef(t),{autoClose:u,pauseOnHover:d,closeToast:f,onClick:p,closeOnClick:m}=t;function g(e){if(t.draggable){i.didMove=!1,document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v),document.addEventListener("touchend",E);const n=r.current;i.canCloseOnClick=!0,i.canDrag=!0,i.boundingRect=n.getBoundingClientRect(),n.style.transition="",i.x=b(e.nativeEvent),i.y=C(e.nativeEvent),"x"===t.draggableDirection?(i.start=i.x,i.removalDistance=n.offsetWidth*(t.draggablePercent/100)):(i.start=i.y,i.removalDistance=n.offsetHeight*(80===t.draggablePercent?1.5*t.draggablePercent:t.draggablePercent/100))}}function y(){if(i.boundingRect){const{top:e,bottom:n,left:o,right:s}=i.boundingRect;t.pauseOnHover&&i.x>=o&&i.x<=s&&i.y>=e&&i.y<=n?T():h()}}function h(){o(!0)}function T(){o(!1)}function v(e){const o=r.current;i.canDrag&&o&&(i.didMove=!0,n&&T(),i.x=b(e),i.y=C(e),i.delta="x"===t.draggableDirection?i.x-i.start:i.y-i.start,i.start!==i.x&&(i.canCloseOnClick=!1),o.style.transform="translate"+t.draggableDirection+"("+i.delta+"px)",o.style.opacity=""+(1-Math.abs(i.delta/i.removalDistance)))}function E(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E);const e=r.current;if(i.canDrag&&i.didMove&&e){if(i.canDrag=!1,Math.abs(i.delta)>i.removalDistance)return a(!0),void t.closeToast();e.style.transition="transform 0.2s, opacity 0.2s",e.style.transform="translate"+t.draggableDirection+"(0)",e.style.opacity="1"}}e.useEffect(()=>{c.current=t}),e.useEffect(()=>(r.current&&r.current.addEventListener("d",h,{once:!0}),l(t.onOpen)&&t.onOpen(e.isValidElement(t.children)&&t.children.props),()=>{const t=c.current;l(t.onClose)&&t.onClose(e.isValidElement(t.children)&&t.children.props)}),[]),e.useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||T(),window.addEventListener("focus",h),window.addEventListener("blur",T)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",T))}),[t.pauseOnFocusLoss]);const _={onMouseDown:g,onTouchStart:g,onMouseUp:y,onTouchEnd:y};return u&&d&&(_.onMouseEnter=T,_.onMouseLeave=h),m&&(_.onClick=e=>{p&&p(e),i.canCloseOnClick&&f()}),{playToast:h,pauseToast:T,isRunning:n,preventExitTransition:s,toastRef:r,eventHandlers:_}}function I(e){let{closeToast:t,theme:n,ariaLabel:s="close"}=e;return o.default.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+n,type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":s},o.default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},o.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function L(e){let{delay:t,isRunning:n,closeToast:a,type:r,hide:i,className:c,style:u,controlledProgress:d,progress:f,rtl:p,isIn:m,theme:g}=e;const y={...u,animationDuration:t+"ms",animationPlayState:n?"running":"paused",opacity:i?0:1};d&&(y.transform="scaleX("+f+")");const h=s.default("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+g,"Toastify__progress-bar--"+r,{"Toastify__progress-bar--rtl":p}),T=l(c)?c({rtl:p,type:r,defaultClassName:h}):s.default(h,c);return o.default.createElement("div",{role:"progressbar","aria-hidden":i?"true":"false","aria-label":"notification timer",className:T,style:y,[d&&f>=1?"onTransitionEnd":"onAnimationEnd"]:d&&f<1?null:()=>{m&&a()}})}L.defaultProps={type:p.DEFAULT,hide:!1};const O=e=>{const{isRunning:t,preventExitTransition:n,toastRef:a,eventHandlers:r}=_(e),{closeButton:i,children:c,autoClose:u,onClick:d,type:f,hideProgressBar:p,closeToast:m,transition:g,position:y,className:h,style:T,bodyClassName:v,bodyStyle:E,progressClassName:b,progressStyle:C,updateId:I,role:O,progress:x,rtl:N,toastId:R,deleteToast:P,isIn:B,isLoading:k,icon:M,theme:D}=e,w=s.default("Toastify__toast","Toastify__toast-theme--"+D,"Toastify__toast--"+f,{"Toastify__toast--rtl":N}),A=l(h)?h({rtl:N,position:y,type:f,defaultClassName:w}):s.default(w,h),S=!!x;return o.default.createElement(g,{isIn:B,done:P,position:y,preventExitTransition:n,nodeRef:a},o.default.createElement("div",{id:R,onClick:d,className:A,...r,style:T,ref:a},o.default.createElement("div",{...B&&{role:O},className:l(v)?v({type:f}):s.default("Toastify__toast-body",v),style:E},M&&o.default.createElement("div",{className:s.default("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),o.default.createElement("div",null,c)),function(e){if(!e)return;const t={closeToast:m,type:f,theme:D};return l(e)?e(t):o.default.isValidElement(e)?o.default.cloneElement(e,t):void 0}(i),(u||S)&&o.default.createElement(L,{...I&&!S?{key:"pb-"+I}:{},rtl:N,theme:D,delay:u,isRunning:t,isIn:B,closeToast:m,hide:p,type:f,style:C,className:b,controlledProgress:S,progress:x})))},x=g({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),N=g({enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0}),R=g({enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"}),P=g({enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"}),B=e=>{const{getToastToRender:t,containerRef:n,isToastActive:a}=E(e),{className:r,style:i,rtl:u,containerId:d}=e;function f(e){const t=s.default("Toastify__toast-container","Toastify__toast-container--"+e,{"Toastify__toast-container--rtl":u});return l(r)?r({position:e,rtl:u,defaultClassName:t}):s.default(t,c(r))}return o.default.createElement("div",{ref:n,className:"Toastify",id:d},t((e,t)=>{const n=t.length?{...i}:{...i,pointerEvents:"none"};return o.default.createElement("div",{className:f(e),style:n,key:"container-"+e},t.map(e=>{let{content:t,props:n}=e;return o.default.createElement(O,{...n,isIn:a(n.toastId),key:"toast-"+n.key,closeButton:!0===n.closeButton?I:n.closeButton},t)}))}))};B.defaultProps={position:f.TOP_RIGHT,transition:x,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:I,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let k,M=new Map,D=[];function w(){return Math.random().toString(36).substring(2,9)}function A(e){return e&&(i(e.toastId)||a(e.toastId))?e.toastId:w()}function S(e,t){return M.size>0?h.emit(0,e,t):D.push({content:e,options:t}),t.toastId}function F(e,t){return{...t,type:t&&t.type||e,toastId:A(t)}}function z(e){return(t,n)=>S(t,F(e,n))}function H(e,t){return S(e,F(p.DEFAULT,t))}H.loading=(e,t)=>S(e,F(p.DEFAULT,{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),H.promise=function(e,t,n){let o,{pending:s,error:a,success:r}=t;s&&(o=i(s)?H.loading(s,n):H.loading(s.render,{...n,...s}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(e,t,s)=>{if(null==t)return void H.dismiss(o);const a={type:e,...c,...n,data:s},r=i(t)?{render:t}:t;return o?H.update(o,{...a,...r}):H(r.render,{...a,...r}),s},d=l(e)?e():e;return d.then(e=>u("success",r,e)).catch(e=>u("error",a,e)),d},H.success=z(p.SUCCESS),H.info=z(p.INFO),H.error=z(p.ERROR),H.warning=z(p.WARNING),H.warn=H.warning,H.dark=(e,t)=>S(e,F(p.DEFAULT,{theme:"dark",...t})),H.dismiss=e=>h.emit(1,e),H.clearWaitingQueue=function(e){return void 0===e&&(e={}),h.emit(5,e)},H.isActive=e=>{let t=!1;return M.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},H.update=function(e,t){void 0===t&&(t={}),setTimeout(()=>{const n=function(e,t){let{containerId:n}=t;const o=M.get(n||k);return o?o.getToast(e):null}(e,t);if(n){const{props:o,content:s}=n,a={...o,...t,toastId:t.toastId||e,updateId:w()};a.toastId!==e&&(a.staleId=e);const r=a.render||s;delete a.render,S(r,a)}},0)},H.done=e=>{H.update(e,{progress:1})},H.onChange=e=>(h.on(4,e),()=>{h.off(4,e)}),H.POSITION=f,H.TYPE=p,h.on(2,e=>{k=e.containerId||e,M.set(k,e),D.forEach(e=>{h.emit(0,e.content,e.options)}),D=[]}).on(3,e=>{M.delete(e.containerId||e),0===M.size&&h.off(0).off(1).off(5)}),exports.Bounce=x,exports.Flip=P,exports.Icons=v,exports.Slide=N,exports.ToastContainer=B,exports.Zoom=R,exports.collapseToast=m,exports.cssTransition=g,exports.toast=H,exports.useToast=_,exports.useToastContainer=E; | ||
var e=require("react"),t=require("clsx");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/n(e),s=/*#__PURE__*/n(t);function a(e){return"number"==typeof e&&!isNaN(e)}function r(e){return"boolean"==typeof e}function i(e){return"string"==typeof e}function l(e){return"function"==typeof e}function c(e){return i(e)||l(e)?e:null}function u(e){return 0===e||e}function d(t){return e.isValidElement(t)||i(t)||l(t)||a(t)}const f={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},p={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function m(e,t,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition="all "+n+"ms",requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function g(t){let{enter:n,exit:s,appendPosition:a=!1,collapse:r=!0,collapseDuration:i=300}=t;return function(t){let{children:l,position:c,preventExitTransition:u,done:d,nodeRef:f,isIn:p}=t;const g=a?n+"--"+c:n,y=a?s+"--"+c:s,h=e.useRef(),T=e.useRef(0);function v(e){if(e.target!==f.current)return;const t=f.current;t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",v),t.removeEventListener("animationcancel",v),0===T.current&&"animationcancel"!==e.type&&(t.className=h.current)}function E(){const e=f.current;e.removeEventListener("animationend",E),r?m(e,d,i):d()}return e.useLayoutEffect(()=>{!function(){const e=f.current;h.current=e.className,e.className+=" "+g,e.addEventListener("animationend",v),e.addEventListener("animationcancel",v)}()},[]),e.useEffect(()=>{p||(u?E():function(){T.current=1;const e=f.current;e.className+=" "+y,e.addEventListener("animationend",E)}())},[p]),o.default.createElement(o.default.Fragment,null,l)}}function y(e,t){return{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}}const h={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(e=>e!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},T=e=>{let{theme:t,type:n,...s}=e;return o.default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":"var(--toastify-icon-color-"+n+")",...s})},v={info:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return o.default.createElement(T,{...e},o.default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return o.default.createElement("div",{className:"Toastify__spinner"})}};function E(t){const[,n]=e.useReducer(e=>e+1,0),[o,s]=e.useState([]),f=e.useRef(null),p=e.useRef(new Map).current,m=e=>-1!==o.indexOf(e),g=e.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:m,getToast:e=>p.get(e)}).current;function T(e){let{containerId:t}=e;const{limit:n}=g.props;!n||t&&g.containerId!==t||(g.count-=g.queue.length,g.queue=[])}function E(e){s(t=>u(e)?t.filter(t=>t!==e):[])}function b(){const{toastContent:e,toastProps:t,staleId:n}=g.queue.shift();_(e,t,n)}function C(t,o){let{delay:s,staleId:m,...T}=o;if(!d(t)||function(e){return!f.current||g.props.enableMultiContainer&&e.containerId!==g.props.containerId||p.has(e.toastId)&&null==e.updateId}(T))return;const{toastId:C,updateId:I,data:L}=T,{props:O}=g,N=()=>E(C),x=null==I;x&&g.count++;const R={toastId:C,updateId:I,containerId:T.containerId,isLoading:T.isLoading,theme:T.theme||O.theme,icon:null!=T.icon?T.icon:O.icon,isIn:!1,key:T.key||g.toastKey++,type:T.type,closeToast:N,closeButton:T.closeButton,rtl:O.rtl,position:T.position||O.position,transition:T.transition||O.transition,className:c(T.className||O.toastClassName),bodyClassName:c(T.bodyClassName||O.bodyClassName),style:T.style||O.toastStyle,bodyStyle:T.bodyStyle||O.bodyStyle,onClick:T.onClick||O.onClick,pauseOnHover:r(T.pauseOnHover)?T.pauseOnHover:O.pauseOnHover,pauseOnFocusLoss:r(T.pauseOnFocusLoss)?T.pauseOnFocusLoss:O.pauseOnFocusLoss,draggable:r(T.draggable)?T.draggable:O.draggable,draggablePercent:T.draggablePercent||O.draggablePercent,draggableDirection:T.draggableDirection||O.draggableDirection,closeOnClick:r(T.closeOnClick)?T.closeOnClick:O.closeOnClick,progressClassName:c(T.progressClassName||O.progressClassName),progressStyle:T.progressStyle||O.progressStyle,autoClose:!T.isLoading&&(P=T.autoClose,B=O.autoClose,!1===P||a(P)&&P>0?P:B),hideProgressBar:r(T.hideProgressBar)?T.hideProgressBar:O.hideProgressBar,progress:T.progress,role:T.role||O.role,deleteToast(){const e=y(p.get(C),"removed");p.delete(C),h.emit(4,e);const t=g.queue.length;if(g.count=u(C)?g.count-1:g.count-g.displayedToast,g.count<0&&(g.count=0),t>0){const e=u(C)?1:g.props.limit;if(1===t||1===e)g.displayedToast++,b();else{const n=e>t?t:e;g.displayedToast=n;for(let e=0;e<n;e++)b()}}else n()}};var P,B;const k=v[R.type],M={theme:R.theme,type:R.type};R.icon=k&&k(M),!1===R.icon?R.icon=void 0:l(R.icon)?R.icon=R.icon(M):e.isValidElement(R.icon)?R.icon=e.cloneElement(R.icon,M):i(R.icon)?R.icon=R.icon:R.isLoading&&(R.icon=v.spinner()),l(T.onOpen)&&(R.onOpen=T.onOpen),l(T.onClose)&&(R.onClose=T.onClose),R.closeButton=O.closeButton,!1===T.closeButton||d(T.closeButton)?R.closeButton=T.closeButton:!0===T.closeButton&&(R.closeButton=!d(O.closeButton)||O.closeButton);let w=t;e.isValidElement(t)&&!i(t.type)?w=e.cloneElement(t,{closeToast:N,toastProps:R,data:L}):l(t)&&(w=t({closeToast:N,toastProps:R,data:L})),O.limit&&O.limit>0&&g.count>O.limit&&x?g.queue.push({toastContent:w,toastProps:R,staleId:m}):a(s)?setTimeout(()=>{_(w,R,m)},s):_(w,R,m)}function _(e,t,n){const{toastId:o}=t;n&&p.delete(n);const a={content:e,props:t};p.set(o,a),s(e=>[...e,o].filter(e=>e!==n)),h.emit(4,y(a,null==a.props.updateId?"added":"updated"))}return e.useEffect(()=>(g.containerId=t.containerId,h.cancelEmit(3).on(0,C).on(1,e=>f.current&&E(e)).on(5,T).emit(2,g),()=>h.emit(3,g)),[]),e.useEffect(()=>{g.props=t,g.isToastActive=m,g.displayedToast=o.length}),{getToastToRender:function(e){const n=new Map,o=Array.from(p.values());return t.newestOnTop&&o.reverse(),o.forEach(e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,t=>e(t[0],t[1]))},containerRef:f,isToastActive:m}}function b(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function C(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function _(t){const[n,o]=e.useState(!1),[s,a]=e.useState(!1),r=e.useRef(null),i=e.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,c=e.useRef(t),{autoClose:u,pauseOnHover:d,closeToast:f,onClick:p,closeOnClick:m}=t;function g(e){if(t.draggable){i.didMove=!1,document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v),document.addEventListener("touchend",E);const n=r.current;i.canCloseOnClick=!0,i.canDrag=!0,i.boundingRect=n.getBoundingClientRect(),n.style.transition="",i.x=b(e.nativeEvent),i.y=C(e.nativeEvent),"x"===t.draggableDirection?(i.start=i.x,i.removalDistance=n.offsetWidth*(t.draggablePercent/100)):(i.start=i.y,i.removalDistance=n.offsetHeight*(80===t.draggablePercent?1.5*t.draggablePercent:t.draggablePercent/100))}}function y(){if(i.boundingRect){const{top:e,bottom:n,left:o,right:s}=i.boundingRect;t.pauseOnHover&&i.x>=o&&i.x<=s&&i.y>=e&&i.y<=n?T():h()}}function h(){o(!0)}function T(){o(!1)}function v(e){const o=r.current;i.canDrag&&o&&(i.didMove=!0,n&&T(),i.x=b(e),i.y=C(e),i.delta="x"===t.draggableDirection?i.x-i.start:i.y-i.start,i.start!==i.x&&(i.canCloseOnClick=!1),o.style.transform="translate"+t.draggableDirection+"("+i.delta+"px)",o.style.opacity=""+(1-Math.abs(i.delta/i.removalDistance)))}function E(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E);const e=r.current;if(i.canDrag&&i.didMove&&e){if(i.canDrag=!1,Math.abs(i.delta)>i.removalDistance)return a(!0),void t.closeToast();e.style.transition="transform 0.2s, opacity 0.2s",e.style.transform="translate"+t.draggableDirection+"(0)",e.style.opacity="1"}}e.useEffect(()=>{c.current=t}),e.useEffect(()=>(r.current&&r.current.addEventListener("d",h,{once:!0}),l(t.onOpen)&&t.onOpen(e.isValidElement(t.children)&&t.children.props),()=>{const t=c.current;l(t.onClose)&&t.onClose(e.isValidElement(t.children)&&t.children.props)}),[]),e.useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||T(),window.addEventListener("focus",h),window.addEventListener("blur",T)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",T))}),[t.pauseOnFocusLoss]);const _={onMouseDown:g,onTouchStart:g,onMouseUp:y,onTouchEnd:y};return u&&d&&(_.onMouseEnter=T,_.onMouseLeave=h),m&&(_.onClick=e=>{p&&p(e),i.canCloseOnClick&&f()}),{playToast:h,pauseToast:T,isRunning:n,preventExitTransition:s,toastRef:r,eventHandlers:_}}function I(e){let{closeToast:t,theme:n,ariaLabel:s="close"}=e;return o.default.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+n,type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":s},o.default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},o.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function L(e){let{delay:t,isRunning:n,closeToast:a,type:r,hide:i,className:c,style:u,controlledProgress:d,progress:f,rtl:p,isIn:m,theme:g}=e;const y={...u,animationDuration:t+"ms",animationPlayState:n?"running":"paused",opacity:i?0:1};d&&(y.transform="scaleX("+f+")");const h=s.default("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+g,"Toastify__progress-bar--"+r,{"Toastify__progress-bar--rtl":p}),T=l(c)?c({rtl:p,type:r,defaultClassName:h}):s.default(h,c);return o.default.createElement("div",{role:"progressbar","aria-hidden":i?"true":"false","aria-label":"notification timer",className:T,style:y,[d&&f>=1?"onTransitionEnd":"onAnimationEnd"]:d&&f<1?null:()=>{m&&a()}})}L.defaultProps={type:p.DEFAULT,hide:!1};const O=e=>{const{isRunning:t,preventExitTransition:n,toastRef:a,eventHandlers:r}=_(e),{closeButton:i,children:c,autoClose:u,onClick:d,type:f,hideProgressBar:p,closeToast:m,transition:g,position:y,className:h,style:T,bodyClassName:v,bodyStyle:E,progressClassName:b,progressStyle:C,updateId:I,role:O,progress:N,rtl:x,toastId:R,deleteToast:P,isIn:B,isLoading:k,icon:M,theme:w}=e,D=s.default("Toastify__toast","Toastify__toast-theme--"+w,"Toastify__toast--"+f,{"Toastify__toast--rtl":x}),A=l(h)?h({rtl:x,position:y,type:f,defaultClassName:D}):s.default(D,h),S=!!N;return o.default.createElement(g,{isIn:B,done:P,position:y,preventExitTransition:n,nodeRef:a},o.default.createElement("div",{id:R,onClick:d,className:A,...r,style:T,ref:a},o.default.createElement("div",{...B&&{role:O},className:l(v)?v({type:f}):s.default("Toastify__toast-body",v),style:E},M&&o.default.createElement("div",{className:s.default("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),o.default.createElement("div",null,c)),function(e){if(!e)return;const t={closeToast:m,type:f,theme:w};return l(e)?e(t):o.default.isValidElement(e)?o.default.cloneElement(e,t):void 0}(i),(u||S)&&o.default.createElement(L,{...I&&!S?{key:"pb-"+I}:{},rtl:x,theme:w,delay:u,isRunning:t,isIn:B,closeToast:m,hide:p,type:f,style:C,className:b,controlledProgress:S,progress:N})))},N=g({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),x=g({enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0}),R=g({enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"}),P=g({enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"}),B=e.forwardRef((t,n)=>{const{getToastToRender:a,containerRef:r,isToastActive:i}=E(t),{className:u,style:d,rtl:f,containerId:p}=t;function m(e){const t=s.default("Toastify__toast-container","Toastify__toast-container--"+e,{"Toastify__toast-container--rtl":f});return l(u)?u({position:e,rtl:f,defaultClassName:t}):s.default(t,c(u))}return e.useEffect(()=>{n&&(n.current=r.current)},[]),o.default.createElement("div",{ref:r,className:"Toastify",id:p},a((e,t)=>{const n=t.length?{...d}:{...d,pointerEvents:"none"};return o.default.createElement("div",{className:m(e),style:n,key:"container-"+e},t.map((e,n)=>{let{content:s,props:a}=e;return o.default.createElement(O,{...a,isIn:i(a.toastId),style:{"--nth":n+1,"--len":t.length},key:"toast-"+a.key,closeButton:!0===a.closeButton?I:a.closeButton},s)}))}))});B.displayName="ToastContainer",B.defaultProps={position:f.TOP_RIGHT,transition:N,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:I,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let k,M=new Map,w=[];function D(){return Math.random().toString(36).substring(2,9)}function A(e){return e&&(i(e.toastId)||a(e.toastId))?e.toastId:D()}function S(e,t){return M.size>0?h.emit(0,e,t):w.push({content:e,options:t}),t.toastId}function F(e,t){return{...t,type:t&&t.type||e,toastId:A(t)}}function z(e){return(t,n)=>S(t,F(e,n))}function H(e,t){return S(e,F(p.DEFAULT,t))}H.loading=(e,t)=>S(e,F(p.DEFAULT,{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),H.promise=function(e,t,n){let o,{pending:s,error:a,success:r}=t;s&&(o=i(s)?H.loading(s,n):H.loading(s.render,{...n,...s}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null,delay:100},u=(e,t,s)=>{if(null==t)return void H.dismiss(o);const a={type:e,...c,...n,data:s},r=i(t)?{render:t}:t;return o?H.update(o,{...a,...r}):H(r.render,{...a,...r}),s},d=l(e)?e():e;return d.then(e=>u("success",r,e)).catch(e=>u("error",a,e)),d},H.success=z(p.SUCCESS),H.info=z(p.INFO),H.error=z(p.ERROR),H.warning=z(p.WARNING),H.warn=H.warning,H.dark=(e,t)=>S(e,F(p.DEFAULT,{theme:"dark",...t})),H.dismiss=e=>h.emit(1,e),H.clearWaitingQueue=function(e){return void 0===e&&(e={}),h.emit(5,e)},H.isActive=e=>{let t=!1;return M.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},H.update=function(e,t){void 0===t&&(t={}),setTimeout(()=>{const n=function(e,t){let{containerId:n}=t;const o=M.get(n||k);return o?o.getToast(e):null}(e,t);if(n){const{props:o,content:s}=n,a={...o,...t,toastId:t.toastId||e,updateId:D()};a.toastId!==e&&(a.staleId=e);const r=a.render||s;delete a.render,S(r,a)}},0)},H.done=e=>{H.update(e,{progress:1})},H.onChange=e=>(h.on(4,e),()=>{h.off(4,e)}),H.POSITION=f,H.TYPE=p,h.on(2,e=>{k=e.containerId||e,M.set(k,e),w.forEach(e=>{h.emit(0,e.content,e.options)}),w=[]}).on(3,e=>{M.delete(e.containerId||e),0===M.size&&h.off(0).off(1).off(5)}),exports.Bounce=N,exports.Flip=P,exports.Icons=v,exports.Slide=x,exports.ToastContainer=B,exports.Zoom=R,exports.collapseToast=m,exports.cssTransition=g,exports.toast=H,exports.useToast=_,exports.useToastContainer=E; | ||
//# sourceMappingURL=react-toastify.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("clsx")):"function"==typeof define&&define.amd?define(["exports","react","clsx"],t):t((e||self).reactToastify={},e.react,e.clsx)}(this,function(e,t,n){function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/o(t),a=/*#__PURE__*/o(n);function i(e){return"number"==typeof e&&!isNaN(e)}function r(e){return"boolean"==typeof e}function l(e){return"string"==typeof e}function c(e){return"function"==typeof e}function u(e){return l(e)||c(e)?e:null}function d(e){return 0===e||e}function f(e){return t.isValidElement(e)||l(e)||c(e)||i(e)}const p={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},m={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function g(e,t,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition="all "+n+"ms",requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function y(e){let{enter:n,exit:o,appendPosition:a=!1,collapse:i=!0,collapseDuration:r=300}=e;return function(e){let{children:l,position:c,preventExitTransition:u,done:d,nodeRef:f,isIn:p}=e;const m=a?n+"--"+c:n,y=a?o+"--"+c:o,h=t.useRef(),T=t.useRef(0);function v(e){if(e.target!==f.current)return;const t=f.current;t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",v),t.removeEventListener("animationcancel",v),0===T.current&&(t.className=h.current)}function E(){const e=f.current;e.removeEventListener("animationend",E),i?g(e,d,r):d()}return t.useLayoutEffect(()=>{!function(){const e=f.current;h.current=e.className,e.className+=" "+m,e.addEventListener("animationend",v),e.addEventListener("animationcancel",v)}()},[]),t.useEffect(()=>{p||(u?E():function(){T.current=1;const e=f.current;e.className+=" "+y,e.addEventListener("animationend",E)}())},[p]),s.default.createElement(s.default.Fragment,null,l)}}function h(e){return{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon}}const T={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(e=>e!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},v=e=>{let{theme:t,type:n,...o}=e;return s.default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":"var(--toastify-icon-color-"+n+")",...o})},E={info:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return s.default.createElement("div",{className:"Toastify__spinner"})}};function b(e){const[,n]=t.useReducer(e=>e+1,0),[o,s]=t.useState([]),a=t.useRef(null),p=t.useRef(new Map).current,m=e=>-1!==o.indexOf(e),g=t.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:m,getToast:e=>p.get(e)}).current;function y(e){let{containerId:t}=e;const{limit:n}=g.props;!n||t&&g.containerId!==t||(g.count-=g.queue.length,g.queue=[])}function v(e){s(t=>d(e)?t.filter(t=>t!==e):[])}function b(){const{toastContent:e,toastProps:t,staleId:n}=g.queue.shift();_(e,t,n)}function C(e,o){let{delay:s,staleId:m,...y}=o;if(!f(e)||function(e){return!a.current||g.props.enableMultiContainer&&e.containerId!==g.props.containerId||p.has(e.toastId)&&null==e.updateId}(y))return;const{toastId:C,updateId:I,data:L}=y,{props:O}=g,N=()=>v(C),R=null==I;R&&g.count++;const x={toastId:C,updateId:I,containerId:y.containerId,isLoading:y.isLoading,theme:y.theme||O.theme,icon:null!=y.icon?y.icon:O.icon,isIn:!1,key:y.key||g.toastKey++,type:y.type,closeToast:N,closeButton:y.closeButton,rtl:O.rtl,position:y.position||O.position,transition:y.transition||O.transition,className:u(y.className||O.toastClassName),bodyClassName:u(y.bodyClassName||O.bodyClassName),style:y.style||O.toastStyle,bodyStyle:y.bodyStyle||O.bodyStyle,onClick:y.onClick||O.onClick,pauseOnHover:r(y.pauseOnHover)?y.pauseOnHover:O.pauseOnHover,pauseOnFocusLoss:r(y.pauseOnFocusLoss)?y.pauseOnFocusLoss:O.pauseOnFocusLoss,draggable:r(y.draggable)?y.draggable:O.draggable,draggablePercent:y.draggablePercent||O.draggablePercent,draggableDirection:y.draggableDirection||O.draggableDirection,closeOnClick:r(y.closeOnClick)?y.closeOnClick:O.closeOnClick,progressClassName:u(y.progressClassName||O.progressClassName),progressStyle:y.progressStyle||O.progressStyle,autoClose:!y.isLoading&&(P=y.autoClose,B=O.autoClose,!1===P||i(P)&&P>0?P:B),hideProgressBar:r(y.hideProgressBar)?y.hideProgressBar:O.hideProgressBar,progress:y.progress,role:y.role||O.role,deleteToast(){const e=h(p.get(C));p.delete(C),T.emit(4,{toasts:Array.from(p.values(),h),removed:e});const t=g.queue.length;if(g.count=d(C)?g.count-1:g.count-g.displayedToast,g.count<0&&(g.count=0),t>0){const e=d(C)?1:g.props.limit;if(1===t||1===e)g.displayedToast++,b();else{const n=e>t?t:e;g.displayedToast=n;for(let e=0;e<n;e++)b()}}else n()}};var P,B;const k=E[x.type],M={theme:x.theme,type:x.type};x.icon=k&&k(M),!1===x.icon?x.icon=void 0:c(x.icon)?x.icon=x.icon(M):t.isValidElement(x.icon)?x.icon=t.cloneElement(x.icon,M):l(x.icon)?x.icon=x.icon:x.isLoading&&(x.icon=E.spinner()),c(y.onOpen)&&(x.onOpen=y.onOpen),c(y.onClose)&&(x.onClose=y.onClose),x.closeButton=O.closeButton,!1===y.closeButton||f(y.closeButton)?x.closeButton=y.closeButton:!0===y.closeButton&&(x.closeButton=!f(O.closeButton)||O.closeButton);let D=e;t.isValidElement(e)&&!l(e.type)?D=t.cloneElement(e,{closeToast:N,toastProps:x,data:L}):c(e)&&(D=e({closeToast:N,toastProps:x,data:L})),O.limit&&O.limit>0&&g.count>O.limit&&R?g.queue.push({toastContent:D,toastProps:x,staleId:m}):i(s)?setTimeout(()=>{_(D,x,m)},s):_(D,x,m)}function _(e,t,n){const{toastId:o}=t;n&&p.delete(n);const a={content:e,props:t};p.set(o,a),s(e=>[...e,o].filter(e=>e!==n)),T.emit(4,{toasts:Array.from(p.values(),h),added:h(a)})}return t.useEffect(()=>(g.containerId=e.containerId,T.cancelEmit(3).on(0,C).on(1,e=>a.current&&v(e)).on(5,y).emit(2,g),()=>T.emit(3,g)),[]),t.useEffect(()=>{g.props=e,g.isToastActive=m,g.displayedToast=o.length}),{getToastToRender:function(t){const n=new Map,o=Array.from(p.values());return e.newestOnTop&&o.reverse(),o.forEach(e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},containerRef:a,isToastActive:m}}function C(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function _(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function I(e){const[n,o]=t.useState(!1),[s,a]=t.useState(!1),i=t.useRef(null),r=t.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,l=t.useRef(e),{autoClose:u,pauseOnHover:d,closeToast:f,onClick:p,closeOnClick:m}=e;function g(t){if(e.draggable){r.didMove=!1,document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v),document.addEventListener("touchend",E);const n=i.current;r.canCloseOnClick=!0,r.canDrag=!0,r.boundingRect=n.getBoundingClientRect(),n.style.transition="",r.x=C(t.nativeEvent),r.y=_(t.nativeEvent),"x"===e.draggableDirection?(r.start=r.x,r.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(r.start=r.y,r.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function y(){if(r.boundingRect){const{top:t,bottom:n,left:o,right:s}=r.boundingRect;e.pauseOnHover&&r.x>=o&&r.x<=s&&r.y>=t&&r.y<=n?T():h()}}function h(){o(!0)}function T(){o(!1)}function v(t){const o=i.current;r.canDrag&&o&&(r.didMove=!0,n&&T(),r.x=C(t),r.y=_(t),r.delta="x"===e.draggableDirection?r.x-r.start:r.y-r.start,r.start!==r.x&&(r.canCloseOnClick=!1),o.style.transform="translate"+e.draggableDirection+"("+r.delta+"px)",o.style.opacity=""+(1-Math.abs(r.delta/r.removalDistance)))}function E(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E);const t=i.current;if(r.canDrag&&r.didMove&&t){if(r.canDrag=!1,Math.abs(r.delta)>r.removalDistance)return a(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform="translate"+e.draggableDirection+"(0)",t.style.opacity="1"}}t.useEffect(()=>{l.current=e}),t.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),c(e.onOpen)&&e.onOpen(t.isValidElement(e.children)&&e.children.props),()=>{const e=l.current;c(e.onClose)&&e.onClose(t.isValidElement(e.children)&&e.children.props)}),[]),t.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||T(),window.addEventListener("focus",h),window.addEventListener("blur",T)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",T))}),[e.pauseOnFocusLoss]);const b={onMouseDown:g,onTouchStart:g,onMouseUp:y,onTouchEnd:y};return u&&d&&(b.onMouseEnter=T,b.onMouseLeave=h),m&&(b.onClick=e=>{p&&p(e),r.canCloseOnClick&&f()}),{playToast:h,pauseToast:T,isRunning:n,preventExitTransition:s,toastRef:i,eventHandlers:b}}function L(e){let{closeToast:t,theme:n,ariaLabel:o="close"}=e;return s.default.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+n,type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":o},s.default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},s.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function O(e){let{delay:t,isRunning:n,closeToast:o,type:i,hide:r,className:l,style:u,controlledProgress:d,progress:f,rtl:p,isIn:m,theme:g}=e;const y={...u,animationDuration:t+"ms",animationPlayState:n?"running":"paused",opacity:r?0:1};d&&(y.transform="scaleX("+f+")");const h=a.default("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+g,"Toastify__progress-bar--"+i,{"Toastify__progress-bar--rtl":p}),T=c(l)?l({rtl:p,type:i,defaultClassName:h}):a.default(h,l);return s.default.createElement("div",{role:"progressbar","aria-hidden":r?"true":"false","aria-label":"notification timer",className:T,style:y,[d&&f>=1?"onTransitionEnd":"onAnimationEnd"]:d&&f<1?null:()=>{m&&o()}})}O.defaultProps={type:m.DEFAULT,hide:!1};const N=e=>{const{isRunning:t,preventExitTransition:n,toastRef:o,eventHandlers:i}=I(e),{closeButton:r,children:l,autoClose:u,onClick:d,type:f,hideProgressBar:p,closeToast:m,transition:g,position:y,className:h,style:T,bodyClassName:v,bodyStyle:E,progressClassName:b,progressStyle:C,updateId:_,role:L,progress:N,rtl:R,toastId:x,deleteToast:P,isIn:B,isLoading:k,icon:M,theme:D}=e,w=a.default("Toastify__toast","Toastify__toast-theme--"+D,"Toastify__toast--"+f,{"Toastify__toast--rtl":R}),A=c(h)?h({rtl:R,position:y,type:f,defaultClassName:w}):a.default(w,h),S=!!N;return s.default.createElement(g,{isIn:B,done:P,position:y,preventExitTransition:n,nodeRef:o},s.default.createElement("div",{id:x,onClick:d,className:A,...i,style:T,ref:o},s.default.createElement("div",{...B&&{role:L},className:c(v)?v({type:f}):a.default("Toastify__toast-body",v),style:E},M&&s.default.createElement("div",{className:a.default("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),s.default.createElement("div",null,l)),function(e){if(!e)return;const t={closeToast:m,type:f,theme:D};return c(e)?e(t):s.default.isValidElement(e)?s.default.cloneElement(e,t):void 0}(r),(u||S)&&s.default.createElement(O,{..._&&!S?{key:"pb-"+_}:{},rtl:R,theme:D,delay:u,isRunning:t,isIn:B,closeToast:m,hide:p,type:f,style:C,className:b,controlledProgress:S,progress:N})))},R=y({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),x=y({enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0}),P=y({enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"}),B=y({enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"}),k=e=>{const{getToastToRender:t,containerRef:n,isToastActive:o}=b(e),{className:i,style:r,rtl:l,containerId:d}=e;function f(e){const t=a.default("Toastify__toast-container","Toastify__toast-container--"+e,{"Toastify__toast-container--rtl":l});return c(i)?i({position:e,rtl:l,defaultClassName:t}):a.default(t,u(i))}return s.default.createElement("div",{ref:n,className:"Toastify",id:d},t((e,t)=>{const n=t.length?{...r}:{...r,pointerEvents:"none"};return s.default.createElement("div",{className:f(e),style:n,key:"container-"+e},t.map(e=>{let{content:t,props:n}=e;return s.default.createElement(N,{...n,isIn:o(n.toastId),key:"toast-"+n.key,closeButton:!0===n.closeButton?L:n.closeButton},t)}))}))};k.defaultProps={position:p.TOP_RIGHT,transition:R,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:L,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let M,D=new Map,w=[];function A(){return Math.random().toString(36).substring(2,9)}function S(e){return e&&(l(e.toastId)||i(e.toastId))?e.toastId:A()}function F(e,t){return D.size>0?T.emit(0,e,t):w.push({content:e,options:t}),t.toastId}function z(e,t){return{...t,type:t&&t.type||e,toastId:S(t)}}function H(e){return(t,n)=>F(t,z(e,n))}function q(e,t){return F(e,z(m.DEFAULT,t))}q.loading=(e,t)=>F(e,z(m.DEFAULT,{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),q.promise=function(e,t,n){let o,{pending:s,error:a,success:i}=t;s&&(o=l(s)?q.loading(s,n):q.loading(s.render,{...n,...s}));const r={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(e,t,s)=>{if(null==t)return void q.dismiss(o);const a={type:e,...r,...n,data:s},i=l(t)?{render:t}:t;return o?q.update(o,{...a,...i}):q(i.render,{...a,...i}),s},d=c(e)?e():e;return d.then(e=>u("success",i,e)).catch(e=>u("error",a,e)),d},q.success=H(m.SUCCESS),q.info=H(m.INFO),q.error=H(m.ERROR),q.warning=H(m.WARNING),q.warn=q.warning,q.dark=(e,t)=>F(e,z(m.DEFAULT,{theme:"dark",...t})),q.dismiss=e=>T.emit(1,e),q.clearWaitingQueue=function(e){return void 0===e&&(e={}),T.emit(5,e)},q.isActive=e=>{let t=!1;return D.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},q.update=function(e,t){void 0===t&&(t={}),setTimeout(()=>{const n=function(e,t){let{containerId:n}=t;const o=D.get(n||M);return o?o.getToast(e):null}(e,t);if(n){const{props:o,content:s}=n,a={...o,...t,toastId:t.toastId||e,updateId:A()};a.toastId!==e&&(a.staleId=e);const i=a.render||s;delete a.render,F(i,a)}},0)},q.done=e=>{q.update(e,{progress:1})},q.onChange=e=>(T.on(4,e),()=>{T.off(4,e)}),q.POSITION=p,q.TYPE=m,T.on(2,e=>{M=e.containerId||e,D.set(M,e),w.forEach(e=>{T.emit(0,e.content,e.options)}),w=[]}).on(3,e=>{D.delete(e.containerId||e),0===D.size&&T.off(0).off(1).off(5)}),e.Bounce=R,e.Flip=B,e.Icons=E,e.Slide=x,e.ToastContainer=k,e.Zoom=P,e.collapseToast=g,e.cssTransition=y,e.toast=q,e.useToast=I,e.useToastContainer=b}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("clsx")):"function"==typeof define&&define.amd?define(["exports","react","clsx"],t):t((e||self).reactToastify={},e.react,e.clsx)}(this,function(e,t,n){function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/o(t),a=/*#__PURE__*/o(n);function i(e){return"number"==typeof e&&!isNaN(e)}function r(e){return"boolean"==typeof e}function l(e){return"string"==typeof e}function c(e){return"function"==typeof e}function u(e){return l(e)||c(e)?e:null}function d(e){return 0===e||e}function f(e){return t.isValidElement(e)||l(e)||c(e)||i(e)}const p={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},m={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"};function g(e,t,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition="all "+n+"ms",requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function y(e){let{enter:n,exit:o,appendPosition:a=!1,collapse:i=!0,collapseDuration:r=300}=e;return function(e){let{children:l,position:c,preventExitTransition:u,done:d,nodeRef:f,isIn:p}=e;const m=a?n+"--"+c:n,y=a?o+"--"+c:o,h=t.useRef(),T=t.useRef(0);function v(e){if(e.target!==f.current)return;const t=f.current;t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",v),t.removeEventListener("animationcancel",v),0===T.current&&"animationcancel"!==e.type&&(t.className=h.current)}function E(){const e=f.current;e.removeEventListener("animationend",E),i?g(e,d,r):d()}return t.useLayoutEffect(()=>{!function(){const e=f.current;h.current=e.className,e.className+=" "+m,e.addEventListener("animationend",v),e.addEventListener("animationcancel",v)}()},[]),t.useEffect(()=>{p||(u?E():function(){T.current=1;const e=f.current;e.className+=" "+y,e.addEventListener("animationend",E)}())},[p]),s.default.createElement(s.default.Fragment,null,l)}}function h(e,t){return{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}}const T={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(e=>e!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},v=e=>{let{theme:t,type:n,...o}=e;return s.default.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":"var(--toastify-icon-color-"+n+")",...o})},E={info:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return s.default.createElement(v,{...e},s.default.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return s.default.createElement("div",{className:"Toastify__spinner"})}};function b(e){const[,n]=t.useReducer(e=>e+1,0),[o,s]=t.useState([]),a=t.useRef(null),p=t.useRef(new Map).current,m=e=>-1!==o.indexOf(e),g=t.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:m,getToast:e=>p.get(e)}).current;function y(e){let{containerId:t}=e;const{limit:n}=g.props;!n||t&&g.containerId!==t||(g.count-=g.queue.length,g.queue=[])}function v(e){s(t=>d(e)?t.filter(t=>t!==e):[])}function b(){const{toastContent:e,toastProps:t,staleId:n}=g.queue.shift();_(e,t,n)}function C(e,o){let{delay:s,staleId:m,...y}=o;if(!f(e)||function(e){return!a.current||g.props.enableMultiContainer&&e.containerId!==g.props.containerId||p.has(e.toastId)&&null==e.updateId}(y))return;const{toastId:C,updateId:I,data:L}=y,{props:O}=g,N=()=>v(C),R=null==I;R&&g.count++;const x={toastId:C,updateId:I,containerId:y.containerId,isLoading:y.isLoading,theme:y.theme||O.theme,icon:null!=y.icon?y.icon:O.icon,isIn:!1,key:y.key||g.toastKey++,type:y.type,closeToast:N,closeButton:y.closeButton,rtl:O.rtl,position:y.position||O.position,transition:y.transition||O.transition,className:u(y.className||O.toastClassName),bodyClassName:u(y.bodyClassName||O.bodyClassName),style:y.style||O.toastStyle,bodyStyle:y.bodyStyle||O.bodyStyle,onClick:y.onClick||O.onClick,pauseOnHover:r(y.pauseOnHover)?y.pauseOnHover:O.pauseOnHover,pauseOnFocusLoss:r(y.pauseOnFocusLoss)?y.pauseOnFocusLoss:O.pauseOnFocusLoss,draggable:r(y.draggable)?y.draggable:O.draggable,draggablePercent:y.draggablePercent||O.draggablePercent,draggableDirection:y.draggableDirection||O.draggableDirection,closeOnClick:r(y.closeOnClick)?y.closeOnClick:O.closeOnClick,progressClassName:u(y.progressClassName||O.progressClassName),progressStyle:y.progressStyle||O.progressStyle,autoClose:!y.isLoading&&(P=y.autoClose,B=O.autoClose,!1===P||i(P)&&P>0?P:B),hideProgressBar:r(y.hideProgressBar)?y.hideProgressBar:O.hideProgressBar,progress:y.progress,role:y.role||O.role,deleteToast(){const e=h(p.get(C),"removed");p.delete(C),T.emit(4,e);const t=g.queue.length;if(g.count=d(C)?g.count-1:g.count-g.displayedToast,g.count<0&&(g.count=0),t>0){const e=d(C)?1:g.props.limit;if(1===t||1===e)g.displayedToast++,b();else{const n=e>t?t:e;g.displayedToast=n;for(let e=0;e<n;e++)b()}}else n()}};var P,B;const k=E[x.type],M={theme:x.theme,type:x.type};x.icon=k&&k(M),!1===x.icon?x.icon=void 0:c(x.icon)?x.icon=x.icon(M):t.isValidElement(x.icon)?x.icon=t.cloneElement(x.icon,M):l(x.icon)?x.icon=x.icon:x.isLoading&&(x.icon=E.spinner()),c(y.onOpen)&&(x.onOpen=y.onOpen),c(y.onClose)&&(x.onClose=y.onClose),x.closeButton=O.closeButton,!1===y.closeButton||f(y.closeButton)?x.closeButton=y.closeButton:!0===y.closeButton&&(x.closeButton=!f(O.closeButton)||O.closeButton);let w=e;t.isValidElement(e)&&!l(e.type)?w=t.cloneElement(e,{closeToast:N,toastProps:x,data:L}):c(e)&&(w=e({closeToast:N,toastProps:x,data:L})),O.limit&&O.limit>0&&g.count>O.limit&&R?g.queue.push({toastContent:w,toastProps:x,staleId:m}):i(s)?setTimeout(()=>{_(w,x,m)},s):_(w,x,m)}function _(e,t,n){const{toastId:o}=t;n&&p.delete(n);const a={content:e,props:t};p.set(o,a),s(e=>[...e,o].filter(e=>e!==n)),T.emit(4,h(a,null==a.props.updateId?"added":"updated"))}return t.useEffect(()=>(g.containerId=e.containerId,T.cancelEmit(3).on(0,C).on(1,e=>a.current&&v(e)).on(5,y).emit(2,g),()=>T.emit(3,g)),[]),t.useEffect(()=>{g.props=e,g.isToastActive=m,g.displayedToast=o.length}),{getToastToRender:function(t){const n=new Map,o=Array.from(p.values());return e.newestOnTop&&o.reverse(),o.forEach(e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)}),Array.from(n,e=>t(e[0],e[1]))},containerRef:a,isToastActive:m}}function C(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function _(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function I(e){const[n,o]=t.useState(!1),[s,a]=t.useState(!1),i=t.useRef(null),r=t.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,l=t.useRef(e),{autoClose:u,pauseOnHover:d,closeToast:f,onClick:p,closeOnClick:m}=e;function g(t){if(e.draggable){r.didMove=!1,document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v),document.addEventListener("touchend",E);const n=i.current;r.canCloseOnClick=!0,r.canDrag=!0,r.boundingRect=n.getBoundingClientRect(),n.style.transition="",r.x=C(t.nativeEvent),r.y=_(t.nativeEvent),"x"===e.draggableDirection?(r.start=r.x,r.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(r.start=r.y,r.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function y(){if(r.boundingRect){const{top:t,bottom:n,left:o,right:s}=r.boundingRect;e.pauseOnHover&&r.x>=o&&r.x<=s&&r.y>=t&&r.y<=n?T():h()}}function h(){o(!0)}function T(){o(!1)}function v(t){const o=i.current;r.canDrag&&o&&(r.didMove=!0,n&&T(),r.x=C(t),r.y=_(t),r.delta="x"===e.draggableDirection?r.x-r.start:r.y-r.start,r.start!==r.x&&(r.canCloseOnClick=!1),o.style.transform="translate"+e.draggableDirection+"("+r.delta+"px)",o.style.opacity=""+(1-Math.abs(r.delta/r.removalDistance)))}function E(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E);const t=i.current;if(r.canDrag&&r.didMove&&t){if(r.canDrag=!1,Math.abs(r.delta)>r.removalDistance)return a(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform="translate"+e.draggableDirection+"(0)",t.style.opacity="1"}}t.useEffect(()=>{l.current=e}),t.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),c(e.onOpen)&&e.onOpen(t.isValidElement(e.children)&&e.children.props),()=>{const e=l.current;c(e.onClose)&&e.onClose(t.isValidElement(e.children)&&e.children.props)}),[]),t.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||T(),window.addEventListener("focus",h),window.addEventListener("blur",T)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",T))}),[e.pauseOnFocusLoss]);const b={onMouseDown:g,onTouchStart:g,onMouseUp:y,onTouchEnd:y};return u&&d&&(b.onMouseEnter=T,b.onMouseLeave=h),m&&(b.onClick=e=>{p&&p(e),r.canCloseOnClick&&f()}),{playToast:h,pauseToast:T,isRunning:n,preventExitTransition:s,toastRef:i,eventHandlers:b}}function L(e){let{closeToast:t,theme:n,ariaLabel:o="close"}=e;return s.default.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+n,type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":o},s.default.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},s.default.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function O(e){let{delay:t,isRunning:n,closeToast:o,type:i,hide:r,className:l,style:u,controlledProgress:d,progress:f,rtl:p,isIn:m,theme:g}=e;const y={...u,animationDuration:t+"ms",animationPlayState:n?"running":"paused",opacity:r?0:1};d&&(y.transform="scaleX("+f+")");const h=a.default("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated","Toastify__progress-bar-theme--"+g,"Toastify__progress-bar--"+i,{"Toastify__progress-bar--rtl":p}),T=c(l)?l({rtl:p,type:i,defaultClassName:h}):a.default(h,l);return s.default.createElement("div",{role:"progressbar","aria-hidden":r?"true":"false","aria-label":"notification timer",className:T,style:y,[d&&f>=1?"onTransitionEnd":"onAnimationEnd"]:d&&f<1?null:()=>{m&&o()}})}O.defaultProps={type:m.DEFAULT,hide:!1};const N=e=>{const{isRunning:t,preventExitTransition:n,toastRef:o,eventHandlers:i}=I(e),{closeButton:r,children:l,autoClose:u,onClick:d,type:f,hideProgressBar:p,closeToast:m,transition:g,position:y,className:h,style:T,bodyClassName:v,bodyStyle:E,progressClassName:b,progressStyle:C,updateId:_,role:L,progress:N,rtl:R,toastId:x,deleteToast:P,isIn:B,isLoading:k,icon:M,theme:w}=e,D=a.default("Toastify__toast","Toastify__toast-theme--"+w,"Toastify__toast--"+f,{"Toastify__toast--rtl":R}),A=c(h)?h({rtl:R,position:y,type:f,defaultClassName:D}):a.default(D,h),S=!!N;return s.default.createElement(g,{isIn:B,done:P,position:y,preventExitTransition:n,nodeRef:o},s.default.createElement("div",{id:x,onClick:d,className:A,...i,style:T,ref:o},s.default.createElement("div",{...B&&{role:L},className:c(v)?v({type:f}):a.default("Toastify__toast-body",v),style:E},M&&s.default.createElement("div",{className:a.default("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),s.default.createElement("div",null,l)),function(e){if(!e)return;const t={closeToast:m,type:f,theme:w};return c(e)?e(t):s.default.isValidElement(e)?s.default.cloneElement(e,t):void 0}(r),(u||S)&&s.default.createElement(O,{..._&&!S?{key:"pb-"+_}:{},rtl:R,theme:w,delay:u,isRunning:t,isIn:B,closeToast:m,hide:p,type:f,style:C,className:b,controlledProgress:S,progress:N})))},R=y({enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0}),x=y({enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0}),P=y({enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"}),B=y({enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"}),k=t.forwardRef((e,n)=>{const{getToastToRender:o,containerRef:i,isToastActive:r}=b(e),{className:l,style:d,rtl:f,containerId:p}=e;function m(e){const t=a.default("Toastify__toast-container","Toastify__toast-container--"+e,{"Toastify__toast-container--rtl":f});return c(l)?l({position:e,rtl:f,defaultClassName:t}):a.default(t,u(l))}return t.useEffect(()=>{n&&(n.current=i.current)},[]),s.default.createElement("div",{ref:i,className:"Toastify",id:p},o((e,t)=>{const n=t.length?{...d}:{...d,pointerEvents:"none"};return s.default.createElement("div",{className:m(e),style:n,key:"container-"+e},t.map((e,n)=>{let{content:o,props:a}=e;return s.default.createElement(N,{...a,isIn:r(a.toastId),style:{"--nth":n+1,"--len":t.length},key:"toast-"+a.key,closeButton:!0===a.closeButton?L:a.closeButton},o)}))}))});k.displayName="ToastContainer",k.defaultProps={position:p.TOP_RIGHT,transition:R,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:L,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let M,w=new Map,D=[];function A(){return Math.random().toString(36).substring(2,9)}function S(e){return e&&(l(e.toastId)||i(e.toastId))?e.toastId:A()}function F(e,t){return w.size>0?T.emit(0,e,t):D.push({content:e,options:t}),t.toastId}function z(e,t){return{...t,type:t&&t.type||e,toastId:S(t)}}function H(e){return(t,n)=>F(t,z(e,n))}function q(e,t){return F(e,z(m.DEFAULT,t))}q.loading=(e,t)=>F(e,z(m.DEFAULT,{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),q.promise=function(e,t,n){let o,{pending:s,error:a,success:i}=t;s&&(o=l(s)?q.loading(s,n):q.loading(s.render,{...n,...s}));const r={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null,delay:100},u=(e,t,s)=>{if(null==t)return void q.dismiss(o);const a={type:e,...r,...n,data:s},i=l(t)?{render:t}:t;return o?q.update(o,{...a,...i}):q(i.render,{...a,...i}),s},d=c(e)?e():e;return d.then(e=>u("success",i,e)).catch(e=>u("error",a,e)),d},q.success=H(m.SUCCESS),q.info=H(m.INFO),q.error=H(m.ERROR),q.warning=H(m.WARNING),q.warn=q.warning,q.dark=(e,t)=>F(e,z(m.DEFAULT,{theme:"dark",...t})),q.dismiss=e=>T.emit(1,e),q.clearWaitingQueue=function(e){return void 0===e&&(e={}),T.emit(5,e)},q.isActive=e=>{let t=!1;return w.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},q.update=function(e,t){void 0===t&&(t={}),setTimeout(()=>{const n=function(e,t){let{containerId:n}=t;const o=w.get(n||M);return o?o.getToast(e):null}(e,t);if(n){const{props:o,content:s}=n,a={...o,...t,toastId:t.toastId||e,updateId:A()};a.toastId!==e&&(a.staleId=e);const i=a.render||s;delete a.render,F(i,a)}},0)},q.done=e=>{q.update(e,{progress:1})},q.onChange=e=>(T.on(4,e),()=>{T.off(4,e)}),q.POSITION=p,q.TYPE=m,T.on(2,e=>{M=e.containerId||e,w.set(M,e),D.forEach(e=>{T.emit(0,e.content,e.options)}),D=[]}).on(3,e=>{w.delete(e.containerId||e),0===w.size&&T.off(0).off(1).off(5)}),e.Bounce=R,e.Flip=B,e.Icons=E,e.Slide=x,e.ToastContainer=k,e.Zoom=P,e.collapseToast=g,e.cssTransition=y,e.toast=q,e.useToast=I,e.useToastContainer=b}); | ||
//# sourceMappingURL=react-toastify.umd.js.map |
@@ -13,3 +13,3 @@ import React from 'react'; | ||
} | ||
export declare type ToastContent = React.ReactNode | ((props: ToastContentProps) => React.ReactNode); | ||
export declare type ToastContent<T = unknown> = React.ReactNode | ((props: ToastContentProps<T>) => React.ReactNode); | ||
export declare type Id = number | string; | ||
@@ -175,3 +175,3 @@ export declare type ToastTransition = React.FC<ToastTransitionProps> | React.ComponentClass<ToastTransitionProps>; | ||
} | ||
export interface UpdateOptions extends Nullable<ToastOptions> { | ||
export interface UpdateOptions<T = unknown> extends Nullable<ToastOptions<T>> { | ||
/** | ||
@@ -181,3 +181,3 @@ * Used to update a toast. | ||
*/ | ||
render?: ToastContent; | ||
render?: ToastContent<T>; | ||
} | ||
@@ -252,3 +252,3 @@ export interface ToastContainerProps extends CommonOptions { | ||
/** | ||
* @INTERAL | ||
* @INTERNAL | ||
*/ | ||
@@ -259,2 +259,3 @@ export interface Toast { | ||
} | ||
export declare type ToastItemStatus = 'added' | 'removed' | 'updated'; | ||
export interface ToastItem<Data = {}> { | ||
@@ -269,3 +270,4 @@ content: React.ReactNode; | ||
icon?: React.ReactNode | false; | ||
status: ToastItemStatus; | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { Toast, ToastItem } from '../types'; | ||
export declare function toToastItem(toast: Toast): ToastItem; | ||
import { Toast, ToastItem, ToastItemStatus } from '../types'; | ||
export declare function toToastItem(toast: Toast, status: ToastItemStatus): ToastItem; |
{ | ||
"version": "9.0.0-POC", | ||
"version": "9.0.0-rc-1", | ||
"license": "MIT", | ||
@@ -28,2 +28,3 @@ "typings": "dist/index.d.ts", | ||
"prettier": "prettier --write src", | ||
"prettier-scss": "prettier --write scss", | ||
"sass": "sass scss/main.scss dist/ReactToastify.css", | ||
@@ -35,4 +36,3 @@ "sass-minimal": "sass scss/minimal.scss dist/ReactToastify.minimal.css", | ||
"style-injector": "style2js --out-dir dist dist/ReactToastify.min.css", | ||
"prebuild": "npm run clean", | ||
"build": "npm run build:core && npm run build:addons && npm run style && husky install", | ||
"build": "npm run clean && npm run build:core && npm run pack-and-extract && npm run build:addons && npm run style && husky install", | ||
"build:core": "microbundle --jsx React.createElement", | ||
@@ -42,3 +42,4 @@ "build:debug": "microbundle --jsx React.createElement --compress false", | ||
"build:addons-debug": "node build-addons.mjs debug", | ||
"setup:dev": "npm run build && yarn pack -f react-toastify.tgz && npm run rm-pkg && npm run extract-pkg", | ||
"setup": "npm run clean && npm run build && npm run pack-and-extract", | ||
"pack-and-extract": "yarn pack -f react-toastify.tgz && npm run rm-pkg && npm run extract-pkg", | ||
"rm-pkg": "rimraf node_modules/react-toastify && mkdir -p node_modules/react-toastify", | ||
@@ -100,31 +101,31 @@ "extract-pkg": "tar xzvf react-toastify.tgz -C node_modules/react-toastify --strip-components 1 && rimraf react-toastify.tgz" | ||
"devDependencies": { | ||
"@testing-library/jest-dom": "^5.16.2", | ||
"@testing-library/react": "^12.1.3", | ||
"@types/jest": "^27.4.0", | ||
"@types/react": "^17.0.39", | ||
"@types/react-dom": "^17.0.9", | ||
"@typescript-eslint/eslint-plugin": "^5.12.0", | ||
"@typescript-eslint/parser": "^5.12.0", | ||
"@testing-library/jest-dom": "^5.16.3", | ||
"@testing-library/react": "^12.1.4", | ||
"@types/jest": "^27.4.1", | ||
"@types/react": "^17.0.43", | ||
"@types/react-dom": "^17.0.14", | ||
"@typescript-eslint/eslint-plugin": "^5.17.0", | ||
"@typescript-eslint/parser": "^5.17.0", | ||
"coveralls": "^3.0.9", | ||
"cssnano": "^4.1.10", | ||
"cssnano": "^5.1.7", | ||
"cssnano-cli": "^1.0.5", | ||
"eslint": "^8.9.0", | ||
"eslint": "^8.12.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-jsx-a11y": "^6.5.1", | ||
"eslint-plugin-react": "^7.28.0", | ||
"eslint-plugin-react-hooks": "^4.3.0", | ||
"eslint-plugin-react": "^7.29.4", | ||
"eslint-plugin-react-hooks": "^4.4.0", | ||
"husky": "^7.0.0", | ||
"jest": "^27.5.1", | ||
"microbundle": "^0.14.2", | ||
"postcss": "^8.2.13", | ||
"postcss-cli": "^7.1.0", | ||
"prettier": "2.5.1", | ||
"postcss": "^8.4.12", | ||
"postcss-cli": "^9.1.0", | ||
"prettier": "2.6.1", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"rimraf": "^3.0.2", | ||
"sass": "^1.49.7", | ||
"sass": "^1.49.11", | ||
"style2js": "^1.0.0", | ||
"ts-jest": "^27.1.3", | ||
"ts-jest": "^27.1.4", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.3.5" | ||
"typescript": "^4.6.3" | ||
}, | ||
@@ -131,0 +132,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
392923
58
1671
0