customizable-toast-notification 3.12.3 → 3.12.4
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/CHANGELOG.md +8 -0
- package/README.md +26 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +54 -154
- package/dist/index.esm.mjs +3 -3
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +3 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -7
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Customizable Toast Notifications
|
|
3
|
-
* Build: 2026-
|
|
4
|
-
* Cache-Buster:
|
|
3
|
+
* Build: 2026-10-03 17:19:09
|
|
4
|
+
* Cache-Buster: 1791047949836
|
|
5
5
|
* Author: Priyanshu Patel
|
|
6
6
|
* Email: priyanshu.alt191@gmail.com
|
|
7
7
|
* License: Apache-2.0
|
|
@@ -12,7 +12,5 @@
|
|
|
12
12
|
* Supports flexible positioning, theming, icons, animations, and timing options
|
|
13
13
|
* out of the box — with CTA support and zero dependencies.
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).customizableToast={})}(this,function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t,n,r,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function s(e){n(i,o,a,s,l,"next",e)}function l(e){n(i,o,a,s,l,"throw",e)}s(void 0)})}}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(){
|
|
16
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
17
|
-
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return u(c,"_invoke",function(n,r,o){var a,s,l,u=0,c=o||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,l=e,f.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!d&&u&&!o&&t<c.length;t++){var o,a=c[t],p=f.p,h=a[2];n>3?(o=h===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<h&&(o=n<3||a[0]>r||r>h)&&(a[4]=n,a[5]=r,f.n=h,s=0))}if(o||n>1)return i;throw d=!0,r}return function(o,c,h){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&p(c,h),s=c,l=h;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){a=e,s=1,l=t}finally{u=1}}return{value:t,done:d}}}(n,o,a),!0),c}var i={};function s(){}function c(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),p=d.prototype=s.prototype=Object.create(f);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=d,u(p,"constructor",d),u(d,"constructor",c),c.displayName="GeneratorFunction",u(d,o,"GeneratorFunction"),u(p),u(p,o,"Generator"),u(p,r,function(){return this}),u(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:a,m:h}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,n,r){function a(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},u(e,t,n,r)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function f(e){var t=Date.now().toString(36),n=Math.floor(1048575*Math.random()).toString(36);return"".concat(e,"-").concat(t,"-").concat(n)}function p(e,t){return h.apply(this,arguments)}function h(){return(h=r(l().m(function e(t,n){var r;return l().w(function(e){for(;;)switch(e.n){case 0:if(t&&n){e.n=1;break}throw new Error("tagName and prefix are required");case 1:return(r=document.createElement(t)).id=f(n),e.a(2,r)}},e)}))).apply(this,arguments)}function m(e){return y.apply(this,arguments)}function y(){return(y=r(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t){e.n=1;break}return e.a(2,!0);case 1:if(e.p=1,null==t||null===(n=t.parentNode)||void 0===n||!n.id.includes("toast-container-")){e.n=2;break}return t.parentNode.removeChild(t),e.a(2,!0);case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:if(e.p=4,!t.remove){e.n=5;break}return t.remove(),e.a(2,!0);case 5:e.n=7;break;case 6:e.p=6,e.v;case 7:return e.p=7,Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),e.a(2,!0);case 8:return e.p=8,e.v,e.a(2,!1)}},e,null,[[7,8],[4,6],[1,3]])}))).apply(this,arguments)}function g(e){return v.apply(this,arguments)}function v(){return(v=r(l().m(function e(t){var n,r;return l().w(function(e){for(;;)switch(e.n){case 0:if(!("number"==typeof t&&t>0)){e.n=1;break}return e.a(2,t);case 1:if("string"!=typeof t){e.n=3;break}if(!t.endsWith("s")||t.endsWith("ms")){e.n=2;break}return n=1e3*parseFloat(t),e.a(2,n>0?n:500);case 2:return r=parseFloat(t),e.a(2,r>0?r:500);case 3:return e.a(2,500)}},e)}))).apply(this,arguments)}var b=new class{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;this.maxSize=e,this.map=new Map}get(e){if(this.map.has(e)){var t=this.map.get(e);return this.map.delete(e),this.map.set(e,t),t}}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this.maxSize){var n=this.map.keys().next().value;this.map.delete(n)}this.map.set(e,t)}}(200),w={};function k(e){if(!e)return"snow";var t,n,r,o=String(e),a=b.get(o);if(a)return a;if(w[null==e?void 0:e.toLowerCase()]){var i=w[e.toLowerCase()];return b.set(o,i),i}try{var s=function(e){var t=null==e?void 0:e.match(/^#([0-9a-f]{3,8})$/i);if(t){var n=t[1];return 3===n.length&&(n=n.split("").map(e=>e+e).join("")),{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}}var r=null==e?void 0:e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(r)return{r:Number(r[1]),g:Number(r[2]),b:Number(r[3])};var o=null==e?void 0:e.match(/hsla?\(\s*([\d.]+)(?:deg)?\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\)/i);if(o){var a=Number(o[1])/360,i=Number(o[2])/100,s=Number(o[3])/100;if(0===i){var l=Math.round(255*s);return{r:l,g:l,b:l}}var u=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),c=s<.5?s*(1+i):s+i-s*i,d=2*s-c;return{r:Math.round(255*u(d,c,a+1/3)),g:Math.round(255*u(d,c,a)),b:Math.round(255*u(d,c,a-1/3))}}return null}(function(e){var t,n=null==e?void 0:e.match(/^var\((--[\w-]+)(?:\s*,\s*(.+))?\)$/i);if(!n)return e;try{if("undefined"!=typeof document&&"function"==typeof getComputedStyle){var r=getComputedStyle(document.documentElement).getPropertyValue(n[1]).trim();if(r)return r}}catch(e){}return(null===(t=n[2])||void 0===t?void 0:t.trim())||e}(e));if(!s)throw new Error("Unknown color");t=s.r,n=s.g,r=s.b}catch(e){t=n=r=128}var l=(e,t,n)=>{var r=[e,t,n].map(e=>(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return.2126*r[0]+.7152*r[1]+.0722*r[2]},u=(e,t)=>{var n=l(...e),r=l(...t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},d=((e,t,n)=>{e/=255,t/=255,n/=255;var r,o,a=Math.max(e,t,n),i=Math.min(e,t,n),s=(a+i)/2;if(a===i)r=o=0;else{var l=a-i;switch(o=s>.5?l/(2-a-i):l/(a+i),a){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[360*r,o,s]})(t,n,r),f=c(d,3),p=f[0],h=f[1],m=f[2],y=((e,t,n)=>{var r,o,a;if(e/=360,0===t)r=o=a=n;else{var i=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=i(l,s,e+1/3),o=i(l,s,e),a=i(l,s,e-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*a)]})(p,h,m<.5?Math.min(m+.5,1):Math.max(m-.5,0)),g=c(y,3),v=g[0],k=g[1],x=g[2];if(u([t,n,r],[v,k,x])<4.5){var C=c(u([t,n,r],[0,0,0])>=u([t,n,r],[255,255,255])?[0,0,0]:[255,255,255],3);v=C[0],k=C[1],x=C[2]}var E=((e,t,n)=>"#".concat(e.toString(16).padStart(2,"0")).concat(t.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(v,k,x);return b.set(o,E),E}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(e=>{var t=c(e,2),n=t[0],r=c(t[1],3),o=r[0],a=r[1],i=r[2],s=e=>{var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},l=.2126*s(o)+.7152*s(a)+.0722*s(i),u=(l+.05)/.05,d=1.05/(l+.05);w[n.toLowerCase()]=u>=d?"#000000":"#ffffff"});var x=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),C=new Set(["href","src","alt","title","class","target","rel"]);function E(e){if(!e||"string"!=typeof e)return"";var t=e.replace(/<\/?(script|iframe|object|embed|link|meta|style|form|input|button|svg|math|img|video|audio|details|dialog|applet|embed|frame|frameset|textarea|select|option|optgroup|fieldset|legend|datalist|output|progress|meter|keygen|canvas|map|area|base|basefont|bgsound|blink|center|dir|font|frame|frameset|hgroup|isindex|listing|marquee|multicol|nextid|noembed|noframes|plaintext|rb|rtc|spacer|strike|tt|xmp)[^>]*>/gi,"");t=(t=t.replace(/\s(on\w+)\s*=\s*(['"])[\s\S]*?\2/gi,"")).replace(/(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi,"$1=$2#$2");var n=document.createElement("div");function r(e){if(e.nodeType===Node.TEXT_NODE)return document.createTextNode(e.nodeValue);if(e.nodeType!==Node.ELEMENT_NODE)return null;var t=e.tagName.toUpperCase();if(!x.has(t)){var n=document.createDocumentFragment();return Array.from(e.childNodes).forEach(e=>{var t=r(e);t&&n.appendChild(t)}),n}var o=document.createElement(e.tagName);return Array.from(e.attributes||[]).forEach(t=>{var n=t.name.toLowerCase(),r=t.value;C.has(n)&&("href"!==n&&"src"!==n||!/^\s*javascript:/i.test(r))&&("src"!==n||/^\s*(https?:|data:image\/)/i.test(r))&&("target"===n&&"_blank"===r&&o.setAttribute("rel",(e.getAttribute("rel")||"")+" noopener noreferrer"),o.setAttribute(n,r))}),Array.from(e.childNodes).forEach(e=>{var t=r(e);t&&o.appendChild(t)}),o}n.innerHTML=t;var o=document.createDocumentFragment();Array.from(n.childNodes).forEach(e=>{var t=r(e);t&&o.appendChild(t)});var a=document.createElement("div");return a.appendChild(o),a.innerHTML}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";try{if(!t.forceFallback&&function(){try{if("undefined"!=typeof window&&window.DOMPurify)return!0}catch(e){}return!1}()){var n=window.DOMPurify.sanitize(e,{ALLOWED_TAGS:Array.from(x),ALLOWED_ATTR:Array.from(C),ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i}),r=document.createElement("div");return r.innerHTML=n,r.querySelectorAll('a[target="_blank"]').forEach(e=>{var t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}),r.innerHTML}}catch(e){}return E(e)}function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.size||14,n=e.color||"currentColor",r=e.text||"",o=document.createElement("span");o.className="toast-loader",o.style.display="inline-flex",o.style.alignItems="center",o.style.gap="8px";var a="http://www.w3.org/2000/svg",i=document.createElementNS(a,"svg");i.setAttribute("width",String(t)),i.setAttribute("height",String(t)),i.setAttribute("viewBox","0 0 50 50"),i.setAttribute("aria-hidden","true");var s=document.createElementNS(a,"circle");if(s.setAttribute("cx","25"),s.setAttribute("cy","25"),s.setAttribute("r","20"),s.setAttribute("fill","none"),s.setAttribute("stroke",n),s.setAttribute("stroke-width","4"),s.setAttribute("stroke-linecap","round"),s.style.opacity="0.85",s.style.strokeDasharray="90",s.style.strokeDashoffset="60",s.style.transformOrigin="center",s.style.animation="toast-spinner 1s linear infinite",i.appendChild(s),o.appendChild(i),r){var l=document.createElement("span");l.style.fontSize="13px",l.textContent=r,o.appendChild(l)}if(!T._stylesInjected&&(T._stylesInjected=!0,!document.getElementById("toast-spinner-styles"))){var u=document.createElement("style");u.id="toast-spinner-styles",u.innerHTML="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }",document.head.appendChild(u)}return o}function A(e,t,n){var o=null==t?void 0:t.cta;if(o){var a=s({},o);a.label||(a.label="CTA Label Missing!");var i=!!a.href&&"link"===a.variant,u=document.createElement(i?"a":"button");i?(u.href=a.href,a.target&&(u.target=a.target),u.rel=a.rel||("_blank"===a.target?"noopener noreferrer":"")):u.type="button",u.setAttribute("aria-label",a.ariaLabel||a.label),Object.assign(u.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:"1px solid rgba(255,255,255,0.35)",color:t.textColor||"#fff",background:"rgba(255,255,255,0.15)",cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),u.textContent=a.label;var c=function(){var t=r(l().m(function t(r){var o;return l().w(function(t){for(;;)switch(t.p=t.n){case 0:if(t.p=0,"function"!=typeof a.onClick){t.n=1;break}if(null==(o=a.onClick(r))||!o.then){t.n=1;break}return t.n=1,o;case 1:return t.p=1,!1!==a.autoClose&&n(e),t.f(1);case 2:return t.a(2)}},t,null,[[0,,1,2]])}));return function(e){return t.apply(this,arguments)}}();u.addEventListener("click",c),u._cleanup=()=>u.removeEventListener("click",c),e.appendChild(u)}}function O(e,t,n){var r=document.createElement("button");r.setAttribute("aria-label","Close notification"),r.setAttribute("title","Close"),r.textContent="×",Object.assign(r.style,{background:"none",border:"none",color:t.textColor||"white",fontSize:"18px",marginLeft:"10px",cursor:"pointer"});var o=()=>n(e);r.addEventListener("click",o),e._cleanupCloseButton=()=>{r.removeEventListener("click",o)},e.appendChild(r)}function j(e,t){var n,r=document.createElement("div"),o=t.borderRadius||0,a=parseInt(o,10),i=a?"12px":"0",s=a?12:0,l=Math.max(a-10,s),u=a?"calc(100% - ".concat(l,"px)"):"100%",c=parseInt(t.progressHeight,10)||4,d=Number(null!==(n=t.duration)&&void 0!==n?n:1800)+5;Object.assign(r.style,{position:"absolute",left:"".concat(i),height:"".concat(c,"px"),background:t.progressColor||"rgba(255, 255, 255, 0.3)",width:"".concat(u),transition:"width ".concat(d,"ms linear"),["top"===t.progressPosition?"top":"bottom"]:"0",borderRadius:"".concat(c/2,"px")}),e.appendChild(r),"function"==typeof r.animate?e._progressAnimation=r.animate([{width:u},{width:"0%"}],{duration:d,easing:"linear",fill:"forwards",delay:50}):(r.style.transition="width ".concat(d,"ms linear"),setTimeout(()=>{r.offsetWidth,r.style.width="0%"},50))}function L(e){setTimeout(()=>{requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="translateY(0)"})},50)}function M(e,t,n){return I.apply(this,arguments)}function I(){return(I=r(l().m(function e(t,n,r){var o,a,i,s,u,c,d,f,p,h,m;return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,g(null==n?void 0:n.animationDuration);case 1:if(i=e.v,s="".concat(i,"ms"),t.className="toast toast-".concat(null!==(o=null==n?void 0:n.type)&&void 0!==o?o:"info"),Object.assign(t.style,{background:null==n?void 0:n.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:null==n?void 0:n.borderRadius,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:null==n?void 0:n.maxWidth,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",transition:"opacity ".concat(s," ").concat(null==n?void 0:n.animationEasing,", transform ").concat(s," ").concat(null==n?void 0:n.animationEasing),transform:"translateY(20px)",zIndex:"9999"}),t.setAttribute("role","alert"),t.setAttribute("aria-live","polite"),t.tabIndex=0,t._animationDuration=i,u=document.createElement("span"),null!=n&&n.wrapText?Object.assign(u.style,{display:"block",whiteSpace:"normal"}):Object.assign(u.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(u.style,{flex:"1",padding:null==n?void 0:n.fontPadding,fontFamily:null==n?void 0:n.fontFamily,fontSize:null==n?void 0:n.fontSize,fontWeight:null==n?void 0:n.fontWeight,lineHeight:null==n?void 0:n.fontLineHeight,color:null==n?void 0:n.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis"}),c=!!n.allowHtml,d=null!==(a=n.message)&&void 0!==a?a:"",(n.loader||n.showLoader)&&(f=T(n.loader||{}),u.appendChild(f),(p=document.createElement("span")).style.display="inline-block",p.style.width="8px",u.appendChild(p)),c&&"string"==typeof d&&d.trim().length>0)try{for(h=S(d),(m=document.createElement("div")).innerHTML=h;m.firstChild;)u.appendChild(m.firstChild)}catch(e){console.warn("HTML message sanitization failed, falling back to text:",e),u.textContent=d}else u.textContent=String(d);u.setAttribute("aria-label","Toast Notification Center"),u.setAttribute("title","string"==typeof d?d.replace(/<[^>]+>/g,""):String(d)),t.appendChild(u),null!=n&&n.cta&&0!==Object.keys(n.cta).length&&A(t,n,r),null!=n&&n.showCloseButton&&O(t,n,r),null!=n&&n.showProgressBar&&j(t,n),L(t);case 2:return e.a(2)}},e)}))).apply(this,arguments)}function P(e,t){return D.apply(this,arguments)}function D(){return(D=r(l().m(function e(t,n){var r,o,a,i,s;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:for(e.p=0,r=document.createElement("div"),Object.assign(r.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:"20px",right:"20px",zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",cursor:"pointer"}),o=document.createElement("div"),(a=document.createElement("span")).style.display="inline-block",t.allowHtml?a.innerHTML=S(String(t.message||"Emergency Toast Showing!")):a.textContent=String(t.message||"Emergency Toast Creation Showing!"),o.appendChild(a),(i=document.createElement("span")).style.cssText="float: right; margin-left: 10px; font-weight: bold;",i.textContent="×",o.appendChild(i);r.firstChild;)r.removeChild(r.firstChild);return r.appendChild(o),i.onclick=()=>{r.remove(),n(r)},document.body.appendChild(r),setTimeout(()=>{r.remove(),n(r)},null==t?void 0:t.duration),e.a(2,r);case 1:return e.p=1,s=e.v,console.error("Emergency toast creation failed:",s),setTimeout(()=>{alert((null==t?void 0:t.message)||"Emergency Toast Creation Showing!"),n(null)},100),e.a(2,null)}},e,null,[[0,1]])}))).apply(this,arguments)}function N(e,t){return _.apply(this,arguments)}function _(){return(_=r(l().m(function e(t,n){var r,o;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(document.querySelector('[id^="toast-container-"]')){e.n=1;break}return e.a(2,null);case 1:return e.p=2,e.n=3,p("div","toast");case 3:return r=e.v,e.n=4,M(r,t,n);case 4:return e.a(2,r);case 5:return e.p=5,o=e.v,console.warn("toast creation failed with error showing fallback one: ",o),e.n=6,P(t,n);case 6:return r=e.v,e.a(2,r)}},e,null,[[2,5]])}))).apply(this,arguments)}var W=new Map,z=new Map;function B(e){return"toast-container-".concat(function(e){return String(e).toLowerCase().trim().replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-")}(e))}function H(e,t){return q.apply(this,arguments)}function q(){return q=r(l().m(function e(t,n){var o,a,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=B(t.position),!z.has(o)){e.n=1;break}return e.a(2,z.get(o));case 1:return a=r(l().m(function e(){var r,a,i,s;return l().w(function(e){for(;;)switch(e.n){case 0:if(null==(r=W.get(o))||!r.isConnected){e.n=1;break}return e.a(2,r);case 1:if(r&&!r.isConnected&&W.delete(o),(a=document.getElementById(o))&&!a.isConnected&&document.body.appendChild(a),a){e.n=3;break}if((a=document.createElement("div")).id=o,a.setAttribute("role","status"),a.setAttribute("aria-atomic","true"),a.style.position="fixed",a.style.zIndex="9999",a.style.inset="auto 10px 10px auto",a.style.display="flex",a.style.justifyContent="space-between",a.style.alignItems="center",a.style.flexDirection="column",a.style.overflow="hidden","function"!=typeof n){e.n=2;break}return e.n=2,n(a,t);case 2:document.body.appendChild(a),e.n=4;break;case 3:if(a.style.position=a.style.position||"fixed",a.style.zIndex=a.style.zIndex||"9999","function"!=typeof n){e.n=4;break}return e.n=4,n(a,t);case 4:if((i=document.querySelectorAll("#".concat(o))).length>1)for(s=1;s<i.length;s++)try{i[s].remove()}catch(e){}return W.set(o,a),e.a(2,a)}},e)}))(),z.set(o,a),e.p=2,e.n=3,a;case 3:return i=e.v,e.a(2,i);case 4:return e.p=4,z.delete(o),e.f(4);case 5:return e.a(2)}},e,null,[[2,,4,5]])})),q.apply(this,arguments)}function R(e,t){return F.apply(this,arguments)}function F(){return(F=r(l().m(function e(t,n){var r;return l().w(function(e){for(;;)switch(e.n){case 0:if(t&&n.position){e.n=1;break}throw new Error("Invalid container or position!");case 1:if(G(t),r=U(n.position),!$(t,n,r)){e.n=2;break}return e.a(2);case 2:if(!X(t,r)){e.n=3;break}return e.a(2);case 3:Y(t,r);case 4:return e.a(2)}},e)}))).apply(this,arguments)}function G(e){e.style.top="auto",e.style.bottom="auto",e.style.left="auto",e.style.right="auto",e.style.transform="none"}function U(e){var t=e.toLowerCase().trim(),n="top-full-width"===t||"bottom-full-width"===t||"fullwidth"===t;return{hasTop:t.startsWith("top")||"center"!==t&&t.includes("top"),hasBottom:t.startsWith("bottom")||t.includes("below"),hasLeft:t.startsWith("left"),hasRight:t.startsWith("right"),hasCenter:"center"===t||t.includes("center")&&!t.includes("left")&&!t.includes("right")&&!t.includes("top")&&!t.includes("bottom"),hasFullWidth:n}}function $(e,t,n){return!!n.hasFullWidth&&(n.hasTop?(t.maxWidth="100vw",e.style.top="10px",e.style.left="10px",e.style.right="10px",!0):!!n.hasBottom&&(t.maxWidth="100vw",e.style.bottom="10px",e.style.left="10px",e.style.right="10px",!0))}function X(e,t){return!!t.hasCenter&&(!t.hasTop||t.hasLeft||t.hasRight?!t.hasBottom||t.hasLeft||t.hasRight?!t.hasLeft||t.hasTop||t.hasBottom?!t.hasRight||t.hasTop||t.hasBottom?!(t.hasLeft||t.hasRight||t.hasTop||t.hasBottom)&&(e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",!0):(e.style.right="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.left="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.bottom="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0):(e.style.top="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0))}function Y(e,t){t.hasBottom?e.style.bottom="10px":t.hasTop?e.style.top="10px":e.style.bottom="10px",t.hasRight?e.style.right="10px":t.hasLeft?e.style.left="10px":(e.style.left="50%",e.style.transform="translateX(-50%)")}class V{constructor(e,t){this.callback=e,this.delay=t,this.remaining=t,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){return this.isCompleted||this.timeoutId||(this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null,this.callback()},this.remaining)),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),this.isPaused=!0),this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}var K=new Map,J=new Map,Q=[],Z=0;function ee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=String(e.type).trim().toLowerCase(),n=function(e){for(var t=5381,n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return t>>>0}(String(e.message||"")).toString(16),r=String(e.position).trim().toLowerCase();return"".concat(t,"|").concat(n,"|").concat(r)}function te(){return ne.apply(this,arguments)}function ne(){return ne=r(l().m(function e(){var t,n,o,a,i,s,u=arguments;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},e.p=1,n=ee(t),!K.has(n)){e.n=5;break}if(o=K.get(n)){e.n=2;break}throw new Error("Active toast with key ".concat(n," not found"));case 2:return o.count++,o.timer.clear(),o.timer=ue(o.toast,t),e.n=3,ce(o);case 3:return e.n=4,we(o);case 4:return e.a(2,n);case 5:if(!J.has(n)){e.n=7;break}if(a=J.get(n)){e.n=6;break}throw new Error("Pending toast with key ".concat(n," not found"));case 6:return a.count++,e.a(2,n);case 7:return i={options:t,count:1,rafId:0},J.set(n,i),i.rafId=requestAnimationFrame(r(l().m(function e(){var t,r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=J.get(n)){e.n=1;break}return e.a(2);case 1:if(J.delete(n),!(Z>=3)){e.n=3;break}return Q.push({options:t.options,key:n,count:t.count}),e.n=2,ye();case 2:return e.a(2);case 3:return e.p=3,e.n=4,re(t.options,n,t.count);case 4:e.n=6;break;case 5:e.p=5,r=e.v,console.error("showToast failed:",r);case 6:return e.a(2)}},e,null,[[3,5]])}))),e.a(2,n);case 8:e.p=8,s=e.v,console.error("showToast failed:",s);case 9:return e.a(2)}},e,null,[[1,8]])})),ne.apply(this,arguments)}function re(e,t,n){return oe.apply(this,arguments)}function oe(){return(oe=r(l().m(function e(t,n,r){var o,a,i,s,u,c,d,f,p;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t&&"object"==typeof t){e.n=1;break}throw new TypeError("options must be an object");case 1:return Z++,e.n=2,H(t,R);case 2:if(o=e.v){e.n=3;break}throw new Error("Failed to create toast container");case 3:return e.n=4,N(t,fe);case 4:if(a=e.v){e.n=5;break}throw new Error("Toast element creation failed");case 5:if(i=document.createElement("div"),Object.assign(i.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%"}),s=document.createElement("div"),Object.assign(s.style,{position:"relative",overflow:"hidden",zIndex:"1"}),s.appendChild(a),i.appendChild(s),o.id.includes("toast-container-")&&o.appendChild(i),u=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),c={outer:i,toast:a,count:Math.max(1,Math.floor(null!=r?r:0)),timeout:null,pauseOnHover:u},K.set(n,c),a._key=n,!(c.count>1)){e.n=6;break}return e.n=6,we(c);case 6:return c.timer=ue(a,t),e.n=7,ce(c);case 7:e.n=10;break;case 8:return e.p=8,f=e.v,console.error("Something went wrong: ",f),Z=Math.max(0,Z-1),d=document.querySelector('[id^="toast-container-"]')||document.body,p=d,e.n=9,P(t,fe);case 9:p.appendChild.call(p,e.v);case 10:return e.a(2)}},e,null,[[0,8]])}))).apply(this,arguments)}function ae(){return(ae=r(l().m(function e(){var t,n,r,o,a,i,s;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,0!==K.size){e.n=1;break}return e.a(2);case 1:if(t=null,document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{var n=Array.from(e.children||[]);if(0!==n.length){var r=n.at(-1);r&&(t=r.querySelector('[id^="toast-"]')||r)}}),t||(n=Array.from(K.entries())).length>0&&(r=n.at(-1),o=c(r,2),a=o[1],t=a.toast||a.outer&&a.outer.querySelector('[id^="toast-"]')),t){e.n=2;break}return e.a(2);case 2:return i=t._key?t:t.querySelector('[id^="toast-"]')||t,e.n=3,fe(i);case 3:e.n=5;break;case 4:e.p=4,s=e.v,console.error("dismissMostRecent failed:",s);case 5:return e.a(2)}},e,null,[[0,4]])}))).apply(this,arguments)}function ie(){return(ie=r(l().m(function e(){var t,n,r,a,i,s,u;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:e.p=0,t=Array.from(K.values()).map(e=>e.toast).filter(Boolean),Q.length=0,J.clear(),n=o(t),e.p=1,n.s();case 2:if((r=n.n()).done){e.n=7;break}return a=r.value,e.p=3,e.n=4,fe(a);case 4:e.n=6;break;case 5:e.p=5,i=e.v,console.warn("closeAllToasts: failed to close one toast:",i);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,s=e.v,n.e(s);case 9:return e.p=9,n.f(),e.f(9);case 10:e.n=12;break;case 11:e.p=11,u=e.v,console.error("closeAllToasts failed:",u);case 12:return e.a(2)}},e,null,[[3,5],[1,8,9,10],[0,11]])}))).apply(this,arguments)}var se=function(){return ae.apply(this,arguments)},le=function(){return ie.apply(this,arguments)};function ue(e,t){var n,o=Number(null!==(n=t.duration)&&void 0!==n?n:1800)+5,a=new V(r(l().m(function t(){return l().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,fe(e);case 1:return t.a(2,t.v)}},t)})),o);return a.start(),a}function ce(e){return de.apply(this,arguments)}function de(){return(de=r(l().m(function e(t){var n,r,o,a,i,s,u;return l().w(function(e){for(;;)switch(e.n){case 0:if(t.pauseOnHover&&t.outer&&t.timer){e.n=1;break}return e.a(2);case 1:n=t.outer,r=t.timer,o=t.toast,a=()=>{var e;r.pause(),null==o||null===(e=o._progressAnimation)||void 0===e||e.pause()},i=()=>{var e;r.resume(),null==o||null===(e=o._progressAnimation)||void 0===e||e.play()},s=e=>{var t;e.target.matches("[tabindex], div, span, button, a")&&(r.pause(),null==o||null===(t=o._progressAnimation)||void 0===t||t.pause())},u=e=>{var t;n.contains(e.relatedTarget)||(r.resume(),null==o||null===(t=o._progressAnimation)||void 0===t||t.play())},n.addEventListener("mouseenter",a),n.addEventListener("mouseleave",i),n.addEventListener("focusin",s),n.addEventListener("focusout",u),n._pauseCleanup=()=>{n.removeEventListener("mouseenter",a),n.removeEventListener("mouseleave",i),n.removeEventListener("focusin",s),n.removeEventListener("focusout",u)};case 2:return e.a(2)}},e)}))).apply(this,arguments)}function fe(e){return pe.apply(this,arguments)}function pe(){return(pe=r(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(null!=t&&t._key){e.n=1;break}return e.a(2);case 1:return e.a(2,he(t._key))}},e)}))).apply(this,arguments)}function he(e){return me.apply(this,arguments)}function me(){return(me=r(l().m(function e(t){var n,r,o,a,i,s,u,c,d,f,p,h,m,y,g,v,b,w;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t){e.n=1;break}return e.a(2);case 1:if(!(h=J.get(t))){e.n=2;break}return cancelAnimationFrame(h.rafId),J.delete(t),e.a(2);case 2:if(-1===(m=Q.findIndex(e=>e.key===t))){e.n=3;break}return Q.splice(m,1),e.a(2);case 3:if(y=K.get(t)){e.n=4;break}return e.a(2);case 4:return null===(n=y.timer)||void 0===n||n.clear(),null===(r=y.outer)||void 0===r||null===(o=r._pauseCleanup)||void 0===o||o.call(r),null===(a=y.toast)||void 0===a||null===(i=a._cleanupCloseButton)||void 0===i||i.call(a),null===(s=y.toast)||void 0===s||null===(u=s._cleanup)||void 0===u||u.call(s),null==(g=null===(c=y.toast)||void 0===c?void 0:c.querySelector("button, a"))||null===(d=g._cleanup)||void 0===d||d.call(g),K.delete(t),Z=Math.max(0,Z-1),(v=y.outer.querySelector(".toast-count-badge"))&&v.remove(),b=null!==(f=null===(p=y.toast)||void 0===p?void 0:p._animationDuration)&&void 0!==f?f:400,e.n=5,ve(y.outer,b);case 5:return e.n=6,ye();case 6:e.n=8;break;case 7:e.p=7,w=e.v,console.error("Closing Toast failed!: ",w);case 8:return e.a(2)}},e,null,[[0,7]])}))).apply(this,arguments)}function ye(){return ge.apply(this,arguments)}function ge(){return(ge=r(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.n){case 0:if(!(Z<3&&Q.length)){e.n=3;break}if(t=Q.shift(),!K.has(t.key)){e.n=2;break}return(n=K.get(t.key)).count+=t.count,e.n=1,we(n);case 1:return e.a(3,0);case 2:re(t.options,t.key,t.count),e.n=0;break;case 3:return e.a(2)}},e)}))).apply(this,arguments)}function ve(e){return be.apply(this,arguments)}function be(){return be=r(l().m(function e(t){var n,r=arguments;return l().w(function(e){for(;;)switch(e.n){case 0:if(n=r.length>1&&void 0!==r[1]?r[1]:400,t){e.n=1;break}return e.a(2,Promise.resolve());case 1:return e.a(2,new Promise(e=>{var r=!1,o=()=>{r||(r=!0,m(t),e())},a=t.firstElementChild||t;if(!a)return e();var i=e=>{try{if(e.target!==a)return;a.removeEventListener("transitionend",i,!0),o()}catch(e){console.error("removeWithTransition error:",e)}};try{a.addEventListener("transitionend",i,!0)}catch(e){console.error("removeWithTransition error:",e)}setTimeout(()=>{try{a.removeEventListener("transitionend",i,!0),o()}catch(e){console.error("removeWithTransition error:",e)}},n+300)}))}},e)})),be.apply(this,arguments)}function we(e){return ke.apply(this,arguments)}function ke(){return(ke=r(l().m(function e(t){var n,r,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:if(n=t.outer,r=t.count,n&&n instanceof HTMLElement){e.n=1;break}throw new Error("updateBadge: outer must be a valid HTMLElement");case 1:if(!(r<2)){e.n=2;break}return(o=n.querySelector(".toast-count-badge"))&&o.remove(),e.a(2);case 2:(a=n.querySelector(".toast-count-badge"))||((a=document.createElement("span")).className="toast-count-badge",a.setAttribute("aria-label","".concat(r," identical notifications")),Object.assign(a.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),n.appendChild(a)),a.textContent=r>99?"99+":String(r);try{a.style.transform="scale(1.2)",setTimeout(()=>a.style.transform="scale(1)",150)}catch(e){console.error("updateBadge animation error:",e)}case 3:return e.a(2)}},e)}))).apply(this,arguments)}var xe={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},Ce={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"},Ee=[],Se=!1;function Te(){return Ae.apply(this,arguments)}function Ae(){return(Ae=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!Se){e.n=1;break}return e.a(2);case 1:"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?(Se=!0,Ee.forEach(e=>setTimeout(()=>Oe(e),200)),Ee.length=0):document.addEventListener("DOMContentLoaded",()=>{Se=!0,Ee.forEach(e=>setTimeout(()=>Oe(e),200)),Ee.length=0},{once:!0}));case 2:return e.a(2)}},e)}))).apply(this,arguments)}function Oe(){return je.apply(this,arguments)}function je(){return je=r(l().m(function e(){var t,n,r,o,a=arguments;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},e.p=1,e.n=2,Pe(t);case 2:return n=e.v,e.n=3,Me(n);case 3:return e.n=4,te(n);case 4:return e.a(2,e.v);case 5:return e.p=5,o=e.v,console.error("CreateToast failed:",o),r="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?"".concat(t.message.substring(0,200)," toast creation failed!"):"Toast creation failed!",alert(r),e.a(2,null)}},e,null,[[1,5]])})),je.apply(this,arguments)}function Le(){return Le=r(l().m(function e(){var t,n=arguments;return l().w(function(e){for(;;)switch(e.n){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:{},"undefined"!=typeof window&&"undefined"!=typeof document){e.n=1;break}return console.warn("ToastNotification: running in non-browser environment, no DOM available."),e.a(2,null);case 1:return e.n=2,Te();case 2:if(Se){e.n=3;break}return Ee.push(t),e.a(2,null);case 3:return e.n=4,Oe(t);case 4:return e.a(2,e.v)}},e)})),Le.apply(this,arguments)}function Me(e){return Ie.apply(this,arguments)}function Ie(){return(Ie=r(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,H(t,R);case 1:return e.a(2,e.v);case 2:return e.p=2,n=e.v,console.error("Failed to create toast container:",n),e.a(2,document.body)}},e,null,[[0,2]])}))).apply(this,arguments)}function Pe(e){return De.apply(this,arguments)}function De(){return(De=r(l().m(function e(t){var n,r,o,a,i,u,c,d;return l().w(function(e){for(;;)if(0===e.n){o=null==t||null===(n=t.position)||void 0===n||null===(n=n.toLowerCase())||void 0===n?void 0:n.trim(),a=null!=o&&o.includes("top-full-width")||null!=o&&o.includes("bottom-full-width")?"100vw":"400px",(i=s(s({},{allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:"bottom-right",type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",fontPosition:"relative",fontPadding:void 0,fontBorderRadius:void 0,fontBackgroundColor:void 0,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:a}),"object"!=typeof t||Array.isArray(t)?{}:t)).message=null!==(r=null==t?void 0:t.message)&&void 0!==r?r:i.message;try{i.backgroundColor||(i.backgroundColor=null!==(u=null===(c=xe)||void 0===c?void 0:c[i.type])&&void 0!==u?u:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111")}catch(e){console.warn("Background color resolution failed:",e)}try{i.message=i.message||(null===(d=Ce)||void 0===d?void 0:d[i.type])||"No Message Provided!"}catch(e){console.warn("Default message resolution failed:",e)}try{!i.textColor&&i.backgroundColor&&(i.textColor=k(i.backgroundColor))}catch(e){console.warn("Text color resolution failed:",e)}try{!i.progressColor&&i.backgroundColor&&(i.progressColor=i.textColor||k(i.backgroundColor))}catch(e){console.warn("Progress bar color resolution failed:",e)}return"string"!=typeof i.message&&(i.message="No Message Provided!"),e.a(2,i)}},e)}))).apply(this,arguments)}function Ne(e){try{if(e&&"object"==typeof e&&!Array.isArray(e)){for(var t=["success","error","warning","info"],n={},r=0,o=Object.entries(e);r<o.length;r++){var a=c(o[r],2),i=a[0],l=a[1];t.includes(i)&&"string"==typeof l&&l.trim()&&(n[i]=l.trim())}Object.keys(n).length>0&&(xe=s(s({},xe),n))}}catch(e){console.error("setDefaultColors failed:",e)}}function _e(e){try{if(e&&"object"==typeof e&&!Array.isArray(e)){for(var t=["success","error","warning","info"],n={},r=0,o=Object.entries(e);r<o.length;r++){var a=c(o[r],2),i=a[0],l=a[1];t.includes(i)&&"string"==typeof l&&l.trim()&&(n[i]=l.trim())}Object.keys(n).length>0&&(Ce=s(s({},Ce),n))}}catch(e){console.error("setDefaultMessages failed:",e)}}var We=!1,ze=null;function Be(e){return He.apply(this,arguments)}function He(){return(He=r(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!We||!ze){e.n=4;break}return e.p=1,e.n=2,ze;case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.warn("Previous close operation failed (continuing anyway):",n);case 4:return e.a(2,t())}},e,null,[[1,3]])}))).apply(this,arguments)}var qe=function(){return Le.apply(this,arguments)};function Re(){return Fe.apply(this,arguments)}function Fe(){return Fe=r(l().m(function e(){var t,n,r=arguments;return l().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.n=1,Be(()=>qe(t));case 1:return n=e.v,e.a(2,{dismiss:()=>n?he(n):Promise.resolve()})}},e)})),Fe.apply(this,arguments)}var Ge=function(){var e=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:return We=!0,ze=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,se();case 1:return e.p=1,We=!1,ze=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,ze;case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),Ue=function(){var e=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:return We=!0,ze=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,le();case 1:return e.p=1,We=!1,ze=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,ze;case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();function $e(e){return Xe.apply(this,arguments)}function Xe(){return Xe=r(l().m(function e(t){var n,r,o,a,i,u,c,d,f,p,h,m,y=arguments;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return o=y.length>2&&void 0!==y[2]?y[2]:{},a=null!==(n=(r=y.length>1&&void 0!==y[1]?y[1]:{}).loading)&&void 0!==n?n:"Loading...",e.n=1,Re(s(s({},o),{},{type:"info",message:a,duration:864e5,showProgressBar:!1,pauseOnHover:!1}));case 1:return i=e.v,u="function"==typeof t?t():t,e.p=2,e.n=3,u;case 3:return d=e.v,e.n=4,i.dismiss();case 4:return f="function"==typeof r.success?r.success(d):null!==(c=r.success)&&void 0!==c?c:"Done!",e.n=5,Re(s(s({},o),{},{type:"success",message:f}));case 5:return e.a(2,d);case 6:return e.p=6,m=e.v,e.n=7,i.dismiss();case 7:return h="function"==typeof r.error?r.error(m):null!==(p=r.error)&&void 0!==p?p:"Something went wrong.",e.n=8,Re(s(s({},o),{},{type:"error",message:h}));case 8:throw m;case 9:return e.a(2)}},e,null,[[2,6]])})),Xe.apply(this,arguments)}if("undefined"!=typeof window&&"undefined"!=typeof document){window.addEventListener("keydown",e=>{"Escape"!==e.key&&"Esc"!==e.key||r(l().m(function e(){var t;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,We=!0,ze=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,se();case 1:return e.p=1,We=!1,ze=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,ze;case 1:e.n=3;break;case 2:e.p=2,t=e.v,console.error("Escape key dismiss failed:",t),We=!1,ze=null;case 3:return e.a(2)}},e,null,[[0,2]])}))()},{passive:!0})}try{"undefined"!=typeof window&&(window.customizableToast={createToast:Re,setDefaultColors:Ne,setDefaultMessages:_e,noop:Ue,dismiss:Ge,toastPromise:$e})}catch(e){console.error("Global assignment failed:",e)}e.createToast=Re,e.dismiss=Ge,e.noop=Ue,e.setDefaultColors=Ne,e.setDefaultMessages=_e,e.toastPromise=$e});
|
|
15
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).customizableToast={})}(this,function(t){"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const a=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;this.maxSize=t,this.map=new Map}get(t){if(!this.map.has(t))return;const e=this.map.get(t);return this.map.delete(t),this.map.set(t,e),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxSize){const t=this.map.keys().next().value;this.map.delete(t)}this.map.set(t,e)}}(200),s={};function l(t){if(!t)return"snow";const e=String(t),n=a.get(e);if(n)return n;if(s[null==t?void 0:t.toLowerCase()]){const n=s[t.toLowerCase()];return a.set(e,n),n}let o,r,l;try{const e=function(t){const e=null==t?void 0:t.match(/^#([0-9a-f]{3,8})$/i);if(e){let t=e[1];return 3===t.length&&(t=t.split("").map(t=>t+t).join("")),{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}const n=null==t?void 0:t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(n)return{r:Number(n[1]),g:Number(n[2]),b:Number(n[3])};const o=null==t?void 0:t.match(/hsla?\(\s*([\d.]+)(?:deg)?\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\)/i);if(o){const t=Number(o[1])/360,e=Number(o[2])/100,n=Number(o[3])/100;if(0===e){const t=Math.round(255*n);return{r:t,g:t,b:t}}const r=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;return{r:Math.round(255*r(a,i,t+1/3)),g:Math.round(255*r(a,i,t)),b:Math.round(255*r(a,i,t-1/3))}}return null}(function(t){var e;const n=null==t?void 0:t.match(/^var\((--[\w-]+)(?:\s*,\s*(.+))?\)$/i);if(!n)return t;try{if("undefined"!=typeof document&&"function"==typeof getComputedStyle){const t=getComputedStyle(document.documentElement).getPropertyValue(n[1]).trim();if(t)return t}}catch(t){}return(null===(e=n[2])||void 0===e?void 0:e.trim())||t}(t));if(!e)throw new Error("Unknown color");o=e.r,r=e.g,l=e.b}catch(t){o=r=l=128}const c=(t,e,n)=>{const o=[t,e,n].map(t=>(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*o[0]+.7152*o[1]+.0722*o[2]},u=(t,e)=>{const n=c(...t),o=c(...e);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let d=((t,e,n)=>{t/=255,e/=255,n/=255;const o=Math.max(t,e,n),r=Math.min(t,e,n);let i,a,s=(o+r)/2;if(o===r)i=a=0;else{const l=o-r;switch(a=s>.5?l/(2-o-r):l/(o+r),o){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return[360*i,a,s]})(o,r,l),f=i(d,3),m=f[0],p=f[1],h=f[2],y=((t,e,n)=>{let o,r,i;if(t/=360,0===e)o=r=i=n;else{const a=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;o=a(l,s,t+1/3),r=a(l,s,t),i=a(l,s,t-1/3)}return[Math.round(255*o),Math.round(255*r),Math.round(255*i)]})(m,p,h<.5?Math.min(h+.5,1):Math.max(h-.5,0)),g=i(y,3),b=g[0],v=g[1],w=g[2];if(u([o,r,l],[b,v,w])<4.5){var x=i(u([o,r,l],[0,0,0])>=u([o,r,l],[255,255,255])?[0,0,0]:[255,255,255],3);b=x[0],v=x[1],w=x[2]}const C=((t,e,n)=>"#".concat(t.toString(16).padStart(2,"0")).concat(e.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(b,v,w);return a.set(e,C),C}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(t=>{let e=i(t,2),n=e[0],o=i(e[1],3),r=o[0],a=o[1],l=o[2];const c=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},u=.2126*c(r)+.7152*c(a)+.0722*c(l),d=(u+.05)/.05,f=1.05/(u+.05);s[n.toLowerCase()]=d>=f?"#000000":"#ffffff"});const c=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),u=new Set(["href","src","alt","title","class","target","rel","loading"]),d=/<\/?(script|iframe|object|embed|link|meta|style|form|input|button|svg|math|video|audio|details|dialog|applet|frame|frameset|textarea|select|option|optgroup|fieldset|legend|datalist|output|progress|meter|keygen|canvas|map|area|base|basefont|bgsound|blink|center|dir|font|hgroup|isindex|listing|marquee|multicol|nextid|noembed|noframes|plaintext|rb|rtc|spacer|strike|tt|xmp)[^>]*>/gi,f=/\s(on\w+)\s*=\s*(['"])[\s\S]*?\2/gi,m=/(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi;function p(t,e,n){if(t.nodeType===Node.TEXT_NODE)return document.createTextNode(t.nodeValue);if(t.nodeType===Node.COMMENT_NODE)return null;if(t.nodeType!==Node.ELEMENT_NODE)return null;const o=t.tagName.toUpperCase();if(!e.has(o)){const o=document.createDocumentFragment();return Array.from(t.childNodes).forEach(t=>{const r=p(t,e,n);r&&o.appendChild(r)}),o}const r=document.createElement(t.tagName);return Array.from(t.attributes||[]).forEach(t=>{r.setAttribute(t.name,t.value)}),function(t,e){const n=[];Array.from(t.attributes||[]).forEach(o=>{const r=o.name.toLowerCase(),i=o.value;if(e.has(r))if("href"!==r&&"src"!==r||!/^\s*javascript:/i.test(i))if("src"!==r||/^\s*(https?:|data:image\/)/i.test(i)){if("target"===r&&"_blank"===i){const e=(t.getAttribute("rel")||"").split(/\s+/).filter(Boolean);e.includes("noopener")||e.push("noopener"),e.includes("noreferrer")||e.push("noreferrer"),t.setAttribute("rel",e.join(" "))}}else n.push(r);else n.push(r);else n.push(r)}),n.forEach(e=>t.removeAttribute(e))}(r,n),Array.from(t.childNodes).forEach(t=>{const o=p(t,e,n);o&&r.appendChild(o)}),r}function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof t||!t.trim())return"";try{if(!e.forceFallback&&function(){try{if("undefined"!=typeof window&&window.DOMPurify)return!0}catch(t){}return!1}()){const e=window.DOMPurify.sanitize(t,{ALLOWED_TAGS:Array.from(c),ALLOWED_ATTR:Array.from(u),ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i}),n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll('a[target="_blank"]').forEach(t=>{const e=(t.getAttribute("rel")||"").split(/\s+/).filter(Boolean);e.includes("noopener")||e.push("noopener"),e.includes("noreferrer")||e.push("noreferrer"),t.setAttribute("rel",e.join(" "))}),n.innerHTML}}catch(t){console.warn("DOMPurify sanitization failed, falling back:",t)}return function(t){if(!t||"string"!=typeof t)return"";let e=t.replace(d,"");e=e.replace(f,""),e=e.replace(m,"$1=$2#$2");const n=document.createElement("div");n.innerHTML=e;const o=document.createDocumentFragment();Array.from(n.childNodes).forEach(t=>{const e=p(t,c,u);e&&o.appendChild(e)});const r=document.createElement("div");return r.appendChild(o),r.querySelectorAll('a[target="_blank"]').forEach(t=>{const e=(t.getAttribute("rel")||"").split(/\s+/).filter(Boolean);e.includes("noopener")||e.push("noopener"),e.includes("noreferrer")||e.push("noreferrer"),t.setAttribute("rel",e.join(" "))}),r.innerHTML}(t)}async function y(t,e,n){var o,i;const a=await async function(t){if("number"==typeof t&&Number.isFinite(t)&&t>0)return t;if("string"==typeof t){if(t.endsWith("s")&&!t.endsWith("ms")){const e=1e3*parseFloat(t);return Number.isFinite(e)&&e>0?e:500}const e=parseFloat(t);return Number.isFinite(e)&&e>0?e:500}return 500}(null==e?void 0:e.animationDuration),s="".concat(a,"ms"),c="string"==typeof(null==e?void 0:e.animationEasing)&&e.animationEasing.trim()?e.animationEasing.trim():"ease",u="string"==typeof(null==e?void 0:e.className)&&e.className.trim()?" ".concat(e.className.trim()):"";t.className="toast toast-".concat(null!==(o=null==e?void 0:e.type)&&void 0!==o?o:"info").concat(u),Object.assign(t.style,{background:null==e?void 0:e.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:null==e?void 0:e.borderRadius,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:null==e?void 0:e.maxWidth,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",pointerEvents:"auto",transition:"opacity ".concat(s," ").concat(c,", transform ").concat(s," ").concat(c),transform:"translateY(20px)",zIndex:"9999"}),t.setAttribute("role","alert"),t.setAttribute("aria-live","polite"),t.tabIndex=0,t._animationDuration=a;const d=document.createElement("span");null!=e&&e.wrapText?Object.assign(d.style,{display:"block",whiteSpace:"normal"}):Object.assign(d.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"normal",overflow:"hidden",textOverflow:"ellipsis"}),Object.assign(d.style,{flex:"1",padding:null==e?void 0:e.fontPadding,fontFamily:null==e?void 0:e.fontFamily,fontSize:null==e?void 0:e.fontSize,fontWeight:null==e?void 0:e.fontWeight,lineHeight:null==e?void 0:e.fontLineHeight,color:null==e?void 0:e.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",direction:null!=e&&e.fontDirection&&"auto"!==e.fontDirection?e.fontDirection:void 0});const f=!!e.allowHtml,m=null!==(i=e.message)&&void 0!==i?i:"";if(e.loader||e.showLoader){const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},n=Number(e.size)||14,o="string"==typeof e.color&&e.color.trim()?e.color.trim():"currentColor",r="string"==typeof e.text?e.text:"",i=document.createElement("span");i.className="toast-loader",i.style.display="inline-flex",i.style.alignItems="center",i.style.gap="8px";const a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"svg");s.setAttribute("width",String(n)),s.setAttribute("height",String(n)),s.setAttribute("viewBox","0 0 50 50"),s.setAttribute("aria-hidden","true");const l=document.createElementNS(a,"circle");if(l.setAttribute("cx","25"),l.setAttribute("cy","25"),l.setAttribute("r","20"),l.setAttribute("fill","none"),l.setAttribute("stroke",o),l.setAttribute("stroke-width","4"),l.setAttribute("stroke-linecap","round"),l.style.opacity="0.85",l.style.strokeDasharray="90",l.style.strokeDashoffset="60",l.style.transformOrigin="center",l.style.animation="toast-spinner 1s linear infinite",s.appendChild(l),i.appendChild(s),r){const t=document.createElement("span");t.style.fontSize="13px",t.textContent=r,i.appendChild(t)}if("undefined"!=typeof document&&!document.getElementById("toast-spinner-styles")){const t=document.createElement("style");t.id="toast-spinner-styles",t.textContent="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }";const e=document.head||document.documentElement;e&&e.appendChild(t)}return i}(e.loader||{});d.appendChild(t);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",d.appendChild(n)}if(f&&"string"==typeof m&&m.trim().length>0)try{const t=h(m),e=document.createElement("div");for(e.innerHTML=t;e.firstChild;)d.appendChild(e.firstChild)}catch(t){console.warn("HTML message sanitization failed, falling back to text:",t),d.appendChild(document.createTextNode(String(m)))}else d.appendChild(document.createTextNode(String(m)));d.setAttribute("title","string"==typeof m?m.replace(/<[^>]+>/g,""):String(m)),t.appendChild(d),null!=e&&e.cta&&0!==Object.keys(e.cta).length&&function(t,e,n){const o=null==e?void 0:e.cta;if(!o||"object"!=typeof o||Array.isArray(o))return;const i=r({},o);i.label||(i.label="CTA Label Missing!");const a=!!i.href&&"link"===i.variant,s=document.createElement(a?"a":"button");a?(s.href=i.href,i.target&&(s.target=i.target),s.rel=i.rel||("_blank"===i.target?"noopener noreferrer":"")):s.type="button",s.setAttribute("aria-label",i.ariaLabel||i.label);const c=e.textColor||l(e.backgroundColor),u=e.backgroundColor&&(f=e.backgroundColor)&&"#000000"===l(f)?"rgba(0,0,0,0.15)":"rgba(255,255,255,0.15)",d="string"==typeof c&&/^#[0-9a-fA-F]{6}$/.test(c.trim())?"".concat(c.trim(),"44"):"rgba(128, 128, 128, 0.3)";var f;Object.assign(s.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:"1px solid ".concat(d),color:c,background:u,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),s.textContent=i.label;const m=async e=>{try{if("function"==typeof i.onClick){const t=i.onClick(e);null!=t&&t.then&&await t}}catch(t){console.error("CTA onClick handler error:",t)}finally{!1!==i.autoClose&&"function"==typeof n&&n(t)}};s.addEventListener("click",m),s._cleanup=()=>s.removeEventListener("click",m),t._cleanupCTA=()=>s.removeEventListener("click",m),t.appendChild(s)}(t,e,n),null!=e&&e.showCloseButton&&function(t,e,n){const o=document.createElement("button");o.setAttribute("aria-label","Close notification"),o.setAttribute("title","Close"),o.textContent="×";const r=e.textColor||l(e.backgroundColor);Object.assign(o.style,{background:"none",border:"none",color:r,fontSize:"18px",marginLeft:"10px",cursor:"pointer",lineHeight:"1",padding:"0 4px"});const i=()=>{"function"==typeof n&&n(t)};o.addEventListener("click",i),t._cleanupCloseButton=()=>{o.removeEventListener("click",i)},t.appendChild(o)}(t,e,n),null!=e&&e.showProgressBar&&function(t,e){var n;const o=document.createElement("div"),r=e.borderRadius||"0",i=parseInt(r,10),a=parseInt(e.progressHeight,10)||4,s=Number(null!==(n=e.duration)&&void 0!==n?n:2500)+5,l=Math.min(i,2*a),c=i>0?"calc(100% - ".concat(l,"px)"):"100%";Object.assign(o.style,{position:"absolute",left:"".concat(l,"px"),height:"".concat(a,"px"),background:e.progressColor||"currentColor",width:"".concat(c),transition:"width ".concat(s,"ms linear"),["top"===e.progressPosition?"top":"bottom"]:"0",borderRadius:"".concat(a/2,"px"),opacity:"0.8"}),t.appendChild(o),"function"==typeof o.animate?t._progressAnimation=o.animate([{width:c},{width:"0%"}],{duration:s,easing:"linear",fill:"forwards",delay:50}):(o.style.transition="width ".concat(s,"ms linear"),setTimeout(()=>{o.offsetWidth,o.style.width="0%"},50))}(t,e),function(t){setTimeout(()=>{requestAnimationFrame(()=>{t.style.opacity="1",t.style.transform="translateY(0)"})},50)}(t)}async function g(t,e){try{const n=document.createElement("div"),o=((null==t?void 0:t.position)||"bottom-right").toLowerCase().trim();let r="auto",i="auto",a="auto",s="auto",l="none";o.startsWith("top")?r="20px":(o.startsWith("bottom")||o.includes("below"))&&(i="20px"),o.startsWith("left")?a="20px":o.startsWith("right")?s="20px":"center"===o?(a="50%",r="50%",l="translate(-50%, -50%)"):o.includes("center")?o.includes("left")?(a="20px",r="50%",l="translateY(-50%)"):o.includes("right")?(s="20px",r="50%",l="translateY(-50%)"):o.includes("top")?(r="20px",a="50%",l="translateX(-50%)"):o.includes("bottom")&&(i="20px",a="50%",l="translateX(-50%)"):(s="20px",i="20px"),Object.assign(n.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:r,bottom:i,left:a,right:s,transform:l,zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)"});const c=document.createElement("div"),u=document.createElement("span");u.style.display="inline-block",t.allowHtml?u.innerHTML=h(String(t.message||"Emergency Toast Showing!")):u.textContent=String(t.message||"Emergency Toast Creation Showing!"),c.appendChild(u);const d=document.createElement("span");for(d.style.cssText="float: right; margin-left: 10px; font-weight: bold; cursor: pointer;",d.textContent="×",c.appendChild(d);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(c),d.addEventListener("click",()=>{n.remove(),"function"==typeof e&&e(n)}),document.body.appendChild(n);const f=Number(null==t?void 0:t.duration)||2500,m=setTimeout(()=>{n.remove(),"function"==typeof e&&e(n)},f);return"function"==typeof(null==m?void 0:m.unref)&&m.unref(),n}catch(t){return console.error("Emergency toast creation failed:",t),"function"==typeof e&&e(null),null}}const b=new Map,v=new Map;function w(t){if(!t||"string"!=typeof t)return"bottom-right";const e=t.toLowerCase().trim();return e?e.replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-"):"bottom-right"}async function x(t,e){const n=function(t){const e=w(t);return"toast-container-".concat(e)}((null==t?void 0:t.position)||"bottom-right");if(v.has(n))return v.get(n);const o=(async()=>{const o=b.get(n),r="undefined"==typeof document||(null==o?void 0:o.ownerDocument)===document;if(null!=o&&o.isConnected&&r)return o;o&&b.delete(n);let i=document.getElementById(n);i&&!i.isConnected&&document.body.appendChild(i),i?(i.style.position=i.style.position||"fixed",i.style.zIndex=i.style.zIndex||"9999","function"==typeof e&&await e(i,t)):(i=document.createElement("div"),i.id=n,i.setAttribute("role","status"),i.setAttribute("aria-atomic","true"),i.style.position="fixed",i.style.zIndex="9999",i.style.pointerEvents="none",i.style.inset="auto 10px 10px auto",i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center",i.style.flexDirection="column",i.style.overflow="hidden","function"==typeof e&&await e(i,t),document.body.appendChild(i));const a=document.querySelectorAll("#".concat(n));if(a.length>1)for(let t=1;t<a.length;t++)try{a[t].remove()}catch(t){}return b.set(n,i),i})();v.set(n,o);try{return await o}finally{v.delete(n)}}const C=new Set(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","left-center","right-center","top-full-width","bottom-full-width","center"]),k=new Set(["top","bottom"]);async function E(t,e){if(!t||null==e||!e.position)throw new Error("Invalid container or position!");const n=String(e.position).toLowerCase().trim();let o=n;var r;r=n,C.has(r)||k.has(n)||(console.warn('Unknown position "'.concat(e.position,'", defaulting to "bottom-right"')),o="bottom-right"),function(t){t.style.top="auto",t.style.bottom="auto",t.style.left="auto",t.style.right="auto",t.style.transform="none"}(t);const i=function(t){const e=t.toLowerCase().trim();return{hasTop:e.startsWith("top"),hasBottom:e.startsWith("bottom")||e.startsWith("below"),hasLeft:e.startsWith("left"),hasRight:e.startsWith("right"),hasCenter:"center"===e||e.includes("center")&&!e.includes("left")&&!e.includes("right")&&!e.includes("top")&&!e.includes("bottom"),hasFullWidth:"top-full-width"===e||"bottom-full-width"===e}}(o);(function(t,e,n){if(!n.hasFullWidth)return!1;t.style.maxWidth="100vw";try{e&&!e.maxWidth&&(e.maxWidth="100vw")}catch(t){}return n.hasTop?(t.style.top="10px",t.style.left="10px",t.style.right="10px",!0):!!n.hasBottom&&(t.style.bottom="10px",t.style.left="10px",t.style.right="10px",!0)})(t,e,i)||function(t,e){return!!e.hasCenter&&(!e.hasTop||e.hasLeft||e.hasRight?!e.hasBottom||e.hasLeft||e.hasRight?!e.hasLeft||e.hasTop||e.hasBottom?!e.hasRight||e.hasTop||e.hasBottom?!(e.hasLeft||e.hasRight||e.hasTop||e.hasBottom)&&(t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",!0):(t.style.right="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0):(t.style.left="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0):(t.style.bottom="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0):(t.style.top="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0))}(t,i)||function(t,e){e.hasBottom?t.style.bottom="10px":e.hasTop?t.style.top="10px":t.style.bottom="10px",e.hasRight?t.style.right="10px":e.hasLeft?t.style.left="10px":(t.style.left="50%",t.style.transform="translateX(-50%)")}(t,i)}class A{constructor(t,e){this.callback="function"==typeof t?t:()=>{};const n=Number.isFinite(e)&&e>=0?e:0;this.delay=n,this.remaining=n,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){var t;return this.isCompleted||this.timeoutId||(this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null;try{this.callback()}catch(t){console.error("PausableTimer callback error:",t)}},this.remaining),"function"==typeof(null===(t=this.timeoutId)||void 0===t?void 0:t.unref)&&this.timeoutId.unref()),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),this.isPaused=!0),this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}const S=new Map,T=new Map,L=[];let O=0;async function M(t,e,n){try{if(!t||"object"!=typeof t)throw new TypeError("options must be an object");O++;const o=await x(t,E);if(!o)throw new Error("Failed to create toast container");const r=await async function(t,e){let n;try{return n=await async function(t,e){const n=document.createElement(t);return n.id=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"toast";const e="string"==typeof t&&t.trim()?t.trim():"toast",n=Date.now().toString(36),o=Math.floor(1048575*Math.random()).toString(36);return"".concat(e,"-").concat(n,"-").concat(o)}(e),n}("div","toast"),await y(n,t,e),n}catch(o){return console.warn("toast creation failed with error showing fallback one: ",o),n=await g(t,e),n}}(t,D);if(!r)throw new Error("Toast element creation failed");const i=document.createElement("div");Object.assign(i.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%",pointerEvents:"auto"});const a=document.createElement("div");Object.assign(a.style,{position:"relative",overflow:"hidden",zIndex:"1"}),a.appendChild(r),i.appendChild(a),o.id.includes("toast-container-")&&o.appendChild(i);const s=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),l={outer:i,toast:r,options:t,count:Math.max(1,Math.floor(null!=n?n:0)),timeout:null,pauseOnHover:s};S.set(e,l),r._key=e,l.count>1&&await _(l),l.timer=I(r,t),await N(l)}catch(e){console.error("Something went wrong: ",e),O=Math.max(0,O-1),(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await g(t,D))}}const j=async function(){try{if(0===S.size)return;let t=null;const e=Array.from(S.values());if(e.length>0){const n=e.at(-1);t=n.toast||n.outer&&n.outer.querySelector('[id^="toast-"]')}if(t||document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{const n=Array.from(e.children||[]);if(0===n.length)return;const o=n.at(-1);o&&(t=o.querySelector('[id^="toast-"]')||o)}),!t)return;const n=t._key?t:t.querySelector('[id^="toast-"]')||t;await D(n)}catch(t){console.error("dismissMostRecent failed:",t)}};function I(t,e){const n=Number(null==e?void 0:e.duration),o=Number.isFinite(n)&&n>0?n:2500,r=new A(async()=>await D(t),o+5);return r.start(),r}async function N(t){if(!t.pauseOnHover||!t.outer||!t.timer)return;const e=t.outer,n=t.timer,o=t.toast,r=()=>{var t;n.pause(),null==o||null===(t=o._progressAnimation)||void 0===t||t.pause()},i=()=>{var t;n.resume(),null==o||null===(t=o._progressAnimation)||void 0===t||t.play()},a=t=>{var e;t.target.matches("[tabindex], div, span, button, a")&&(n.pause(),null==o||null===(e=o._progressAnimation)||void 0===e||e.pause())},s=t=>{var r;e.contains(t.relatedTarget)||(n.resume(),null==o||null===(r=o._progressAnimation)||void 0===r||r.play())};e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",i),e.addEventListener("focusin",a),e.addEventListener("focusout",s),e._pauseCleanup=()=>{e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",i),e.removeEventListener("focusin",a),e.removeEventListener("focusout",s)}}async function D(t){if(null!=t&&t._key)return P(t._key)}async function P(t){try{var e,n,o,r,i,a,s,l,c,u,d,f,m,p,h;if(!t)return;const y=T.get(t);if(y)return cancelAnimationFrame(y.rafId),void T.delete(t);const g=L.findIndex(e=>e.key===t);if(-1!==g)return void L.splice(g,1);const b=S.get(t);if(!b)return;null===(e=b.timer)||void 0===e||e.clear(),null===(n=b.outer)||void 0===n||null===(o=n._pauseCleanup)||void 0===o||o.call(n),null===(r=b.toast)||void 0===r||null===(i=r._cleanupCloseButton)||void 0===i||i.call(r),null===(a=b.toast)||void 0===a||null===(s=a._cleanupCTA)||void 0===s||s.call(a),null===(l=b.toast)||void 0===l||null===(c=l._cleanup)||void 0===c||c.call(l);const v=null===(u=b.toast)||void 0===u?void 0:u.querySelector("button, a");null==v||null===(d=v._cleanup)||void 0===d||d.call(v),S.delete(t),O=Math.max(0,O-1);const w=b.outer.querySelector(".toast-count-badge");w&&w.remove();const x=null!==(f=null===(m=b.toast)||void 0===m?void 0:m._animationDuration)&&void 0!==f?f:400;b.toast&&(b.toast.style.opacity="0",b.toast.style.transform="translateY(20px)");const C=null===(p=b.outer)||void 0===p?void 0:p.parentElement;if(await async function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400;return t?new Promise(o=>{let r=!1;const i=()=>{r||(r=!0,async function(t){if(!t)return!0;try{if("function"==typeof t.remove)return t.remove(),!0}catch(t){}try{if(t.parentNode)return t.parentNode.removeChild(t),!0}catch(t){}}(t),o())},a=e||t.firstElementChild||t;if(!a)return o();const s=t=>{try{if(t.target!==a)return;a.removeEventListener("transitionend",s,!0),i()}catch(t){console.error("removeWithTransition error:",t)}};try{a.addEventListener("transitionend",s,!0)}catch(t){console.error("removeWithTransition error:",t)}setTimeout(()=>{try{a.removeEventListener("transitionend",s,!0),i()}catch(t){console.error("removeWithTransition error:",t)}},n+100)}):Promise.resolve()}(b.outer,b.toast,x),C&&0===C.children.length&&null!==(h=C.id)&&void 0!==h&&h.startsWith("toast-container-"))try{C.remove()}catch(t){}await W()}catch(t){console.error("Closing Toast failed!: ",t)}}async function W(){for(;O<3&&L.length;){const t=L.shift();if(S.has(t.key)){const e=S.get(t.key);e.count+=t.count,await _(e);continue}M(t.options,t.key,t.count)}}async function _(t){let e=t.outer,n=t.count;if(!(e&&e instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(n<2){const t=e.querySelector(".toast-count-badge");return void(t&&t.remove())}let o=e.querySelector(".toast-count-badge");o||(o=document.createElement("span"),o.className="toast-count-badge",o.setAttribute("aria-label","".concat(n," identical notifications")),Object.assign(o.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),e.appendChild(o)),o.textContent=n>99?"99+":String(n);try{o.style.transform="scale(1.2)",setTimeout(()=>o.style.transform="scale(1)",150)}catch(t){console.error("updateBadge animation error:",t)}}let z={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},B={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"};const H=[];let R=!1;async function q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=await async function(t){var e,n;const o=null==t||null===(e=t.position)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim(),i=r(r({},{allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:"bottom-right",type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:null!=o&&o.includes("top-full-width")||null!=o&&o.includes("bottom-full-width")?"100vw":"400px"}),"object"!=typeof t||Array.isArray(t)?{}:t);i.message=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:i.message;try{var a,s;i.backgroundColor||(i.backgroundColor=null!==(a=null===(s=z)||void 0===s?void 0:s[i.type])&&void 0!==a?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111")}catch(t){console.warn("Background color resolution failed:",t)}try{var c;i.message=i.message||(null===(c=B)||void 0===c?void 0:c[i.type])||"No Message Provided!"}catch(t){console.warn("Default message resolution failed:",t)}try{!i.textColor&&i.backgroundColor&&(i.textColor=l(i.backgroundColor))}catch(t){console.warn("Text color resolution failed:",t)}try{!i.progressColor&&i.backgroundColor&&(i.progressColor=i.textColor||l(i.backgroundColor))}catch(t){console.warn("Progress bar color resolution failed:",t)}return"string"!=typeof i.message&&(i.message="No Message Provided!"),i}(t);return await async function(t){try{return await x(t,E)}catch(t){return console.error("Failed to create toast container:",t),document.body}}(e),await async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t&&"object"==typeof t?t:{},n=String(e.type||"info").trim().toLowerCase(),o=function(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n);return e>>>0}(String(e.message||"")).toString(16),r=w(e.position||"bottom-right");return"".concat(n,"|").concat(o,"|").concat(r)}(t);if(S.has(e)){const n=S.get(e);if(!n)throw new Error("Active toast with key ".concat(e," not found"));return n.count++,n.timer.clear(),n.timer=I(n.toast,t),await N(n),await _(n),e}if(T.has(e)){const t=T.get(e);if(!t)throw new Error("Pending toast with key ".concat(e," not found"));return t.count++,e}const n={options:t,count:1,rafId:0};return T.set(e,n),n.rafId=requestAnimationFrame(async()=>{const t=T.get(e);if(t){if(T.delete(e),O>=3)return L.push({options:t.options,key:e,count:t.count}),void await W();try{await M(t.options,e,t.count)}catch(t){console.error("showToast failed:",t)}}}),e}catch(t){console.error("showToast failed:",t)}}(e)}catch(t){return console.error("CreateToast failed:",t),null}}function F(t){try{if(t&&"object"==typeof t&&!Array.isArray(t)){const n=["success","error","warning","info"],o={};for(const r of Object.entries(t)){var e=i(r,2);const t=e[0],a=e[1];n.includes(t)&&"string"==typeof a&&a.trim()&&(o[t]=a.trim())}Object.keys(o).length>0&&(z=r(r({},z),o))}}catch(t){console.error("setDefaultColors failed:",t)}}function U(t){try{if(t&&"object"==typeof t&&!Array.isArray(t)){const n=["success","error","warning","info"],o={};for(const r of Object.entries(t)){var e=i(r,2);const t=e[0],a=e[1];n.includes(t)&&"string"==typeof a&&a.trim()&&(o[t]=a.trim())}Object.keys(o).length>0&&(B=r(r({},B),o))}}catch(t){console.error("setDefaultMessages failed:",t)}}let $=!1,X=null;async function Y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=await async function(){if($&&X)try{await X}catch(t){console.warn("Previous close operation failed (continuing anyway):",t)}return async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"undefined"!=typeof window&&"undefined"!=typeof document?(await async function(){if(!R&&"undefined"!=typeof window&&"undefined"!=typeof document)if("complete"===document.readyState||"interactive"===document.readyState){R=!0;const t=[...H];H.length=0;for(const e of t)setTimeout(()=>q(e),0)}else document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{R=!0;const t=[...H];H.length=0;for(const e of t)setTimeout(()=>q(e),0)},200)},{once:!0})}(),R?await q(t):(H.push(t),null)):(console.warn("ToastNotification: running in non-browser environment, no DOM available."),null)}(t)}();return{dismiss:()=>e?P(e):Promise.resolve()}}const G=async()=>{$=!0,X=(async()=>{try{await j()}finally{$=!1,X=null}})(),await X},V=async()=>{$=!0,X=(async()=>{try{await async function(){try{for(const t of T){const e=i(t,2)[1];null!=e&&e.rafId&&cancelAnimationFrame(e.rafId)}T.clear(),L.length=0;const t=Array.from(S.values()).map(t=>t.toast).filter(Boolean);for(const e of t)try{await D(e)}catch(t){console.warn("closeAllToasts: failed to close one toast:",t)}}catch(t){console.error("closeAllToasts failed:",t)}}()}finally{$=!1,X=null}})(),await X};async function K(t){var e;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=n&&"object"==typeof n?n:{},a=o&&"object"==typeof o?o:{},s=null!==(e=i.loading)&&void 0!==e?e:"Loading...",l=await Y(r(r({},a),{},{type:"info",message:s,duration:864e5,showProgressBar:!1,pauseOnHover:!1})),c=r(r({},a),{},{pauseOnHover:a.pauseOnHover});try{var u;const e="function"==typeof t?t():t,n=await e;await l.dismiss();const o="function"==typeof i.success?i.success(n):null!==(u=i.success)&&void 0!==u?u:"Done!";return await Y(r(r({},c),{},{type:"success",message:o})),n}catch(t){var d;await l.dismiss();const e="function"==typeof i.error?i.error(t):null!==(d=i.error)&&void 0!==d?d:"Something went wrong.";throw await Y(r(r({},c),{},{type:"error",message:e})),t}}if("undefined"!=typeof window&&"undefined"!=typeof document&&!window.__customizableToastEscapeAttached){window.__customizableToastEscapeAttached=!0;const t=t=>{"Escape"!==t.key&&"Esc"!==t.key||(async()=>{try{$=!0,X=(async()=>{try{await j()}finally{$=!1,X=null}})(),await X}catch(t){console.error("Escape key dismiss failed:",t),$=!1,X=null}})()};window.addEventListener("keydown",t,{passive:!0})}try{"undefined"!=typeof window&&(window.customizableToast={createToast:Y,setDefaultColors:F,setDefaultMessages:U,noop:V,dismiss:G,toastPromise:K})}catch(t){console.error("Global assignment failed:",t)}t.createToast=Y,t.dismiss=G,t.noop=V,t.resetContainerRegistry=function(){b.clear(),v.clear()},t.resetToastManager=function(){for(const t of T){const e=i(t,2)[1];null!=e&&e.rafId&&cancelAnimationFrame(e.rafId)}T.clear(),L.length=0;for(const l of S){var t,e,n,o,r,a,s;const c=i(l,2)[1];null===(t=c.timer)||void 0===t||t.clear(),null===(e=c.outer)||void 0===e||null===(n=e._pauseCleanup)||void 0===n||n.call(e),null===(o=c.toast)||void 0===o||null===(r=o._cleanupCloseButton)||void 0===r||r.call(o),null===(a=c.toast)||void 0===a||null===(s=a._cleanup)||void 0===s||s.call(a)}S.clear(),O=0},t.setDefaultColors=F,t.setDefaultMessages=U,t.toastPromise=K});
|
|
18
16
|
//# sourceMappingURL=index.umd.js.map
|