react-toast-master 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,104 +1,75 @@
1
- (function(z,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(z=typeof globalThis<"u"?globalThis:z||self,_(z.ReactToastMaster={},z.React))})(this,function(z,_){"use strict";var pe={exports:{}},re={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Se;function Xe(){if(Se)return re;Se=1;var t=_,s=Symbol.for("react.element"),d=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,E=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,k={key:!0,ref:!0,__self:!0,__source:!0};function j(v,i,w){var m,R={},N=null,L=null;w!==void 0&&(N=""+w),i.key!==void 0&&(N=""+i.key),i.ref!==void 0&&(L=i.ref);for(m in i)l.call(i,m)&&!k.hasOwnProperty(m)&&(R[m]=i[m]);if(v&&v.defaultProps)for(m in i=v.defaultProps,i)R[m]===void 0&&(R[m]=i[m]);return{$$typeof:s,type:v,key:N,ref:L,props:R,_owner:E.current}}return re.Fragment=d,re.jsx=j,re.jsxs=j,re}var ne={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Oe;function Ze(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var t=_,s=Symbol.for("react.element"),d=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),v=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),o=Symbol.iterator,g="@@iterator";function y(e){if(e===null||typeof e!="object")return null;var r=o&&e[o]||e[g];return typeof r=="function"?r:null}var O=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),c=1;c<r;c++)n[c-1]=arguments[c];I("error",e,n)}}function I(e,r,n){{var c=O.ReactDebugCurrentFrame,h=c.getStackAddendum();h!==""&&(r+="%s",n=n.concat([h]));var p=n.map(function(f){return String(f)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var U=!1,K=!1,ae=!1,oe=!1,Z=!1,G;G=Symbol.for("react.module.reference");function we(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===k||Z||e===E||e===w||e===m||oe||e===L||U||K||ae||typeof e=="object"&&e!==null&&(e.$$typeof===N||e.$$typeof===R||e.$$typeof===j||e.$$typeof===v||e.$$typeof===i||e.$$typeof===G||e.getModuleId!==void 0))}function xe(e,r,n){var c=e.displayName;if(c)return c;var h=r.displayName||r.name||"";return h!==""?n+"("+h+")":n}function se(e){return e.displayName||"Context"}function Y(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case d:return"Portal";case k:return"Profiler";case E:return"StrictMode";case w:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case v:var r=e;return se(r)+".Consumer";case j:var n=e;return se(n._context)+".Provider";case i:return xe(e,e.render,"ForwardRef");case R:var c=e.displayName||null;return c!==null?c:Y(e.type)||"Memo";case N:{var h=e,p=h._payload,f=h._init;try{return Y(f(p))}catch{return null}}}return null}var P=Object.assign,H=0,ce,le,ue,de,fe,_e,Q;function M(){}M.__reactDisabledLog=!0;function V(){{if(H===0){ce=console.log,le=console.info,ue=console.warn,de=console.error,fe=console.group,_e=console.groupCollapsed,Q=console.groupEnd;var e={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function B(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:ce}),info:P({},e,{value:le}),warn:P({},e,{value:ue}),error:P({},e,{value:de}),group:P({},e,{value:fe}),groupCollapsed:P({},e,{value:_e}),groupEnd:P({},e,{value:Q})})}H<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var D=O.ReactCurrentDispatcher,$;function q(e,r,n){{if($===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);$=c&&c[1]||""}return`
18
- `+$+e}}var ke=!1,he;{var vt=typeof WeakMap=="function"?WeakMap:Map;he=new vt}function Ae(e,r){if(!e||ke)return"";{var n=he.get(e);if(n!==void 0)return n}var c;ke=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=D.current,D.current=null,V();try{if(r){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(A){c=A}Reflect.construct(e,[],f)}else{try{f.call()}catch(A){c=A}e.call(f.prototype)}}else{try{throw Error()}catch(A){c=A}e()}}catch(A){if(A&&c&&typeof A.stack=="string"){for(var u=A.stack.split(`
19
- `),F=c.stack.split(`
20
- `),x=u.length-1,C=F.length-1;x>=1&&C>=0&&u[x]!==F[C];)C--;for(;x>=1&&C>=0;x--,C--)if(u[x]!==F[C]){if(x!==1||C!==1)do if(x--,C--,C<0||u[x]!==F[C]){var W=`
21
- `+u[x].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),typeof e=="function"&&he.set(e,W),W}while(x>=1&&C>=0);break}}}finally{ke=!1,D.current=p,B(),Error.prepareStackTrace=h}var te=e?e.displayName||e.name:"",J=te?q(te):"";return typeof e=="function"&&he.set(e,J),J}function yt(e,r,n){return Ae(e,!1)}function bt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function me(e,r,n){if(e==null)return"";if(typeof e=="function")return Ae(e,bt(e));if(typeof e=="string")return q(e);switch(e){case w:return q("Suspense");case m:return q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case i:return yt(e.render);case R:return me(e.type,r,n);case N:{var c=e,h=c._payload,p=c._init;try{return me(p(h),r,n)}catch{}}}return""}var ie=Object.prototype.hasOwnProperty,Me={},Ie=O.ReactDebugCurrentFrame;function ge(e){if(e){var r=e._owner,n=me(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(n)}else Ie.setExtraStackFrame(null)}function wt(e,r,n,c,h){{var p=Function.call.bind(ie);for(var f in e)if(p(e,f)){var u=void 0;try{if(typeof e[f]!="function"){var F=Error((c||"React class")+": "+n+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}u=e[f](r,f,c,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(x){u=x}u&&!(u instanceof Error)&&(ge(h),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",n,f,typeof u),ge(null)),u instanceof Error&&!(u.message in Me)&&(Me[u.message]=!0,ge(h),b("Failed %s type: %s",n,u.message),ge(null))}}}var xt=Array.isArray;function Ce(e){return xt(e)}function kt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function Ct(e){try{return We(e),!1}catch{return!0}}function We(e){return""+e}function Le(e){if(Ct(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",kt(e)),We(e)}var Be=O.ReactCurrentOwner,Et={key:!0,ref:!0,__self:!0,__source:!0},$e,Ye;function Tt(e){if(ie.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function jt(e){if(ie.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Rt(e,r){typeof e.ref=="string"&&Be.current}function St(e,r){{var n=function(){$e||($e=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function Ot(e,r){{var n=function(){Ye||(Ye=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var Pt=function(e,r,n,c,h,p,f){var u={$$typeof:s,type:e,key:r,ref:n,props:f,_owner:p};return u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function Dt(e,r,n,c,h){{var p,f={},u=null,F=null;n!==void 0&&(Le(n),u=""+n),jt(r)&&(Le(r.key),u=""+r.key),Tt(r)&&(F=r.ref,Rt(r,h));for(p in r)ie.call(r,p)&&!Et.hasOwnProperty(p)&&(f[p]=r[p]);if(e&&e.defaultProps){var x=e.defaultProps;for(p in x)f[p]===void 0&&(f[p]=x[p])}if(u||F){var C=typeof e=="function"?e.displayName||e.name||"Unknown":e;u&&St(f,C),F&&Ot(f,C)}return Pt(e,u,F,h,c,Be.current,f)}}var Ee=O.ReactCurrentOwner,Ve=O.ReactDebugCurrentFrame;function ee(e){if(e){var r=e._owner,n=me(e.type,e._source,r?r.type:null);Ve.setExtraStackFrame(n)}else Ve.setExtraStackFrame(null)}var Te;Te=!1;function je(e){return typeof e=="object"&&e!==null&&e.$$typeof===s}function ze(){{if(Ee.current){var e=Y(Ee.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function Ft(e){return""}var Ue={};function Nt(e){{var r=ze();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
24
-
25
- Check the top-level render call using <`+n+">.")}return r}}function Ge(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Nt(r);if(Ue[n])return;Ue[n]=!0;var c="";e&&e._owner&&e._owner!==Ee.current&&(c=" It was passed a child from "+Y(e._owner.type)+"."),ee(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,c),ee(null)}}function Ke(e,r){{if(typeof e!="object")return;if(Ce(e))for(var n=0;n<e.length;n++){var c=e[n];je(c)&&Ge(c,r)}else if(je(e))e._store&&(e._store.validated=!0);else if(e){var h=y(e);if(typeof h=="function"&&h!==e.entries)for(var p=h.call(e),f;!(f=p.next()).done;)je(f.value)&&Ge(f.value,r)}}}function At(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===i||r.$$typeof===R))n=r.propTypes;else return;if(n){var c=Y(r);wt(n,e.props,"prop",c,e)}else if(r.PropTypes!==void 0&&!Te){Te=!0;var h=Y(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",h||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Mt(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var c=r[n];if(c!=="children"&&c!=="key"){ee(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c),ee(null);break}}e.ref!==null&&(ee(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),ee(null))}}var He={};function Je(e,r,n,c,h,p){{var f=we(e);if(!f){var u="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(u+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=Ft();F?u+=F:u+=ze();var x;e===null?x="null":Ce(e)?x="array":e!==void 0&&e.$$typeof===s?(x="<"+(Y(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):x=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",x,u)}var C=Dt(e,r,n,h,p);if(C==null)return C;if(f){var W=r.children;if(W!==void 0)if(c)if(Ce(W)){for(var te=0;te<W.length;te++)Ke(W[te],e);Object.freeze&&Object.freeze(W)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ke(W,e)}if(ie.call(r,"key")){var J=Y(e),A=Object.keys(r).filter(function(Yt){return Yt!=="key"}),Re=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";if(!He[J+Re]){var $t=A.length>0?"{"+A.join(": ..., ")+": ...}":"{}";b(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,Re,J,$t,J),He[J+Re]=!0}}return e===l?Mt(C):At(C),C}}function It(e,r,n){return Je(e,r,n,!0)}function Wt(e,r,n){return Je(e,r,n,!1)}var Lt=Wt,Bt=It;ne.Fragment=l,ne.jsx=Lt,ne.jsxs=Bt}()),ne}process.env.NODE_ENV==="production"?pe.exports=Xe():pe.exports=Ze();var a=pe.exports;/**
1
+ (function(k,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],t):(k=typeof globalThis<"u"?globalThis:k||self,t(k.ReactToastMaster={},k.ReactJsxRuntime,k.React))})(this,function(k,t,i){"use strict";/**
31
2
  * @license lucide-react v1.17.0 - ISC
32
3
  *
33
4
  * This source code is licensed under the ISC license.
34
5
  * See the LICENSE file in the root directory of this source tree.
35
- */const Pe=(...t)=>t.filter((s,d,l)=>!!s&&s.trim()!==""&&l.indexOf(s)===d).join(" ").trim();/**
6
+ */const q=(...e)=>e.filter((o,s,a)=>!!o&&o.trim()!==""&&a.indexOf(o)===s).join(" ").trim();/**
36
7
  * @license lucide-react v1.17.0 - ISC
37
8
  *
38
9
  * This source code is licensed under the ISC license.
39
10
  * See the LICENSE file in the root directory of this source tree.
40
- */const Qe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
11
+ */const X=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
41
12
  * @license lucide-react v1.17.0 - ISC
42
13
  *
43
14
  * This source code is licensed under the ISC license.
44
15
  * See the LICENSE file in the root directory of this source tree.
45
- */const qe=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,d,l)=>l?l.toUpperCase():d.toLowerCase());/**
16
+ */const U=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,s,a)=>a?a.toUpperCase():s.toLowerCase());/**
46
17
  * @license lucide-react v1.17.0 - ISC
47
18
  *
48
19
  * This source code is licensed under the ISC license.
49
20
  * See the LICENSE file in the root directory of this source tree.
50
- */const De=t=>{const s=qe(t);return s.charAt(0).toUpperCase()+s.slice(1)};/**
21
+ */const G=e=>{const o=U(e);return o.charAt(0).toUpperCase()+o.slice(1)};/**
51
22
  * @license lucide-react v1.17.0 - ISC
52
23
  *
53
24
  * This source code is licensed under the ISC license.
54
25
  * See the LICENSE file in the root directory of this source tree.
55
- */var ve={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
26
+ */var W={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
56
27
  * @license lucide-react v1.17.0 - ISC
57
28
  *
58
29
  * This source code is licensed under the ISC license.
59
30
  * See the LICENSE file in the root directory of this source tree.
60
- */const et=t=>{for(const s in t)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1},tt=_.createContext({}),rt=()=>_.useContext(tt),nt=_.forwardRef(({color:t,size:s,strokeWidth:d,absoluteStrokeWidth:l,className:E="",children:k,iconNode:j,...v},i)=>{const{size:w=24,strokeWidth:m=2,absoluteStrokeWidth:R=!1,color:N="currentColor",className:L=""}=rt()??{},o=l??R?Number(d??m)*24/Number(s??w):d??m;return _.createElement("svg",{ref:i,...ve,width:s??w??ve.width,height:s??w??ve.height,stroke:t??N,strokeWidth:o,className:Pe("lucide",L,E),...!k&&!et(v)&&{"aria-hidden":"true"},...v},[...j.map(([g,y])=>_.createElement(g,y)),...Array.isArray(k)?k:[k]])});/**
31
+ */const Z=e=>{for(const o in e)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},J=i.createContext({}),Y=()=>i.useContext(J),Q=i.forwardRef(({color:e,size:o,strokeWidth:s,absoluteStrokeWidth:a,className:g="",children:h,iconNode:y,...u},r)=>{const{size:w=24,strokeWidth:f=2,absoluteStrokeWidth:F=!1,color:S="currentColor",className:B=""}=Y()??{},n=a??F?Number(s??f)*24/Number(o??w):s??f;return i.createElement("svg",{ref:r,...W,width:o??w??W.width,height:o??w??W.height,stroke:e??S,strokeWidth:n,className:q("lucide",B,g),...!h&&!Z(u)&&{"aria-hidden":"true"},...u},[...y.map(([c,l])=>i.createElement(c,l)),...Array.isArray(h)?h:[h]])});/**
61
32
  * @license lucide-react v1.17.0 - ISC
62
33
  *
63
34
  * This source code is licensed under the ISC license.
64
35
  * See the LICENSE file in the root directory of this source tree.
65
- */const X=(t,s)=>{const d=_.forwardRef(({className:l,...E},k)=>_.createElement(nt,{ref:k,iconNode:s,className:Pe(`lucide-${Qe(De(t))}`,`lucide-${t}`,l),...E}));return d.displayName=De(t),d};/**
36
+ */const D=(e,o)=>{const s=i.forwardRef(({className:a,...g},h)=>i.createElement(Q,{ref:h,iconNode:o,className:q(`lucide-${X(G(e))}`,`lucide-${e}`,a),...g}));return s.displayName=G(e),s};/**
66
37
  * @license lucide-react v1.17.0 - ISC
67
38
  *
68
39
  * This source code is licensed under the ISC license.
69
40
  * See the LICENSE file in the root directory of this source tree.
70
- */const at=X("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
41
+ */const R=D("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
71
42
  * @license lucide-react v1.17.0 - ISC
72
43
  *
73
44
  * This source code is licensed under the ISC license.
74
45
  * See the LICENSE file in the root directory of this source tree.
75
- */const ot=X("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
46
+ */const ee=D("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
76
47
  * @license lucide-react v1.17.0 - ISC
77
48
  *
78
49
  * This source code is licensed under the ISC license.
79
50
  * See the LICENSE file in the root directory of this source tree.
80
- */const st=X("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
51
+ */const te=D("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
81
52
  * @license lucide-react v1.17.0 - ISC
82
53
  *
83
54
  * This source code is licensed under the ISC license.
84
55
  * See the LICENSE file in the root directory of this source tree.
85
- */const it=X("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
56
+ */const ne=D("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
86
57
  * @license lucide-react v1.17.0 - ISC
87
58
  *
88
59
  * This source code is licensed under the ISC license.
89
60
  * See the LICENSE file in the root directory of this source tree.
90
- */const ct=X("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
61
+ */const oe=D("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
91
62
  * @license lucide-react v1.17.0 - ISC
92
63
  *
93
64
  * This source code is licensed under the ISC license.
94
65
  * See the LICENSE file in the root directory of this source tree.
95
- */const Fe=X("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),S={textClasses:{success:"text_success",error:"text_error",loading:"text_warning",warning:"text_warning",warningStay:"text_warning",info:"text_info",infoStay:"text_info",confirm:"text_white",basic:"text_white",successWhite:"text_white",errorWhite:"text_white",loadingWhite:"text_white",warningWhite:"text_white",warningStayWhite:"text_white",infoWhite:"text_white",infoStayWhite:"text_white",successDark:"text_dark",errorDark:"text_dark",loadingDark:"text_dark",warningDark:"text_dark",warningStayDark:"text_dark",infoDark:"text_dark",infoStayDark:"text_dark",confirmDark:"text_dark",basicDark:"text_dark"},backgroundClasses:{success:"bg_success",error:"bg_error",warning:"bg_warning",info:"bg_info",glass:"bg_glass",white:"bg_white",dark:"bg_dark",gray:"bg_gray",transparent:"bg_transparent"},positionClasses:{top:"top",topFull:"topFull",topLeft:"topLeft",topRight:"topRight",bottom:"bottom",bottomFull:"bottomFull",bottomLeft:"bottomLeft",bottomRight:"bottomRight",center:"middle"},animationClasses:{down:"ani_down",top:"ani_top",left:"ani_left",right:"ani_right",fade:"ani_fade",zoom:"ani_zoom",jelly:"ani_jelly"},alignmentClasses:{left:"text_start",right:"text_end",center:"text_center"},skewClasses:{three:"right3",six:"right6",twelve:"right12"},shadowClasses:{none:"",gray:"box_shadow",block:"box_shadow_block",error:"shadow_error",white:"shadow_white",dark:"shadow_dark",success:"shadow_success",info:"shadow_info",warning:"shadow_warning",around:"shadow_around"},radiusClasses:{none:"rounded_none",sm:"rounded_sm",md:"rounded_md",lg:"rounded_lg",xl:"rounded_xl",twoXl:"rounded_2xl",full:"rounded_full"}},T={autoHideTypes:["success","successWhite","successDark","error","errorWhite","errorDark","warning","warningWhite","warningDark","info","infoWhite","infoDark","basic","basicDark"],stayTypes:["infoStay","infoStayWhite","infoStayDark","warningStay","warningStayWhite","warningStayDark","customStay"],overlayTypes:["confirm","confirmDark"],loadingTypes:["loading","loadingWhite","loadingDark"],durations:{standard:4500,afterHover:1500,animationClose:300,loadingFooterDelay:5330,loadingCloseButtonDelay:5e3}},lt=({footer:t,toastAlignment:s,toastBG:d})=>a.jsx("div",{className:`_footer toast_width ${s} ${ut[d]}`,children:t}),ut={dark:"footer_dark",warning:"footer_dark",white:"footer_white",info:"footer_info",error:"footer_error",success:"footer_success",gray:"footer_success",glass:"footer_success",transparent:"footer_success"},Ne=({footer:t,toastAlignment:s,toastBG:d})=>a.jsx("div",{className:`innerFooter ${s} ${dt[d]}`,children:t}),dt={dark:"footer_dark",warning:"footer_dark",white:"footer_white",info:"footer_info",error:"footer_error",success:"footer_success",gray:"footer_success",glass:"footer_success",transparent:"footer_success"},ft=({toastAlignment:t,toastBG:s,loadFooter:d})=>a.jsx("div",{className:`_footer toast_width reveal_ani ${t} ${_t[s]}`,children:d}),_t={dark:"footer_dark",warning:"footer_dark",white:"footer_white",info:"footer_info",error:"footer_error",success:"footer_success",gray:"footer_success",glass:"footer_success",transparent:"footer_success"},ht=({toast:t,onHide:s,onConfirm:d,onCancel:l,onMouseEnter:E,onMouseLeave:k,setToasts:j})=>{const v=Object.keys(S.positionClasses).find(o=>S.positionClasses[o]===t.position),i=Object.keys(S.backgroundClasses).find(o=>S.backgroundClasses[o]===t.background),w=v==="bottomFull"||v==="topFull",m=T.overlayTypes.includes(t.type),R=t.type==="basic"||t.type==="basicDark",N=t.type==="custom"||t.type==="customStay",L=o=>o.includes("success")?a.jsx(at,{}):o.includes("error")?a.jsx(st,{}):o.includes("loading")?a.jsx(ot,{className:"animate_spin"}):o.includes("warning")?a.jsx(it,{}):o.includes("info")?a.jsx(ct,{className:"rotate_deg"}):null;return a.jsxs(_.Fragment,{children:[t.showOverlay&&a.jsx("div",{className:`overlay ${t.showOverlay?"show":""}`}),a.jsx("div",{className:`
66
+ */const H=D("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_={textClasses:{success:"text_success",error:"text_error",loading:"text_warning",warning:"text_warning",warningStay:"text_warning",info:"text_info",infoStay:"text_info",confirm:"text_white",basic:"text_white",successWhite:"text_white",errorWhite:"text_white",loadingWhite:"text_white",warningWhite:"text_white",warningStayWhite:"text_white",infoWhite:"text_white",infoStayWhite:"text_white",successDark:"text_dark",errorDark:"text_dark",loadingDark:"text_dark",warningDark:"text_dark",warningStayDark:"text_dark",infoDark:"text_dark",infoStayDark:"text_dark",confirmDark:"text_dark",basicDark:"text_dark"},backgroundClasses:{success:"bg_success",error:"bg_error",warning:"bg_warning",info:"bg_info",glass:"bg_glass",white:"bg_white",dark:"bg_dark",gray:"bg_gray",transparent:"bg_transparent"},positionClasses:{top:"top",topFull:"topFull",topLeft:"topLeft",topRight:"topRight",bottom:"bottom",bottomFull:"bottomFull",bottomLeft:"bottomLeft",bottomRight:"bottomRight",center:"middle"},animationClasses:{down:"ani_down",top:"ani_top",left:"ani_left",right:"ani_right",fade:"ani_fade",zoom:"ani_zoom",jelly:"ani_jelly"},alignmentClasses:{left:"text_start",right:"text_end",center:"text_center"},skewClasses:{three:"right3",six:"right6",twelve:"right12"},shadowClasses:{none:"",gray:"box_shadow",block:"box_shadow_block",error:"shadow_error",white:"shadow_white",dark:"shadow_dark",success:"shadow_success",info:"shadow_info",warning:"shadow_warning",around:"shadow_around"},radiusClasses:{none:"rounded_none",sm:"rounded_sm",md:"rounded_md",lg:"rounded_lg",xl:"rounded_xl",twoXl:"rounded_2xl",full:"rounded_full"}},d={autoHideTypes:["success","successWhite","successDark","error","errorWhite","errorDark","warning","warningWhite","warningDark","info","infoWhite","infoDark","basic","basicDark"],stayTypes:["infoStay","infoStayWhite","infoStayDark","warningStay","warningStayWhite","warningStayDark","customStay"],overlayTypes:["confirm","confirmDark"],loadingTypes:["loading","loadingWhite","loadingDark"],durations:{standard:4500,afterHover:1500,animationClose:300,loadingFooterDelay:5330,loadingCloseButtonDelay:5e3}},se=({footer:e,toastAlignment:o,toastBG:s})=>t.jsx("div",{className:`_footer toast_width ${o} ${re[s]}`,children:e}),re={dark:"footer_dark",warning:"footer_dark",white:"footer_white",info:"footer_info",error:"footer_error",success:"footer_success",gray:"footer_success",glass:"footer_success",transparent:"footer_success"},K=({footer:e,toastAlignment:o,toastBG:s})=>t.jsx("div",{className:`innerFooter ${o} ${ae[s]}`,children:e}),ae={dark:"footer_dark",warning:"footer_dark",white:"footer_white",info:"footer_info",error:"footer_error",success:"footer_success",gray:"footer_success",glass:"footer_success",transparent:"footer_success"},ie=({toastAlignment:e,toastBG:o,loadFooter:s})=>t.jsx("div",{className:`_footer toast_width reveal_ani ${e} ${ce[o]}`,children:s}),ce={dark:"footer_dark",warning:"footer_dark",white:"footer_white",info:"footer_info",error:"footer_error",success:"footer_success",gray:"footer_success",glass:"footer_success",transparent:"footer_success"},le=({toast:e,onHide:o,onConfirm:s,onCancel:a,onMouseEnter:g,onMouseLeave:h,setToasts:y})=>{const u=Object.keys(_.positionClasses).find(n=>_.positionClasses[n]===e.position),r=Object.keys(_.backgroundClasses).find(n=>_.backgroundClasses[n]===e.background),w=u==="bottomFull"||u==="topFull",f=d.overlayTypes.includes(e.type),F=e.type==="basic"||e.type==="basicDark",S=e.type==="custom"||e.type==="customStay",B=n=>n.includes("success")?t.jsx(R,{}):n.includes("error")?t.jsx(te,{}):n.includes("loading")?t.jsx(ee,{className:"animate_spin"}):n.includes("warning")?t.jsx(ne,{}):n.includes("info")?t.jsx(oe,{className:"rotate_deg"}):null;return t.jsxs(i.Fragment,{children:[e.showOverlay&&t.jsx("div",{className:`overlay ${e.showOverlay?"show":""}`}),t.jsx("div",{className:`
96
67
  outer_container
97
- ${t.position}
98
- ${t.animation}
99
- ${t.isExiting?"exiting":""}
100
- `,style:{zIndex:9999},onAnimationEnd:()=>{t.isExiting&&j(o=>o.filter(g=>g.id!==t.id))},children:N?a.jsx("div",{className:`inner_container ${w?"toast_width_full":"max_width"} ${t.radius}`,onMouseEnter:()=>E(t.id,t.type),onMouseLeave:()=>k(t.id,t.type),children:t.custom}):m?a.jsx("div",{className:`inner_container ${w?"toast_width_full":"max_width"} ${S.textClasses[t.type]} ${t.background} ${t.skew} ${t.shadow} ${t.radius}`,onMouseEnter:()=>E(t.id,t.type),onMouseLeave:()=>k(t.id,t.type),children:a.jsxs("div",{className:m?"toast_width_confirm":"toast_width",children:[a.jsxs("div",{className:`confirm_message ${t.alignment}`,children:[!R&&a.jsxs("div",{children:[a.jsx("span",{className:"sr_only",children:"toast icon"}),a.jsx("span",{"aria-hidden":"true",children:L(t.type)})]}),a.jsx(a.Fragment,{children:t.message}),a.jsx("div",{className:`closeDiv ${t.showCloseButton&&t.showButton&&!m?"div_flex":"div_hidden"}`,children:a.jsxs("button",{onClick:()=>s(t.id),id:`close-${t.id}`,className:`closeButton ${i==="white"?"bg_whiter":i==="glass"||i==="transparent"?"bg_glass_close":"bg_darker"}`,children:[a.jsx("span",{className:"sr_only",children:"close toast"}),a.jsx(Fe,{"aria-hidden":"true",size:18})]})})]}),t.footer&&a.jsx(Ne,{footer:t.footer,toastBG:i,toastAlignment:t.alignment}),a.jsxs("div",{className:`confirm_div ${t.alignment==="text_start"?"justify_end":t.alignment==="text_end"?"justify_start":t.alignment==="text_center"?"justify_center":null}`,children:[a.jsxs("button",{className:`cancel_button ${i==="white"?"cancel_button_dark":i==="success"||i==="warning"||i==="error"||i==="info"||i==="dark"?"cancel_button_all":"cancel_button_glass"}`,onClick:()=>l(t.id),children:[a.jsx("span",{className:"sr_only",children:"close toast"}),"Cancel"]}),a.jsxs("button",{className:`confirm_button ${i==="dark"?"confirm_button_dark":"confirm_button_white"}`,onClick:()=>d(t.id),children:[a.jsx("span",{className:"sr_only",children:"confirm action"}),"Confirm"]})]})]})}):a.jsxs("div",{className:`inner_container ${w?"toast_width_full":"max_width"} ${S.textClasses[t.type]} ${t.background} ${t.skew} ${t.shadow} ${t.radius}`,onMouseEnter:()=>E(t.id,t.type),onMouseLeave:()=>k(t.id,t.type),children:[a.jsxs("div",{className:m?"toast_width_confirm":"toast_width",children:[a.jsxs("div",{className:`toast_message ${t.alignment}`,children:[!m&&!R&&a.jsxs("div",{children:[a.jsx("span",{className:"sr_only",children:"toast icon"}),a.jsx("span",{"aria-hidden":"true",children:L(t.type)})]}),a.jsx(a.Fragment,{children:t.message}),a.jsx("div",{className:`closeDiv ${t.showCloseButton&&t.showButton&&!m?"div_flex":"div_hidden"}`,children:a.jsxs("button",{onClick:()=>s(t.id),id:`close-${t.id}`,className:`closeButton
101
- ${i==="white"?"bg_whiter":i==="glass"||i==="transparent"?"bg_glass_close":"bg_darker"}`,children:[a.jsx("span",{className:"sr_only",children:"close toast"}),a.jsx(Fe,{"aria-hidden":"true",size:18})]})})]}),m&&t.footer&&a.jsx(Ne,{footer:t.footer,toastBG:i,toastAlignment:t.alignment}),m&&a.jsxs("div",{className:`confirm_div
102
- ${t.alignment==="text_start"?"justify_end":t.alignment==="text_end"?"justify_start":t.alignment==="text_center"?"justify_center":null}
103
- `,children:[a.jsxs("button",{className:`cancel_button ${i==="white"?"cancel_button_dark":i==="success"||i==="warning"||i==="error"||i==="info"||i==="dark"?"cancel_button_all":"cancel_button_glass"}`,onClick:()=>l(t.id),children:[a.jsx("span",{className:"sr_only",children:"close toast"}),"Cancel"]}),a.jsxs("button",{className:`confirm_button
104
- ${i==="dark"?"confirm_button_dark":"confirm_button_white"}`,onClick:()=>d(t.id),children:[a.jsx("span",{className:"sr_only",children:"confirm action"}),"Confirm"]})]})]}),a.jsxs(a.Fragment,{children:[!m&&!w&&t.footer&&a.jsx("div",{children:a.jsx(lt,{footer:t.footer,toastBG:i,toastAlignment:t.alignment})}),!m&&!w&&t.showLoadFooter&&t.loadFooter&&a.jsx(ft,{toastAlignment:t.alignment,toastBG:i,loadFooter:t.loadFooter})]})]})})]},t.id)},ye=(t,s)=>{let l={ani_top:"ani_slide_out_up",ani_down:"ani_slide_out_down",ani_left:"ani_slide_out_left",ani_right:"ani_slide_out_right",ani_jelly:"ani_jelly_out",ani_zoom:"ani_zoom_out",ani_fade:"ani_fade_out"}[t]||"ani_fade_out";return s&&["bottomFull","topFull"].includes(s)&&(l="ani_fade_out_full"),l},mt=()=>{const[t,s]=_.useState([]),d=_.useRef(new Map),l=_.useRef(new Map),E=_.useRef(t);_.useEffect(()=>{E.current=t},[t]);const k=_.useCallback(()=>`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[]),j=_.useCallback(o=>{l.current.has(o)&&(clearTimeout(l.current.get(o)),l.current.delete(o))},[]),v=_.useCallback(o=>{var O,b;const g=o??((b=(O=E.current)==null?void 0:O[E.current.length-1])==null?void 0:b.id);if(!g)return;s(I=>{const U=I.findIndex(G=>G.id===g);if(U===-1)return I;const K=I[U],ae=Object.keys(S.positionClasses).find(G=>S.positionClasses[G]===K.position),oe=ye(K.animation,ae),Z=[...I];return Z[U]={...K,animation:oe,isExiting:!0},Z});const y=setTimeout(()=>{s(I=>I.filter(U=>U.id!==g)),d.current.delete(g)},T.durations.animationClose);l.current.set(g,y)},[]),i=_.useCallback(o=>{s(g=>{const y=g.findIndex(I=>I.id===o);if(y===-1)return g;const O=[...g],b=O[y];return O[y]={...b,animation:ye(b.animation,b.position)},O}),j(o),l.current.set(o,setTimeout(()=>{d.current.has(o)&&(d.current.get(o)(!0),d.current.delete(o)),s(g=>g.filter(y=>y.id!==o))},T.durations.animationClose))},[j]),w=_.useCallback(o=>{d.current.has(o)&&(d.current.get(o)(!1),d.current.delete(o)),v(o)},[v]),m=_.useCallback((o,g)=>{T.autoHideTypes.includes(g)&&j(o)},[j]),R=_.useCallback((o,g)=>{T.autoHideTypes.includes(g)&&l.current.set(o,setTimeout(()=>v(o),T.durations.afterHover))},[v]),N=_.useCallback((o,g)=>{const{type:y="success",message:O="",bg:b="white",position:I="top",transition:U="zoom",loadFooter:K=null,footer:ae=null,skew:oe="",cancelButton:Z=!0,shadow:G="gray",radius:we="lg",align:xe="center",timeout:se=T.durations.standard,custom:Y=null}=o,P=k(),H=S.backgroundClasses[b]||"",ce=S.positionClasses[I]||"",le=S.animationClasses[U]||"",ue=S.skewClasses[oe]||"",de=S.shadowClasses[G]||"",fe=S.radiusClasses[we]||"",_e=S.alignmentClasses[xe]||"",Q={id:P,type:y,message:O,position:ce,background:H,animation:le,skew:ue,shadow:de,radius:fe,alignment:_e,footer:ae,loadFooter:K,showButton:Z,showCloseButton:!0,showLoadFooter:!1,showOverlay:T.overlayTypes.includes(y),timeout:se,custom:Y};return T.loadingTypes.includes(y)&&(Q.showCloseButton=!1,Q.showLoadFooter=!1),s(M=>{const V=M.filter(D=>!D.isExiting);let B=[...M];if(V.length>=3){const D=V[0];B=B.map($=>$.id===D.id?{...$,isExiting:!0,animation:ye($.animation,$.position)}:$),setTimeout(()=>{s($=>$.filter(q=>q.id!==D.id)),l.current.has(D.id)&&(clearTimeout(l.current.get(D.id)),l.current.delete(D.id))},T.durations.animationClose)}return[...B,Q]}),T.loadingTypes.includes(y)&&(setTimeout(()=>{s(M=>{const V=M.findIndex(D=>D.id===P);if(V===-1)return M;const B=[...M];return B[V].showCloseButton=!0,B})},T.durations.loadingCloseButtonDelay),setTimeout(()=>{s(M=>{const V=M.findIndex(D=>D.id===P);if(V===-1)return M;const B=[...M];return B[V].showLoadFooter=!0,B})},T.durations.loadingFooterDelay)),T.overlayTypes.includes(y)&&g&&d.current.set(P,g),!T.stayTypes.includes(y)&&!T.loadingTypes.includes(y)&&!T.overlayTypes.includes(y)&&l.current.set(P,setTimeout(()=>v(P),se)),P},[k,v]),L=_.useCallback(o=>new Promise(g=>N(o,g)),[N]);return _.useEffect(()=>{const o=g=>{if(g.key==="Escape"&&t.length>0){const y=t[t.length-1];y&&v(y.id)}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[v,t]),_.useEffect(()=>()=>{l.current.forEach(o=>clearTimeout(o)),l.current.clear()},[]),{toasts:t,setToasts:s,toastMaster:L,hideToast:v,handleConfirm:i,handleCancel:w,handleMouseEnter:m,handleMouseLeave:R}},be=_.createContext(null),gt=({children:t})=>{const{toasts:s,setToasts:d,toastMaster:l,hideToast:E,handleConfirm:k,handleCancel:j,handleMouseEnter:v,handleMouseLeave:i}=mt();return a.jsxs(be.Provider,{value:{toastMaster:l,hideToast:E},children:[t,s.map(w=>a.jsx(ht,{toast:w,setToasts:d,onHide:E,onConfirm:k,onCancel:j,onMouseEnter:v,onMouseLeave:i},w.id))]})},pt=()=>{const t=_.useContext(be);if(!t)throw new Error("useToast must be used within a ToastProvider");return t};z.ToastContext=be,z.ToastProvider=gt,z.useToast=pt,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
68
+ ${e.position}
69
+ ${e.animation}
70
+ ${e.isExiting?"exiting":""}
71
+ `,style:{zIndex:9999},onAnimationEnd:()=>{e.isExiting&&y(n=>n.filter(c=>c.id!==e.id))},children:S?t.jsx("div",{className:`inner_container ${w?"toast_width_full":"max_width"} ${e.radius}`,onMouseEnter:()=>g(e.id,e.type),onMouseLeave:()=>h(e.id,e.type),children:e.custom}):f?t.jsx("div",{className:`inner_container ${w?"toast_width_full":"max_width"} ${_.textClasses[e.type]} ${e.background} ${e.skew} ${e.shadow} ${e.radius}`,onMouseEnter:()=>g(e.id,e.type),onMouseLeave:()=>h(e.id,e.type),children:t.jsxs("div",{className:f?"toast_width_confirm":"toast_width",children:[t.jsxs("div",{className:`confirm_message ${e.alignment}`,children:[!F&&t.jsxs("div",{children:[t.jsx("span",{className:"sr_only",children:"toast icon"}),t.jsx("span",{"aria-hidden":"true",children:B(e.type)})]}),t.jsx(t.Fragment,{children:e.message}),t.jsx("div",{className:`closeDiv ${e.showCloseButton&&e.showButton&&!f?"div_flex":"div_hidden"}`,children:t.jsxs("button",{onClick:()=>o(e.id),id:`close-${e.id}`,className:`closeButton ${r==="white"?"bg_whiter":r==="glass"||r==="transparent"?"bg_glass_close":"bg_darker"}`,children:[t.jsx("span",{className:"sr_only",children:"close toast"}),t.jsx(H,{"aria-hidden":"true",size:18})]})})]}),e.footer&&t.jsx(K,{footer:e.footer,toastBG:r,toastAlignment:e.alignment}),t.jsxs("div",{className:`confirm_div ${e.alignment==="text_start"?"justify_end":e.alignment==="text_end"?"justify_start":e.alignment==="text_center"?"justify_center":null}`,children:[t.jsxs("button",{className:`cancel_button ${r==="white"?"cancel_button_dark":r==="success"||r==="warning"||r==="error"||r==="info"||r==="dark"?"cancel_button_all":"cancel_button_glass"}`,onClick:()=>a(e.id),children:[t.jsx("span",{className:"sr_only",children:"close toast"}),"Cancel"]}),t.jsxs("button",{className:`confirm_button ${r==="dark"?"confirm_button_dark":"confirm_button_white"}`,onClick:()=>s(e.id),children:[t.jsx("span",{className:"sr_only",children:"confirm action"}),"Confirm"]})]})]})}):t.jsxs("div",{className:`inner_container ${w?"toast_width_full":"max_width"} ${_.textClasses[e.type]} ${e.background} ${e.skew} ${e.shadow} ${e.radius}`,onMouseEnter:()=>g(e.id,e.type),onMouseLeave:()=>h(e.id,e.type),children:[t.jsxs("div",{className:f?"toast_width_confirm":"toast_width",children:[t.jsxs("div",{className:`toast_message ${e.alignment}`,children:[!f&&!F&&t.jsxs("div",{children:[t.jsx("span",{className:"sr_only",children:"toast icon"}),t.jsx("span",{"aria-hidden":"true",children:B(e.type)})]}),t.jsx(t.Fragment,{children:e.message}),t.jsx("div",{className:`closeDiv ${e.showCloseButton&&e.showButton&&!f?"div_flex":"div_hidden"}`,children:t.jsxs("button",{onClick:()=>o(e.id),id:`close-${e.id}`,className:`closeButton
72
+ ${r==="white"?"bg_whiter":r==="glass"||r==="transparent"?"bg_glass_close":"bg_darker"}`,children:[t.jsx("span",{className:"sr_only",children:"close toast"}),t.jsx(H,{"aria-hidden":"true",size:18})]})})]}),f&&e.footer&&t.jsx(K,{footer:e.footer,toastBG:r,toastAlignment:e.alignment}),f&&t.jsxs("div",{className:`confirm_div
73
+ ${e.alignment==="text_start"?"justify_end":e.alignment==="text_end"?"justify_start":e.alignment==="text_center"?"justify_center":null}
74
+ `,children:[t.jsxs("button",{className:`cancel_button ${r==="white"?"cancel_button_dark":r==="success"||r==="warning"||r==="error"||r==="info"||r==="dark"?"cancel_button_all":"cancel_button_glass"}`,onClick:()=>a(e.id),children:[t.jsx("span",{className:"sr_only",children:"close toast"}),"Cancel"]}),t.jsxs("button",{className:`confirm_button
75
+ ${r==="dark"?"confirm_button_dark":"confirm_button_white"}`,onClick:()=>s(e.id),children:[t.jsx("span",{className:"sr_only",children:"confirm action"}),"Confirm"]})]})]}),t.jsxs(t.Fragment,{children:[!f&&!w&&e.footer&&t.jsx("div",{children:t.jsx(se,{footer:e.footer,toastBG:r,toastAlignment:e.alignment})}),!f&&!w&&e.showLoadFooter&&e.loadFooter&&t.jsx(ie,{toastAlignment:e.alignment,toastBG:r,loadFooter:e.loadFooter})]})]})})]},e.id)},I=(e,o)=>{let a={ani_top:"ani_slide_out_up",ani_down:"ani_slide_out_down",ani_left:"ani_slide_out_left",ani_right:"ani_slide_out_right",ani_jelly:"ani_jelly_out",ani_zoom:"ani_zoom_out",ani_fade:"ani_fade_out"}[e]||"ani_fade_out";return o&&["bottomFull","topFull"].includes(o)&&(a="ani_fade_out_full"),a},de=()=>{const[e,o]=i.useState([]),s=i.useRef(new Map),a=i.useRef(new Map),g=i.useRef(e);i.useEffect(()=>{g.current=e},[e]);const h=i.useCallback(()=>`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[]),y=i.useCallback(n=>{a.current.has(n)&&(clearTimeout(a.current.get(n)),a.current.delete(n))},[]),u=i.useCallback(n=>{var x,v;const c=n??((v=(x=g.current)==null?void 0:x[g.current.length-1])==null?void 0:v.id);if(!c)return;o(p=>{const T=p.findIndex(E=>E.id===c);if(T===-1)return p;const L=p[T],z=Object.keys(_.positionClasses).find(E=>_.positionClasses[E]===L.position),O=I(L.animation,z),A=[...p];return A[T]={...L,animation:O,isExiting:!0},A});const l=setTimeout(()=>{o(p=>p.filter(T=>T.id!==c)),s.current.delete(c)},d.durations.animationClose);a.current.set(c,l)},[]),r=i.useCallback(n=>{o(c=>{const l=c.findIndex(p=>p.id===n);if(l===-1)return c;const x=[...c],v=x[l];return x[l]={...v,animation:I(v.animation,v.position)},x}),y(n),a.current.set(n,setTimeout(()=>{s.current.has(n)&&(s.current.get(n)(!0),s.current.delete(n)),o(c=>c.filter(l=>l.id!==n))},d.durations.animationClose))},[y]),w=i.useCallback(n=>{s.current.has(n)&&(s.current.get(n)(!1),s.current.delete(n)),u(n)},[u]),f=i.useCallback((n,c)=>{d.autoHideTypes.includes(c)&&y(n)},[y]),F=i.useCallback((n,c)=>{d.autoHideTypes.includes(c)&&a.current.set(n,setTimeout(()=>u(n),d.durations.afterHover))},[u]),S=i.useCallback((n,c)=>{const{type:l="success",message:x="",bg:v="white",position:p="top",transition:T="zoom",loadFooter:L=null,footer:z=null,skew:O="",cancelButton:A=!0,shadow:E="gray",radius:he="lg",align:fe="center",timeout:V=d.durations.standard,custom:ge=null}=n,N=h(),we=_.backgroundClasses[v]||"",me=_.positionClasses[p]||"",ke=_.animationClasses[T]||"",ye=_.skewClasses[O]||"",pe=_.shadowClasses[E]||"",be=_.radiusClasses[he]||"",Ce=_.alignmentClasses[fe]||"",P={id:N,type:l,message:x,position:me,background:we,animation:ke,skew:ye,shadow:pe,radius:be,alignment:Ce,footer:z,loadFooter:L,showButton:A,showCloseButton:!0,showLoadFooter:!1,showOverlay:d.overlayTypes.includes(l),timeout:V,custom:ge};return d.loadingTypes.includes(l)&&(P.showCloseButton=!1,P.showLoadFooter=!1),o(b=>{const $=b.filter(m=>!m.isExiting);let C=[...b];if($.length>=3){const m=$[0];C=C.map(M=>M.id===m.id?{...M,isExiting:!0,animation:I(M.animation,M.position)}:M),setTimeout(()=>{o(M=>M.filter(xe=>xe.id!==m.id)),a.current.has(m.id)&&(clearTimeout(a.current.get(m.id)),a.current.delete(m.id))},d.durations.animationClose)}return[...C,P]}),d.loadingTypes.includes(l)&&(setTimeout(()=>{o(b=>{const $=b.findIndex(m=>m.id===N);if($===-1)return b;const C=[...b];return C[$].showCloseButton=!0,C})},d.durations.loadingCloseButtonDelay),setTimeout(()=>{o(b=>{const $=b.findIndex(m=>m.id===N);if($===-1)return b;const C=[...b];return C[$].showLoadFooter=!0,C})},d.durations.loadingFooterDelay)),d.overlayTypes.includes(l)&&c&&s.current.set(N,c),!d.stayTypes.includes(l)&&!d.loadingTypes.includes(l)&&!d.overlayTypes.includes(l)&&a.current.set(N,setTimeout(()=>u(N),V)),N},[h,u]),B=i.useCallback(n=>new Promise(c=>S(n,c)),[S]);return i.useEffect(()=>{const n=c=>{if(c.key==="Escape"&&e.length>0){const l=e[e.length-1];l&&u(l.id)}};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[u,e]),i.useEffect(()=>()=>{a.current.forEach(n=>clearTimeout(n)),a.current.clear()},[]),{toasts:e,setToasts:o,toastMaster:B,hideToast:u,handleConfirm:r,handleCancel:w,handleMouseEnter:f,handleMouseLeave:F}},j=i.createContext(null),ue=({children:e})=>{const{toasts:o,setToasts:s,toastMaster:a,hideToast:g,handleConfirm:h,handleCancel:y,handleMouseEnter:u,handleMouseLeave:r}=de();return t.jsxs(j.Provider,{value:{toastMaster:a,hideToast:g},children:[e,o.map(w=>t.jsx(le,{toast:w,setToasts:s,onHide:g,onConfirm:h,onCancel:y,onMouseEnter:u,onMouseLeave:r},w.id))]})},_e=()=>{const e=i.useContext(j);if(!e)throw new Error("useToast must be used within a ToastProvider");return e};k.ToastContext=j,k.ToastProvider=ue,k.useToast=_e,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-toast-master",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "React's most customizable toast notification component.",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -44,7 +44,7 @@
44
44
  "lucide-react": "^1.17.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "react": "^18",
48
- "react-dom": "^18"
47
+ "react": "^18 || ^19",
48
+ "react-dom": "^18 || ^19"
49
49
  }
50
50
  }