Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sonner

Package Overview
Dependencies
Maintainers
0
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sonner - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

4

dist/index.js

@@ -1,3 +0,3 @@

"use client";var Gt=Object.create;var it=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Zt=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ee=(a,e)=>{for(var t in e)it(a,t,{get:e[t],enumerable:!0})},Ht=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of qt(e))!te.call(a,c)&&c!==t&&it(a,c,{get:()=>e[c],enumerable:!(s=Qt(e,c))||s.enumerable});return a};var O=(a,e,t)=>(t=a!=null?Gt(Zt(a)):{},Ht(e||!a||!a.__esModule?it(t,"default",{value:a,enumerable:!0}):t,a)),oe=a=>Ht(it({},"__esModule",{value:!0}),a);var Te={};ee(Te,{Toaster:()=>ve,toast:()=>Yt,useSonner:()=>we});module.exports=oe(Te);var o=O(require("react")),Wt=O(require("react-dom"));var v=O(require("react")),Mt=a=>{switch(a){case"success":return ne;case"info":return se;case"warning":return re;case"error":return ie;default:return null}},ae=Array(12).fill(0),At=({visible:a,className:e})=>v.default.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":a},v.default.createElement("div",{className:"sonner-spinner"},ae.map((t,s)=>v.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),ne=v.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},v.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),re=v.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},v.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),se=v.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},v.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ie=v.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},v.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Lt=v.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},v.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),v.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}));var gt=O(require("react")),zt=()=>{let[a,e]=gt.default.useState(document.hidden);return gt.default.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),a};var jt=O(require("react")),ht=1,bt=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});this.publish=e=>{this.subscribers.forEach(t=>t(e))};this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};this.create=e=>{var P;let{message:t,...s}=e,c=typeof(e==null?void 0:e.id)=="number"||((P=e.id)==null?void 0:P.length)>0?e.id:ht++,l=this.toasts.find(h=>h.id===c),E=e.dismissible===void 0?!0:e.dismissible;return l?this.toasts=this.toasts.map(h=>h.id===c?(this.publish({...h,...e,id:c,title:t}),{...h,...e,id:c,dismissible:E,title:t}):h):this.addToast({title:t,...s,dismissible:E,id:c}),c};this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(s=>s({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e);this.message=(e,t)=>this.create({...t,message:e});this.error=(e,t)=>this.create({...t,message:e,type:"error"});this.success=(e,t)=>this.create({...t,type:"success",message:e});this.info=(e,t)=>this.create({...t,type:"info",message:e});this.warning=(e,t)=>this.create({...t,type:"warning",message:e});this.loading=(e,t)=>this.create({...t,type:"loading",message:e});this.promise=(e,t)=>{if(!t)return;let s;t.loading!==void 0&&(s=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let c=e instanceof Promise?e:e(),l=s!==void 0,E,P=c.then(async u=>{if(E=["resolve",u],jt.default.isValidElement(u))l=!1,this.create({id:s,type:"default",message:u});else if(de(u)&&!u.ok){l=!1;let D=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,j=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:s,type:"error",message:D,description:j})}else if(t.success!==void 0){l=!1;let D=typeof t.success=="function"?await t.success(u):t.success,j=typeof t.description=="function"?await t.description(u):t.description;this.create({id:s,type:"success",message:D,description:j})}}).catch(async u=>{if(E=["reject",u],t.error!==void 0){l=!1;let y=typeof t.error=="function"?await t.error(u):t.error,D=typeof t.description=="function"?await t.description(u):t.description;this.create({id:s,type:"error",message:y,description:D})}}).finally(()=>{var u;l&&(this.dismiss(s),s=void 0),(u=t.finally)==null||u.call(t)}),h=()=>new Promise((u,y)=>P.then(()=>E[0]==="reject"?y(E[1]):u(E[1])).catch(y));return typeof s!="string"&&typeof s!="number"?{unwrap:h}:Object.assign(s,{unwrap:h})};this.custom=(e,t)=>{let s=(t==null?void 0:t.id)||ht++;return this.create({jsx:e(s),id:s,...t}),s};this.subscribers=[],this.toasts=[]}},T=new bt,le=(a,e)=>{let t=(e==null?void 0:e.id)||ht++;return T.addToast({title:a,...e,id:t}),t},de=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",ce=le,ue=()=>T.toasts,Yt=Object.assign(ce,{success:T.success,info:T.info,warning:T.warning,error:T.error,custom:T.custom,message:T.message,promise:T.promise,dismiss:T.dismiss,loading:T.loading},{getHistory:ue});function yt(a,{insertAt:e}={}){if(!a||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",e==="top"&&t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s),s.styleSheet?s.styleSheet.cssText=a:s.appendChild(document.createTextNode(a))}yt(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function K(a){return a.label!==void 0}var fe=3,me="32px",Ft=4e3,pe=356,ge=14,he=20,be=200;function ye(...a){return a.filter(Boolean).join(" ")}var xe=a=>{var Tt,Rt,St,Et,Nt,Pt,Ct,Bt,It,kt,Dt;let{invert:e,toast:t,unstyled:s,interacting:c,setHeights:l,visibleToasts:E,heights:P,index:h,toasts:u,expanded:y,removeToast:D,defaultRichColors:j,closeButton:J,style:lt,cancelButtonStyle:i,actionButtonStyle:X,className:G="",descriptionClassName:dt="",duration:V,position:ct,gap:ut,loadingIcon:Q,expandByDefault:C,classNames:n,icons:N,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:Z,cn:R}=a,[B,tt]=o.default.useState(!1),[_,ft]=o.default.useState(!1),[M,A]=o.default.useState(!1),[et,L]=o.default.useState(!1),[Y,ot]=o.default.useState(!1),[d,f]=o.default.useState(0),[b,w]=o.default.useState(0),H=o.default.useRef(t.duration||V||Ft),m=o.default.useRef(null),I=o.default.useRef(null),at=h===0,nt=h+1<=E,x=t.type,F=t.dismissible!==!1,Vt=t.className||"",_t=t.descriptionClassName||"",rt=o.default.useMemo(()=>P.findIndex(r=>r.toastId===t.id)||0,[P,t.id]),Ut=o.default.useMemo(()=>{var r;return(r=t.closeButton)!=null?r:J},[t.closeButton,J]),Re=o.default.useMemo(()=>t.duration||V||Ft,[t.duration,V]),mt=o.default.useRef(0),$=o.default.useRef(0),xt=o.default.useRef(0),st=o.default.useRef(null),[Ot,Kt]=ct.split("-"),wt=o.default.useMemo(()=>P.reduce((r,g,p)=>p>=rt?r:r+g.height,0),[P,rt]),vt=zt(),Jt=t.invert||e,pt=x==="loading";$.current=o.default.useMemo(()=>rt*ut+wt,[rt,wt]),o.default.useEffect(()=>{tt(!0)},[]),o.default.useEffect(()=>{let r=I.current;if(r){let g=r.getBoundingClientRect().height;return w(g),l(p=>[{toastId:t.id,height:g,position:t.position},...p]),()=>l(p=>p.filter(S=>S.toastId!==t.id))}},[l,t.id]),o.default.useLayoutEffect(()=>{if(!B)return;let r=I.current,g=r.style.height;r.style.height="auto";let p=r.getBoundingClientRect().height;r.style.height=g,w(p),l(S=>S.find(k=>k.toastId===t.id)?S.map(k=>k.toastId===t.id?{...k,height:p}:k):[{toastId:t.id,height:p,position:t.position},...S])},[B,t.title,t.description,l,t.id]);let z=o.default.useCallback(()=>{ft(!0),f($.current),l(r=>r.filter(g=>g.toastId!==t.id)),setTimeout(()=>{D(t)},be)},[t,D,l,$]);o.default.useEffect(()=>{if(t.promise&&x==="loading"||t.duration===1/0||t.type==="loading")return;let r;return y||c||Z&&vt?(()=>{if(xt.current<mt.current){let S=new Date().getTime()-mt.current;H.current=H.current-S}xt.current=new Date().getTime()})():(()=>{H.current!==1/0&&(mt.current=new Date().getTime(),r=setTimeout(()=>{var S;(S=t.onAutoClose)==null||S.call(t,t),z()},H.current))})(),()=>clearTimeout(r)},[y,c,t,x,Z,vt,z]),o.default.useEffect(()=>{t.delete&&z()},[z,t.delete]);function Xt(){var r,g,p;return N!=null&&N.loading?o.default.createElement("div",{className:R(n==null?void 0:n.loader,(r=t==null?void 0:t.classNames)==null?void 0:r.loader,"sonner-loader"),"data-visible":x==="loading"},N.loading):Q?o.default.createElement("div",{className:R(n==null?void 0:n.loader,(g=t==null?void 0:t.classNames)==null?void 0:g.loader,"sonner-loader"),"data-visible":x==="loading"},Q):o.default.createElement(At,{className:R(n==null?void 0:n.loader,(p=t==null?void 0:t.classNames)==null?void 0:p.loader),visible:x==="loading"})}return o.default.createElement("li",{tabIndex:0,ref:I,className:R(G,Vt,n==null?void 0:n.toast,(Tt=t==null?void 0:t.classNames)==null?void 0:Tt.toast,n==null?void 0:n.default,n==null?void 0:n[x],(Rt=t==null?void 0:t.classNames)==null?void 0:Rt[x]),"data-sonner-toast":"","data-rich-colors":(St=t.richColors)!=null?St:j,"data-styled":!(t.jsx||t.unstyled||s),"data-mounted":B,"data-promise":!!t.promise,"data-swiped":Y,"data-removed":_,"data-visible":nt,"data-y-position":Ot,"data-x-position":Kt,"data-index":h,"data-front":at,"data-swiping":M,"data-dismissible":F,"data-type":x,"data-invert":Jt,"data-swipe-out":et,"data-expanded":!!(y||C&&B),style:{"--index":h,"--toasts-before":h,"--z-index":u.length-h,"--offset":`${_?d:$.current}px`,"--initial-height":C?"auto":`${b}px`,...lt,...t.style},onPointerDown:r=>{pt||!F||(m.current=new Date,f($.current),r.target.setPointerCapture(r.pointerId),r.target.tagName!=="BUTTON"&&(A(!0),st.current={x:r.clientX,y:r.clientY}))},onPointerUp:()=>{var S,W,k,U;if(et||!F)return;st.current=null;let r=Number(((S=I.current)==null?void 0:S.style.getPropertyValue("--swipe-amount").replace("px",""))||0),g=new Date().getTime()-((W=m.current)==null?void 0:W.getTime()),p=Math.abs(r)/g;if(Math.abs(r)>=he||p>.11){f($.current),(k=t.onDismiss)==null||k.call(t,t),z(),L(!0),ot(!1);return}(U=I.current)==null||U.style.setProperty("--swipe-amount","0px"),A(!1)},onPointerMove:r=>{var W,k,U;if(!st.current||!F)return;let g=r.clientY-st.current.y,p=((W=window.getSelection())==null?void 0:W.toString().length)>0;Number(((k=I.current)==null?void 0:k.style.getPropertyValue("--swipe-amount").replace("px",""))||0)>0&&ot(!0),!p&&((U=I.current)==null||U.style.setProperty("--swipe-amount",`${Math.max(0,g)}px`))}},Ut&&!t.jsx?o.default.createElement("button",{"aria-label":q,"data-disabled":pt,"data-close-button":!0,onClick:pt||!F?()=>{}:()=>{var r;z(),(r=t.onDismiss)==null||r.call(t,t)},className:R(n==null?void 0:n.closeButton,(Et=t==null?void 0:t.classNames)==null?void 0:Et.closeButton)},(Nt=N==null?void 0:N.close)!=null?Nt:Lt):null,t.jsx||o.default.isValidElement(t.title)?t.jsx?t.jsx:typeof t.title=="function"?t.title():t.title:o.default.createElement(o.default.Fragment,null,x||t.icon||t.promise?o.default.createElement("div",{"data-icon":"",className:R(n==null?void 0:n.icon,(Pt=t==null?void 0:t.classNames)==null?void 0:Pt.icon)},t.promise||t.type==="loading"&&!t.icon?t.icon||Xt():null,t.type!=="loading"?t.icon||(N==null?void 0:N[x])||Mt(x):null):null,o.default.createElement("div",{"data-content":"",className:R(n==null?void 0:n.content,(Ct=t==null?void 0:t.classNames)==null?void 0:Ct.content)},o.default.createElement("div",{"data-title":"",className:R(n==null?void 0:n.title,(Bt=t==null?void 0:t.classNames)==null?void 0:Bt.title)},typeof t.title=="function"?t.title():t.title),t.description?o.default.createElement("div",{"data-description":"",className:R(dt,_t,n==null?void 0:n.description,(It=t==null?void 0:t.classNames)==null?void 0:It.description)},typeof t.description=="function"?t.description():t.description):null),o.default.isValidElement(t.cancel)?t.cancel:t.cancel&&K(t.cancel)?o.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:t.cancelButtonStyle||i,onClick:r=>{var g,p;K(t.cancel)&&F&&((p=(g=t.cancel).onClick)==null||p.call(g,r),z())},className:R(n==null?void 0:n.cancelButton,(kt=t==null?void 0:t.classNames)==null?void 0:kt.cancelButton)},t.cancel.label):null,o.default.isValidElement(t.action)?t.action:t.action&&K(t.action)?o.default.createElement("button",{"data-button":!0,"data-action":!0,style:t.actionButtonStyle||X,onClick:r=>{var g,p;K(t.action)&&((p=(g=t.action).onClick)==null||p.call(g,r),!r.defaultPrevented&&z())},className:R(n==null?void 0:n.actionButton,(Dt=t==null?void 0:t.classNames)==null?void 0:Dt.actionButton)},t.action.label):null))};function $t(){if(typeof window=="undefined"||typeof document=="undefined")return"ltr";let a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function we(){let[a,e]=o.default.useState([]);return o.default.useEffect(()=>T.subscribe(t=>{e(s=>{if("dismiss"in t&&t.dismiss)return s.filter(l=>l.id!==t.id);let c=s.findIndex(l=>l.id===t.id);if(c!==-1){let l=[...s];return l[c]={...l[c],...t},l}else return[t,...s]})}),[]),{toasts:a}}var ve=(0,o.forwardRef)(function(e,t){let{invert:s,position:c="bottom-right",hotkey:l=["altKey","KeyT"],expand:E,closeButton:P,className:h,offset:u,theme:y="light",richColors:D,duration:j,style:J,visibleToasts:lt=fe,toastOptions:i,dir:X=$t(),gap:G=ge,loadingIcon:dt,icons:V,containerAriaLabel:ct="Notifications",pauseWhenPageIsHidden:ut,cn:Q=ye}=e,[C,n]=o.default.useState([]),N=o.default.useMemo(()=>Array.from(new Set([c].concat(C.filter(d=>d.position).map(d=>d.position)))),[C,c]),[q,Z]=o.default.useState([]),[R,B]=o.default.useState(!1),[tt,_]=o.default.useState(!1),[ft,M]=o.default.useState(y!=="system"?y:typeof window!="undefined"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=o.default.useRef(null),et=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=o.default.useRef(null),Y=o.default.useRef(!1),ot=o.default.useCallback(d=>{n(f=>{var b;return(b=f.find(w=>w.id===d.id))!=null&&b.delete||T.dismiss(d.id),f.filter(({id:w})=>w!==d.id)})},[]);return o.default.useEffect(()=>T.subscribe(d=>{if(d.dismiss){n(f=>f.map(b=>b.id===d.id?{...b,delete:!0}:b));return}setTimeout(()=>{Wt.default.flushSync(()=>{n(f=>{let b=f.findIndex(w=>w.id===d.id);return b!==-1?[...f.slice(0,b),{...f[b],...d},...f.slice(b+1)]:[d,...f]})})})}),[]),o.default.useEffect(()=>{if(y!=="system"){M(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window=="undefined")return;let d=window.matchMedia("(prefers-color-scheme: dark)");try{d.addEventListener("change",({matches:f})=>{M(f?"dark":"light")})}catch(f){d.addListener(({matches:b})=>{try{M(b?"dark":"light")}catch(w){console.error(w)}})}},[y]),o.default.useEffect(()=>{C.length<=1&&B(!1)},[C]),o.default.useEffect(()=>{let d=f=>{var w,H;l.every(m=>f[m]||f.code===m)&&(B(!0),(w=A.current)==null||w.focus()),f.code==="Escape"&&(document.activeElement===A.current||(H=A.current)!=null&&H.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l]),o.default.useEffect(()=>{if(A.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Y.current=!1)}},[A.current]),o.default.createElement("section",{"aria-label":`${ct} ${et}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},N.map((d,f)=>{var H;let[b,w]=d.split("-");return C.length?o.default.createElement("ol",{key:d,dir:X==="auto"?$t():X,tabIndex:-1,ref:A,className:h,"data-sonner-toaster":!0,"data-theme":ft,"data-y-position":b,"data-lifted":R&&C.length>1&&!E,"data-x-position":w,style:{"--front-toast-height":`${((H=q[0])==null?void 0:H.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||me,"--width":`${pe}px`,"--gap":`${G}px`,...J},onBlur:m=>{Y.current&&!m.currentTarget.contains(m.relatedTarget)&&(Y.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:m=>{m.target instanceof HTMLElement&&m.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,L.current=m.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{tt||B(!1)},onPointerDown:m=>{m.target instanceof HTMLElement&&m.target.dataset.dismissible==="false"||_(!0)},onPointerUp:()=>_(!1)},C.filter(m=>!m.position&&f===0||m.position===d).map((m,I)=>{var at,nt;return o.default.createElement(xe,{key:m.id,icons:V,index:I,toast:m,defaultRichColors:D,duration:(at=i==null?void 0:i.duration)!=null?at:j,className:i==null?void 0:i.className,descriptionClassName:i==null?void 0:i.descriptionClassName,invert:s,visibleToasts:lt,closeButton:(nt=i==null?void 0:i.closeButton)!=null?nt:P,interacting:tt,position:d,style:i==null?void 0:i.style,unstyled:i==null?void 0:i.unstyled,classNames:i==null?void 0:i.classNames,cancelButtonStyle:i==null?void 0:i.cancelButtonStyle,actionButtonStyle:i==null?void 0:i.actionButtonStyle,removeToast:ot,toasts:C.filter(x=>x.position==m.position),heights:q.filter(x=>x.position==m.position),setHeights:Z,expandByDefault:E,gap:G,loadingIcon:dt,expanded:R,pauseWhenPageIsHidden:ut,cn:Q})})):null}))});0&&(module.exports={Toaster,toast,useSonner});
"use client";var Gt=Object.create;var rt=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Zt=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ee=(a,e)=>{for(var t in e)rt(a,t,{get:e[t],enumerable:!0})},Mt=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of qt(e))!te.call(a,c)&&c!==t&&rt(a,c,{get:()=>e[c],enumerable:!(r=Qt(e,c))||r.enumerable});return a};var V=(a,e,t)=>(t=a!=null?Gt(Zt(a)):{},Mt(e||!a||!a.__esModule?rt(t,"default",{value:a,enumerable:!0}):t,a)),oe=a=>Mt(rt({},"__esModule",{value:!0}),a);var Te={};ee(Te,{Toaster:()=>we,toast:()=>Ft,useSonner:()=>ve});module.exports=oe(Te);var o=V(require("react")),_t=V(require("react-dom"));var T=V(require("react")),At=a=>{switch(a){case"success":return ne;case"info":return re;case"warning":return se;case"error":return ie;default:return null}},ae=Array(12).fill(0),Lt=({visible:a,className:e})=>T.default.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":a},T.default.createElement("div",{className:"sonner-spinner"},ae.map((t,r)=>T.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),ne=T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),se=T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),re=T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ie=T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),zt=T.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},T.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}));var pt=V(require("react")),jt=()=>{let[a,e]=pt.default.useState(document.hidden);return pt.default.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),a};var Yt=V(require("react")),gt=1,ht=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});this.publish=e=>{this.subscribers.forEach(t=>t(e))};this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};this.create=e=>{var P;let{message:t,...r}=e,c=typeof(e==null?void 0:e.id)=="number"||((P=e.id)==null?void 0:P.length)>0?e.id:gt++,l=this.toasts.find(h=>h.id===c),E=e.dismissible===void 0?!0:e.dismissible;return l?this.toasts=this.toasts.map(h=>h.id===c?(this.publish({...h,...e,id:c,title:t}),{...h,...e,id:c,dismissible:E,title:t}):h):this.addToast({title:t,...r,dismissible:E,id:c}),c};this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e);this.message=(e,t)=>this.create({...t,message:e});this.error=(e,t)=>this.create({...t,message:e,type:"error"});this.success=(e,t)=>this.create({...t,type:"success",message:e});this.info=(e,t)=>this.create({...t,type:"info",message:e});this.warning=(e,t)=>this.create({...t,type:"warning",message:e});this.loading=(e,t)=>this.create({...t,type:"loading",message:e});this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let c=e instanceof Promise?e:e(),l=r!==void 0,E,P=c.then(async u=>{if(E=["resolve",u],Yt.default.isValidElement(u))l=!1,this.create({id:r,type:"default",message:u});else if(de(u)&&!u.ok){l=!1;let k=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,j=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:r,type:"error",message:k,description:j})}else if(t.success!==void 0){l=!1;let k=typeof t.success=="function"?await t.success(u):t.success,j=typeof t.description=="function"?await t.description(u):t.description;this.create({id:r,type:"success",message:k,description:j})}}).catch(async u=>{if(E=["reject",u],t.error!==void 0){l=!1;let y=typeof t.error=="function"?await t.error(u):t.error,k=typeof t.description=="function"?await t.description(u):t.description;this.create({id:r,type:"error",message:y,description:k})}}).finally(()=>{var u;l&&(this.dismiss(r),r=void 0),(u=t.finally)==null||u.call(t)}),h=()=>new Promise((u,y)=>P.then(()=>E[0]==="reject"?y(E[1]):u(E[1])).catch(y));return typeof r!="string"&&typeof r!="number"?{unwrap:h}:Object.assign(r,{unwrap:h})};this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||gt++;return this.create({jsx:e(r),id:r,...t}),r};this.subscribers=[],this.toasts=[]}},R=new ht,le=(a,e)=>{let t=(e==null?void 0:e.id)||gt++;return R.addToast({title:a,...e,id:t}),t},de=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",ce=le,ue=()=>R.toasts,Ft=Object.assign(ce,{success:R.success,info:R.info,warning:R.warning,error:R.error,custom:R.custom,message:R.message,promise:R.promise,dismiss:R.dismiss,loading:R.loading},{getHistory:ue});function bt(a,{insertAt:e}={}){if(!a||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}bt(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function O(a){return a.label!==void 0}var fe=3,me="32px",$t=4e3,pe=356,ge=14,he=20,be=200;function ye(...a){return a.filter(Boolean).join(" ")}var xe=a=>{var Tt,Rt,St,Et,Nt,Pt,Ct,Bt,It,kt,Dt;let{invert:e,toast:t,unstyled:r,interacting:c,setHeights:l,visibleToasts:E,heights:P,index:h,toasts:u,expanded:y,removeToast:k,defaultRichColors:j,closeButton:K,style:it,cancelButtonStyle:i,actionButtonStyle:J,className:X="",descriptionClassName:lt="",duration:_,position:dt,gap:ct,loadingIcon:G,expandByDefault:C,classNames:n,icons:N,closeButtonAriaLabel:Q="Close toast",pauseWhenPageIsHidden:q,cn:S}=a,[B,Z]=o.default.useState(!1),[U,ut]=o.default.useState(!1),[M,A]=o.default.useState(!1),[tt,L]=o.default.useState(!1),[Y,et]=o.default.useState(!1),[d,f]=o.default.useState(0),[b,w]=o.default.useState(0),D=o.default.useRef(t.duration||_||$t),m=o.default.useRef(null),H=o.default.useRef(null),ot=h===0,at=h+1<=E,x=t.type,F=t.dismissible!==!1,Ut=t.className||"",Vt=t.descriptionClassName||"",nt=o.default.useMemo(()=>P.findIndex(s=>s.toastId===t.id)||0,[P,t.id]),Ot=o.default.useMemo(()=>{var s;return(s=t.closeButton)!=null?s:K},[t.closeButton,K]),Re=o.default.useMemo(()=>t.duration||_||$t,[t.duration,_]),ft=o.default.useRef(0),$=o.default.useRef(0),yt=o.default.useRef(0),st=o.default.useRef(null),[xt,Kt]=dt.split("-"),vt=o.default.useMemo(()=>P.reduce((s,p,g)=>g>=nt?s:s+p.height,0),[P,nt]),wt=jt(),Jt=t.invert||e,mt=x==="loading";$.current=o.default.useMemo(()=>nt*ct+vt,[nt,vt]),o.default.useEffect(()=>{Z(!0)},[]),o.default.useEffect(()=>{let s=H.current;if(s){let p=s.getBoundingClientRect().height;return w(p),l(g=>[{toastId:t.id,height:p,position:t.position},...g]),()=>l(g=>g.filter(v=>v.toastId!==t.id))}},[l,t.id]),o.default.useLayoutEffect(()=>{if(!B)return;let s=H.current,p=s.style.height;s.style.height="auto";let g=s.getBoundingClientRect().height;s.style.height=p,w(g),l(v=>v.find(I=>I.toastId===t.id)?v.map(I=>I.toastId===t.id?{...I,height:g}:I):[{toastId:t.id,height:g,position:t.position},...v])},[B,t.title,t.description,l,t.id]);let z=o.default.useCallback(()=>{ut(!0),f($.current),l(s=>s.filter(p=>p.toastId!==t.id)),setTimeout(()=>{k(t)},be)},[t,k,l,$]);o.default.useEffect(()=>{if(t.promise&&x==="loading"||t.duration===1/0||t.type==="loading")return;let s;return y||c||q&&wt?(()=>{if(yt.current<ft.current){let v=new Date().getTime()-ft.current;D.current=D.current-v}yt.current=new Date().getTime()})():(()=>{D.current!==1/0&&(ft.current=new Date().getTime(),s=setTimeout(()=>{var v;(v=t.onAutoClose)==null||v.call(t,t),z()},D.current))})(),()=>clearTimeout(s)},[y,c,t,x,q,wt,z]),o.default.useEffect(()=>{t.delete&&z()},[z,t.delete]);function Xt(){var s,p,g;return N!=null&&N.loading?o.default.createElement("div",{className:S(n==null?void 0:n.loader,(s=t==null?void 0:t.classNames)==null?void 0:s.loader,"sonner-loader"),"data-visible":x==="loading"},N.loading):G?o.default.createElement("div",{className:S(n==null?void 0:n.loader,(p=t==null?void 0:t.classNames)==null?void 0:p.loader,"sonner-loader"),"data-visible":x==="loading"},G):o.default.createElement(Lt,{className:S(n==null?void 0:n.loader,(g=t==null?void 0:t.classNames)==null?void 0:g.loader),visible:x==="loading"})}return o.default.createElement("li",{tabIndex:0,ref:H,className:S(X,Ut,n==null?void 0:n.toast,(Tt=t==null?void 0:t.classNames)==null?void 0:Tt.toast,n==null?void 0:n.default,n==null?void 0:n[x],(Rt=t==null?void 0:t.classNames)==null?void 0:Rt[x]),"data-sonner-toast":"","data-rich-colors":(St=t.richColors)!=null?St:j,"data-styled":!(t.jsx||t.unstyled||r),"data-mounted":B,"data-promise":!!t.promise,"data-swiped":Y,"data-removed":U,"data-visible":at,"data-y-position":xt,"data-x-position":Kt,"data-index":h,"data-front":ot,"data-swiping":M,"data-dismissible":F,"data-type":x,"data-invert":Jt,"data-swipe-out":tt,"data-expanded":!!(y||C&&B),style:{"--index":h,"--toasts-before":h,"--z-index":u.length-h,"--offset":`${U?d:$.current}px`,"--initial-height":C?"auto":`${b}px`,...it,...t.style},onPointerDown:s=>{mt||!F||(m.current=new Date,f($.current),s.target.setPointerCapture(s.pointerId),s.target.tagName!=="BUTTON"&&(A(!0),st.current={x:s.clientX,y:s.clientY}))},onPointerUp:()=>{var v,W,I,Ht;if(tt||!F)return;st.current=null;let s=Number(((v=H.current)==null?void 0:v.style.getPropertyValue("--swipe-amount").replace("px",""))||0),p=new Date().getTime()-((W=m.current)==null?void 0:W.getTime()),g=Math.abs(s)/p;if(Math.abs(s)>=he||g>.11){f($.current),(I=t.onDismiss)==null||I.call(t,t),z(),L(!0),et(!1);return}(Ht=H.current)==null||Ht.style.setProperty("--swipe-amount","0px"),A(!1)},onPointerMove:s=>{var W,I;if(!st.current||!F)return;let p=s.clientY-st.current.y,g=((W=window.getSelection())==null?void 0:W.toString().length)>0,v=xt==="top"?Math.min(0,p):Math.max(0,p);Math.abs(v)>0&&et(!0),!g&&((I=H.current)==null||I.style.setProperty("--swipe-amount",`${v}px`))}},Ot&&!t.jsx?o.default.createElement("button",{"aria-label":Q,"data-disabled":mt,"data-close-button":!0,onClick:mt||!F?()=>{}:()=>{var s;z(),(s=t.onDismiss)==null||s.call(t,t)},className:S(n==null?void 0:n.closeButton,(Et=t==null?void 0:t.classNames)==null?void 0:Et.closeButton)},(Nt=N==null?void 0:N.close)!=null?Nt:zt):null,t.jsx||o.default.isValidElement(t.title)?t.jsx?t.jsx:typeof t.title=="function"?t.title():t.title:o.default.createElement(o.default.Fragment,null,x||t.icon||t.promise?o.default.createElement("div",{"data-icon":"",className:S(n==null?void 0:n.icon,(Pt=t==null?void 0:t.classNames)==null?void 0:Pt.icon)},t.promise||t.type==="loading"&&!t.icon?t.icon||Xt():null,t.type!=="loading"?t.icon||(N==null?void 0:N[x])||At(x):null):null,o.default.createElement("div",{"data-content":"",className:S(n==null?void 0:n.content,(Ct=t==null?void 0:t.classNames)==null?void 0:Ct.content)},o.default.createElement("div",{"data-title":"",className:S(n==null?void 0:n.title,(Bt=t==null?void 0:t.classNames)==null?void 0:Bt.title)},typeof t.title=="function"?t.title():t.title),t.description?o.default.createElement("div",{"data-description":"",className:S(lt,Vt,n==null?void 0:n.description,(It=t==null?void 0:t.classNames)==null?void 0:It.description)},typeof t.description=="function"?t.description():t.description):null),o.default.isValidElement(t.cancel)?t.cancel:t.cancel&&O(t.cancel)?o.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:t.cancelButtonStyle||i,onClick:s=>{var p,g;O(t.cancel)&&F&&((g=(p=t.cancel).onClick)==null||g.call(p,s),z())},className:S(n==null?void 0:n.cancelButton,(kt=t==null?void 0:t.classNames)==null?void 0:kt.cancelButton)},t.cancel.label):null,o.default.isValidElement(t.action)?t.action:t.action&&O(t.action)?o.default.createElement("button",{"data-button":!0,"data-action":!0,style:t.actionButtonStyle||J,onClick:s=>{var p,g;O(t.action)&&((g=(p=t.action).onClick)==null||g.call(p,s),!s.defaultPrevented&&z())},className:S(n==null?void 0:n.actionButton,(Dt=t==null?void 0:t.classNames)==null?void 0:Dt.actionButton)},t.action.label):null))};function Wt(){if(typeof window=="undefined"||typeof document=="undefined")return"ltr";let a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function ve(){let[a,e]=o.default.useState([]);return o.default.useEffect(()=>R.subscribe(t=>{e(r=>{if("dismiss"in t&&t.dismiss)return r.filter(l=>l.id!==t.id);let c=r.findIndex(l=>l.id===t.id);if(c!==-1){let l=[...r];return l[c]={...l[c],...t},l}else return[t,...r]})}),[]),{toasts:a}}var we=(0,o.forwardRef)(function(e,t){let{invert:r,position:c="bottom-right",hotkey:l=["altKey","KeyT"],expand:E,closeButton:P,className:h,offset:u,theme:y="light",richColors:k,duration:j,style:K,visibleToasts:it=fe,toastOptions:i,dir:J=Wt(),gap:X=ge,loadingIcon:lt,icons:_,containerAriaLabel:dt="Notifications",pauseWhenPageIsHidden:ct,cn:G=ye}=e,[C,n]=o.default.useState([]),N=o.default.useMemo(()=>Array.from(new Set([c].concat(C.filter(d=>d.position).map(d=>d.position)))),[C,c]),[Q,q]=o.default.useState([]),[S,B]=o.default.useState(!1),[Z,U]=o.default.useState(!1),[ut,M]=o.default.useState(y!=="system"?y:typeof window!="undefined"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=o.default.useRef(null),tt=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=o.default.useRef(null),Y=o.default.useRef(!1),et=o.default.useCallback(d=>{n(f=>{var b;return(b=f.find(w=>w.id===d.id))!=null&&b.delete||R.dismiss(d.id),f.filter(({id:w})=>w!==d.id)})},[]);return o.default.useEffect(()=>R.subscribe(d=>{if(d.dismiss){n(f=>f.map(b=>b.id===d.id?{...b,delete:!0}:b));return}setTimeout(()=>{_t.default.flushSync(()=>{n(f=>{let b=f.findIndex(w=>w.id===d.id);return b!==-1?[...f.slice(0,b),{...f[b],...d},...f.slice(b+1)]:[d,...f]})})})}),[]),o.default.useEffect(()=>{if(y!=="system"){M(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window=="undefined")return;let d=window.matchMedia("(prefers-color-scheme: dark)");try{d.addEventListener("change",({matches:f})=>{M(f?"dark":"light")})}catch(f){d.addListener(({matches:b})=>{try{M(b?"dark":"light")}catch(w){console.error(w)}})}},[y]),o.default.useEffect(()=>{C.length<=1&&B(!1)},[C]),o.default.useEffect(()=>{let d=f=>{var w,D;l.every(m=>f[m]||f.code===m)&&(B(!0),(w=A.current)==null||w.focus()),f.code==="Escape"&&(document.activeElement===A.current||(D=A.current)!=null&&D.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l]),o.default.useEffect(()=>{if(A.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Y.current=!1)}},[A.current]),o.default.createElement("section",{"aria-label":`${dt} ${tt}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},N.map((d,f)=>{var D;let[b,w]=d.split("-");return C.length?o.default.createElement("ol",{key:d,dir:J==="auto"?Wt():J,tabIndex:-1,ref:A,className:h,"data-sonner-toaster":!0,"data-theme":ut,"data-y-position":b,"data-lifted":S&&C.length>1&&!E,"data-x-position":w,style:{"--front-toast-height":`${((D=Q[0])==null?void 0:D.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||me,"--width":`${pe}px`,"--gap":`${X}px`,...K},onBlur:m=>{Y.current&&!m.currentTarget.contains(m.relatedTarget)&&(Y.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:m=>{m.target instanceof HTMLElement&&m.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,L.current=m.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{Z||B(!1)},onPointerDown:m=>{m.target instanceof HTMLElement&&m.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},C.filter(m=>!m.position&&f===0||m.position===d).map((m,H)=>{var ot,at;return o.default.createElement(xe,{key:m.id,icons:_,index:H,toast:m,defaultRichColors:k,duration:(ot=i==null?void 0:i.duration)!=null?ot:j,className:i==null?void 0:i.className,descriptionClassName:i==null?void 0:i.descriptionClassName,invert:r,visibleToasts:it,closeButton:(at=i==null?void 0:i.closeButton)!=null?at:P,interacting:Z,position:d,style:i==null?void 0:i.style,unstyled:i==null?void 0:i.unstyled,classNames:i==null?void 0:i.classNames,cancelButtonStyle:i==null?void 0:i.cancelButtonStyle,actionButtonStyle:i==null?void 0:i.actionButtonStyle,removeToast:et,toasts:C.filter(x=>x.position==m.position),heights:Q.filter(x=>x.position==m.position),setHeights:q,expandByDefault:E,gap:X,loadingIcon:lt,expanded:S,pauseWhenPageIsHidden:ct,cn:G})})):null}))});0&&(module.exports={Toaster,toast,useSonner});
//# sourceMappingURL=index.js.map
{
"name": "sonner",
"version": "1.7.0",
"version": "1.7.1",
"description": "An opinionated toast component for React.",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./dist/styles.css": "./dist/styles.css"
},

@@ -10,0 +13,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc