!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).MeToast={})}(this,function(e){"use strict";const t=e=>{if("undefined"==typeof document)return String(null==e?"":e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");const t=document.createElement("div");return t.textContent=String(null==e?"":e),t.innerHTML},n={success:'\n \n ',error:'\n \n \n \n ',warning:'\n \n \n \n ',info:'\n \n \n \n ',loading:'\n \n ',close:'\n \n \n ',check:'\n \n ',x:'\n \n \n ',alert:'\n \n \n \n ',question:'\n \n \n \n ',star:'\n \n ',heart:'\n \n ',bell:'\n \n \n ',mail:'\n \n \n ',settings:'\n \n \n ',user:'\n \n \n ',home:'\n \n \n ',search:'\n \n \n ',plus:'\n \n \n ',minus:'\n \n ',edit:'\n \n \n ',trash:'\n \n \n \n \n ',download:'\n \n \n \n ',upload:'\n \n \n \n ',share:'\n \n \n \n \n \n ',link:'\n \n \n ',external:'\n \n \n \n ',clock:'\n \n \n ',calendar:'\n \n \n \n \n ',map:'\n \n \n \n ',compass:'\n \n \n ',globe:'\n \n \n \n ',wifi:'\n \n \n \n \n ',cloud:'\n \n ',sun:'\n \n \n \n \n \n \n \n \n \n ',moon:'\n \n ',zap:'\n \n ',activity:'\n \n ',cpu:'\n \n \n \n \n \n \n \n \n \n \n ',database:'\n \n \n \n ',server:'\n \n \n \n \n ',terminal:'\n \n \n ',code:'\n \n \n ',git:'\n \n \n \n \n ',package:'\n \n \n \n \n ',layers:'\n \n \n \n ',grid:'\n \n \n \n \n ',list:'\n \n \n \n \n \n \n ',filter:'\n \n ',sort:'\n \n \n ',refresh:'\n \n \n \n ',sync:'\n \n \n \n ',power:'\n \n \n ',battery:'\n \n \n ',bluetooth:'\n \n ',volume:'\n \n \n ',mic:'\n \n \n \n \n ',camera:'\n \n \n ',image:'\n \n \n \n ',video:'\n \n \n ',music:'\n \n \n \n ',file:'\n \n \n ',folder:'\n \n ',clipboard:'\n \n \n ',save:'\n \n \n \n ',print:'\n \n \n \n ',eye:'\n \n \n ',eyeOff:'\n \n \n ',lock:'\n \n \n ',unlock:'\n \n \n ',shield:'\n \n ',key:'\n \n ',flag:'\n \n \n ',bookmark:'\n \n ',tag:'\n \n \n ',gift:'\n \n \n \n \n \n ',award:'\n \n \n ',target:'\n \n \n \n ',crosshair:'\n \n \n \n \n \n ',move:'\n \n \n \n \n \n \n ',maximize:'\n \n ',minimize:'\n \n ',copy:'\n \n \n ',cut:'\n \n \n \n \n \n ',paste:'\n \n \n ',rotateCw:'\n \n \n ',rotateCcw:'\n \n \n ',zoomIn:'\n \n \n \n \n ',zoomOut:'\n \n \n \n ',crop:'\n \n \n ',sliders:'\n \n \n \n \n \n \n \n \n \n ',toggleLeft:'\n \n \n ',toggleRight:'\n \n \n ',checkCircle:'\n \n \n ',xCircle:'\n \n \n \n ',alertCircle:'\n \n \n \n ',infoCircle:'\n \n \n \n ',helpCircle:'\n \n \n \n ',alertTriangle:'\n \n \n \n ',checkSquare:'\n \n \n ',square:'\n \n ',circle:'\n \n ',triangle:'\n \n ',hexagon:'\n \n ',octagon:'\n \n ',pentagon:'\n \n ',diamond:'\n \n '},o={"zh-CN":{close:"关闭",loading:"加载中...",success:"操作成功",error:"操作失败",warning:"警告",info:"信息",confirm:"确认",cancel:"取消",yes:"是",no:"否",ok:"确定",retry:"重试",undo:"撤销",redo:"重做",save:"保存",delete:"删除",edit:"编辑",add:"添加",remove:"移除",search:"搜索",filter:"筛选",sort:"排序",refresh:"刷新",sync:"同步",upload:"上传",download:"下载",share:"分享",copy:"复制",cut:"剪切",paste:"粘贴",print:"打印",export:"导出",import:"导入",settings:"设置",help:"帮助",about:"关于",version:"版本",language:"语言",theme:"主题",dark:"暗色",light:"亮色",auto:"自动",notifications:"通知",enable:"启用",disable:"禁用",on:"开启",off:"关闭",max:"最大",min:"最小",expand:"展开",collapse:"折叠",fullscreen:"全屏",exitFullscreen:"退出全屏",zoomIn:"放大",zoomOut:"缩小",reset:"重置",apply:"应用",submit:"提交",send:"发送",receive:"接收",connect:"连接",disconnect:"断开",start:"开始",stop:"停止",pause:"暂停",resume:"继续",next:"下一个",previous:"上一个",first:"第一个",last:"最后一个",back:"返回",forward:"前进",home:"首页",menu:"菜单",more:"更多",less:"更少",show:"显示",hide:"隐藏",visible:"可见",hidden:"隐藏",enabled:"已启用",disabled:"已禁用",active:"活跃",inactive:"非活跃",online:"在线",offline:"离线",connected:"已连接",disconnected:"已断开",loading:"加载中",loaded:"已加载",saving:"保存中",saved:"已保存",deleting:"删除中",deleted:"已删除",uploading:"上传中",uploaded:"已上传",downloading:"下载中",downloaded:"已下载",processing:"处理中",processed:"已处理",syncing:"同步中",synced:"已同步",sending:"发送中",sent:"已发送",receiving:"接收中",received:"已接收",connecting:"连接中",error:"错误",warning:"警告",info:"信息",success:"成功",question:"问题",help:"帮助",feedback:"反馈",report:"报告",bug:"错误",feature:"功能",improvement:"改进",suggestion:"建议",request:"请求",response:"响应",status:"状态",progress:"进度",complete:"完成",incomplete:"未完成",pending:"待处理",processing:"处理中",failed:"失败",cancelled:"已取消",timeout:"超时",expired:"已过期",invalid:"无效",valid:"有效",required:"必填",optional:"可选",enabled:"启用",disabled:"禁用",allowed:"允许",denied:"拒绝",approved:"已批准",rejected:"已拒绝",accepted:"已接受",declined:"已拒绝",confirmed:"已确认",unconfirmed:"未确认",verified:"已验证",unverified:"未验证",authenticated:"已认证",unauthenticated:"未认证",authorized:"已授权",unauthorized:"未授权",public:"公开",private:"私有",protected:"受保护",internal:"内部",external:"外部",local:"本地",remote:"远程",global:"全局",system:"系统",user:"用户",admin:"管理员",moderator:"版主",guest:"访客",member:"成员",owner:"所有者",creator:"创建者",editor:"编辑者",viewer:"查看者",subscriber:"订阅者",follower:"关注者",following:"关注中",friend:"朋友",contact:"联系人",group:"群组",team:"团队",organization:"组织",company:"公司",department:"部门",project:"项目",task:"任务",issue:"问题",ticket:"工单",request:"请求",response:"响应",message:"消息",notification:"通知",alert:"警报",reminder:"提醒",event:"事件",activity:"活动",log:"日志",report:"报告",analytics:"分析",statistics:"统计",metrics:"指标",performance:"性能",security:"安全",privacy:"隐私",compliance:"合规",policy:"政策",terms:"条款",conditions:"条件",agreement:"协议",contract:"合同",license:"许可证",copyright:"版权",trademark:"商标",patent:"专利",tradeSecret:"商业秘密",confidential:"机密",sensitive:"敏感",critical:"关键",important:"重要",urgent:"紧急",high:"高",medium:"中",low:"低",none:"无",all:"全部",any:"任何",some:"一些",each:"每个",every:"每个",both:"两者",neither:"两者都不",either:"任一",other:"其他",another:"另一个",this:"这个",that:"那个",these:"这些",those:"那些",here:"这里",there:"那里",where:"哪里",when:"何时",why:"为什么",how:"如何",what:"什么",who:"谁",which:"哪个",whose:"谁的",whom:"谁",myself:"我自己",yourself:"你自己",himself:"他自己",herself:"她自己",itself:"它自己",ourselves:"我们自己",yourselves:"你们自己",themselves:"他们自己",mine:"我的",yours:"你的",his:"他的",hers:"她的",its:"它的",ours:"我们的",yours:"你们的",theirs:"他们的",me:"我",you:"你",him:"他",her:"她",it:"它",us:"我们",them:"他们",my:"我的",your:"你的",his:"他的",her:"她的",its:"它的",our:"我们的",your:"你们的",their:"他们的",i:"我",you:"你",he:"他",she:"她",it:"它",we:"我们",they:"他们",am:"是",is:"是",are:"是",was:"是",were:"是",be:"是",been:"是",being:"是",have:"有",has:"有",had:"有",having:"有",do:"做",does:"做",did:"做",doing:"做",will:"会",would:"会",shall:"将",should:"应该",may:"可以",might:"可能",can:"能",could:"能",must:"必须",need:"需要",dare:"敢",ought:"应该",used:"过去常常",to:"到",of:"的",in:"在",for:"为了",on:"在",with:"和",at:"在",by:"通过",from:"从",into:"进入",during:"在...期间",before:"在...之前",after:"在...之后",above:"在...上面",below:"在...下面",between:"在...之间",under:"在...下面",over:"在...上面",across:"穿过",through:"通过",into:"进入",towards:"朝向",upon:"在...上面",about:"关于",against:"反对",among:"在...之中",along:"沿着",around:"周围",beyond:"超出",but:"但是",despite:"尽管",except:"除了",inside:"里面",outside:"外面",since:"自从",until:"直到",unless:"除非",whether:"是否",while:"当...时候",although:"虽然",because:"因为",if:"如果",once:"一旦",since:"自从",so:"所以",that:"那个",though:"虽然",till:"直到",unless:"除非",until:"直到",when:"当...时候",whenever:"每当",where:"哪里",wherever:"无论哪里",whereas:"然而",wherever:"无论哪里",while:"当...时候",why:"为什么"},"en-US":{close:"Close",loading:"Loading...",success:"Success",error:"Error",warning:"Warning",info:"Info",confirm:"Confirm",cancel:"Cancel",yes:"Yes",no:"No",ok:"OK",retry:"Retry",undo:"Undo",redo:"Redo",save:"Save",delete:"Delete",edit:"Edit",add:"Add",remove:"Remove",search:"Search",filter:"Filter",sort:"Sort",refresh:"Refresh",sync:"Sync",upload:"Upload",download:"Download",share:"Share",copy:"Copy",cut:"Cut",paste:"Paste",print:"Print",export:"Export",import:"Import",settings:"Settings",help:"Help",about:"About",version:"Version",language:"Language",theme:"Theme",dark:"Dark",light:"Light",auto:"Auto",notifications:"Notifications",enable:"Enable",disable:"Disable",on:"On",off:"Off",max:"Max",min:"Min",expand:"Expand",collapse:"Collapse",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",zoomIn:"Zoom In",zoomOut:"Zoom Out",reset:"Reset",apply:"Apply",submit:"Submit",send:"Send",receive:"Receive",connect:"Connect",disconnect:"Disconnect",start:"Start",stop:"Stop",pause:"Pause",resume:"Resume",next:"Next",previous:"Previous",first:"First",last:"Last",back:"Back",forward:"Forward",home:"Home",menu:"Menu",more:"More",less:"Less",show:"Show",hide:"Hide",visible:"Visible",hidden:"Hidden",enabled:"Enabled",disabled:"Disabled",active:"Active",inactive:"Inactive",online:"Online",offline:"Offline",connected:"Connected",disconnected:"Disconnected",loading:"Loading",loaded:"Loaded",saving:"Saving",saved:"Saved",deleting:"Deleting",deleted:"Deleted",uploading:"Uploading",uploaded:"Uploaded",downloading:"Downloading",downloaded:"Downloaded",processing:"Processing",processed:"Processed",syncing:"Syncing",synced:"Synced",sending:"Sending",sent:"Sent",receiving:"Receiving",received:"Received",connecting:"Connecting",error:"Error",warning:"Warning",info:"Info",success:"Success",question:"Question",help:"Help",feedback:"Feedback",report:"Report",bug:"Bug",feature:"Feature",improvement:"Improvement",suggestion:"Suggestion",request:"Request",response:"Response",status:"Status",progress:"Progress",complete:"Complete",incomplete:"Incomplete",pending:"Pending",processing:"Processing",failed:"Failed",cancelled:"Cancelled",timeout:"Timeout",expired:"Expired",invalid:"Invalid",valid:"Valid",required:"Required",optional:"Optional",enabled:"Enabled",disabled:"Disabled",allowed:"Allowed",denied:"Denied",approved:"Approved",rejected:"Rejected",accepted:"Accepted",declined:"Declined",confirmed:"Confirmed",unconfirmed:"Unconfirmed",verified:"Verified",unverified:"Unverified",authenticated:"Authenticated",unauthenticated:"Unauthenticated",authorized:"Authorized",unauthorized:"Unauthorized",public:"Public",private:"Private",protected:"Protected",internal:"Internal",external:"External",local:"Local",remote:"Remote",global:"Global",system:"System",user:"User",admin:"Admin",moderator:"Moderator",guest:"Guest",member:"Member",owner:"Owner",creator:"Creator",editor:"Editor",viewer:"Viewer",subscriber:"Subscriber",follower:"Follower",following:"Following",friend:"Friend",contact:"Contact",group:"Group",team:"Team",organization:"Organization",company:"Company",department:"Department",project:"Project",task:"Task",issue:"Issue",ticket:"Ticket",request:"Request",response:"Response",message:"Message",notification:"Notification",alert:"Alert",reminder:"Reminder",event:"Event",activity:"Activity",log:"Log",report:"Report",analytics:"Analytics",statistics:"Statistics",metrics:"Metrics",performance:"Performance",security:"Security",privacy:"Privacy",compliance:"Compliance",policy:"Policy",terms:"Terms",conditions:"Conditions",agreement:"Agreement",contract:"Contract",license:"License",copyright:"Copyright",trademark:"Trademark",patent:"Patent",tradeSecret:"Trade Secret",confidential:"Confidential",sensitive:"Sensitive",critical:"Critical",important:"Important",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None",all:"All",any:"Any",some:"Some",each:"Each",every:"Every",both:"Both",neither:"Neither",either:"Either",other:"Other",another:"Another",this:"This",that:"That",these:"These",those:"Those",here:"Here",there:"There",where:"Where",when:"When",why:"Why",how:"How",what:"What",who:"Who",which:"Which",whose:"Whose",whom:"Whom",myself:"Myself",yourself:"Yourself",himself:"Himself",herself:"Herself",itself:"Itself",ourselves:"Ourselves",yourselves:"Yourselves",themselves:"Themselves",mine:"Mine",yours:"Yours",his:"His",hers:"Hers",its:"Its",ours:"Ours",yours:"Yours",theirs:"Theirs",me:"Me",you:"You",him:"Him",her:"Her",it:"It",us:"Us",them:"Them",my:"My",your:"Your",his:"His",her:"Her",its:"Its",our:"Our",your:"Your",their:"Their",i:"I",you:"You",he:"He",she:"She",it:"It",we:"We",they:"They",am:"Am",is:"Is",are:"Are",was:"Was",were:"Were",be:"Be",been:"Been",being:"Being",have:"Have",has:"Has",had:"Had",having:"Having",do:"Do",does:"Does",did:"Did",doing:"Doing",will:"Will",would:"Would",shall:"Shall",should:"Should",may:"May",might:"Might",can:"Can",could:"Could",must:"Must",need:"Need",dare:"Dare",ought:"Ought",used:"Used",to:"To",of:"Of",in:"In",for:"For",on:"On",with:"With",at:"At",by:"By",from:"From",into:"Into",during:"During",before:"Before",after:"After",above:"Above",below:"Below",between:"Between",under:"Under",over:"Over",across:"Across",through:"Through",into:"Into",towards:"Towards",upon:"Upon",about:"About",against:"Against",among:"Among",along:"Along",around:"Around",beyond:"Beyond",but:"But",despite:"Despite",except:"Except",inside:"Inside",outside:"Outside",since:"Since",until:"Until",unless:"Unless",whether:"Whether",while:"While",although:"Although",because:"Because",if:"If",once:"Once",since:"Since",so:"So",that:"That",though:"Though",till:"Till",unless:"Unless",until:"Until",when:"When",whenever:"Whenever",where:"Where",wherever:"Wherever",whereas:"Whereas",wherever:"Wherever",while:"While",why:"Why"}},i=Object.freeze({position:"top-right",duration:4e3,max:6,gap:12,offset:24,pauseOnHover:!0,closeOnClick:!0,draggable:!0,showProgress:!0,progressDirection:"horizontal",icon:!0,closeButton:!0,theme:"auto",animation:"slide",zIndex:9999,width:360,className:"",style:{},onShow:null,onClose:null,onClick:null,onUpdate:null,resetTimerOnUpdate:!1,notifyWhenHidden:!1,locale:"zh-CN",plugins:[]}),r={success:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},error:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},warning:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},info:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},loading:{fg:"#6366f1",bg:"rgba(99, 102, 241, 0.1)"},default:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},check:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},x:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},alert:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},question:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},star:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},heart:{fg:"#ec4899",bg:"rgba(236, 72, 153, 0.1)"},bell:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},mail:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},settings:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},user:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},home:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},search:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},plus:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},minus:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},edit:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},trash:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},download:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},upload:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},share:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},link:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},external:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},clock:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},calendar:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},map:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},compass:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},globe:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},wifi:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},cloud:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},sun:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},moon:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},zap:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},activity:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},cpu:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},database:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},server:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},terminal:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},code:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},git:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},package:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},layers:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},grid:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},list:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},filter:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},sort:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},refresh:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},sync:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},power:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},battery:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},bluetooth:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},volume:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},mic:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},camera:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},image:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},video:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},music:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},file:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},folder:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},clipboard:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},save:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},print:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},eye:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},eyeOff:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},lock:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},unlock:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},shield:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},key:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},flag:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},bookmark:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},tag:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},gift:{fg:"#ec4899",bg:"rgba(236, 72, 153, 0.1)"},award:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},target:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},crosshair:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},move:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},maximize:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},minimize:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},copy:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},cut:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},paste:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},rotateCw:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},rotateCcw:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},zoomIn:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},zoomOut:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},crop:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},sliders:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},toggleLeft:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},toggleRight:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},checkCircle:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},xCircle:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},alertCircle:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},infoCircle:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},helpCircle:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},alertTriangle:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},checkSquare:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},square:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},circle:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},triangle:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},hexagon:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},octagon:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},pentagon:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},diamond:{fg:"#ec4899",bg:"rgba(236, 72, 153, 0.1)"}},s={slide:{enter:{transform:"translateX(80px)",opacity:0},leave:{transform:"translateX(120%)",opacity:0},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},fade:{enter:{opacity:0,filter:"blur(3px)"},leave:{opacity:0,filter:"blur(3px)"},duration:500,easing:"ease"},scale:{enter:{transform:"scale(0.55)",opacity:0},leave:{transform:"scale(0.55)",opacity:0},duration:450,easing:"cubic-bezier(0.34, 1.56, 0.64, 1)"},bounce:{enter:{transform:"translateY(-80px)",opacity:0},leave:{transform:"translateY(20px)",opacity:0},duration:650,easing:"ease"},flip:{enter:{transform:"perspective(500px) rotateX(-90deg)",opacity:0},leave:{transform:"perspective(500px) rotateX(90deg)",opacity:0},duration:500,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},rotate:{enter:{transform:"rotate(-25deg) scale(0.6)",opacity:0},leave:{transform:"rotate(25deg) scale(0.6)",opacity:0},duration:500,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},zoom:{enter:{transform:"scale(0.1)",opacity:0},leave:{transform:"scale(0.1)",opacity:0},duration:500,easing:"cubic-bezier(0.34, 1.56, 0.64, 1)"},slideUp:{enter:{transform:"translateY(60px)",opacity:0},leave:{transform:"translateY(-120%)",opacity:0},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideDown:{enter:{transform:"translateY(-60px)",opacity:0},leave:{transform:"translateY(120%)",opacity:0},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideLeft:{enter:{transform:"translateX(-90px)",opacity:0},leave:{transform:"translateX(120%)",opacity:0},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideRight:{enter:{transform:"translateX(90px)",opacity:0},leave:{transform:"translateX(-120%)",opacity:0},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"}},a={light:{bg:"rgba(255, 255, 255, 0.96)",text:"#1f2937",border:"rgba(0, 0, 0, 0.06)",shadow:"0 10px 36px -10px rgba(0, 0, 0, 0.18), 0 4px 14px -4px rgba(0, 0, 0, 0.08)",hoverShadow:"0 14px 48px -10px rgba(0, 0, 0, 0.22), 0 6px 18px -4px rgba(0, 0, 0, 0.10)",progressBg:"rgba(0, 0, 0, 0.06)",closeHoverBg:"rgba(0, 0, 0, 0.06)"},dark:{bg:"rgba(28, 32, 40, 0.94)",text:"#e6e8eb",border:"rgba(255, 255, 255, 0.08)",shadow:"0 10px 36px -10px rgba(0, 0, 0, 0.6), 0 4px 14px -4px rgba(0, 0, 0, 0.4)",hoverShadow:"0 14px 48px -8px rgba(0, 0, 0, 0.6), 0 6px 18px -4px rgba(0, 0, 0, 0.4)",progressBg:"rgba(255, 255, 255, 0.08)",closeHoverBg:"rgba(255, 255, 255, 0.08)"},auto:"auto",warm:{bg:"rgba(255, 251, 235, 0.96)",text:"#78350f",border:"rgba(245, 158, 11, 0.2)",shadow:"0 10px 36px -10px rgba(245, 158, 11, 0.18), 0 4px 14px -4px rgba(245, 158, 11, 0.08)",hoverShadow:"0 14px 48px -10px rgba(245, 158, 11, 0.22), 0 6px 18px -4px rgba(245, 158, 11, 0.10)",progressBg:"rgba(245, 158, 11, 0.1)",closeHoverBg:"rgba(245, 158, 11, 0.1)"}};let l=null,c="auto",d=new Set,h=null,g=null;const p=()=>"undefined"==typeof window?"light":"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",m=e=>"auto"===e?c&&"auto"!==c?c:p():e,u=e=>{const t=m(e);return a[t]||a.light},f=e=>{c=e;const t=m(e);if("undefined"!=typeof document){document.documentElement.setAttribute("data-met-theme",t),document.documentElement.classList.remove("met-theme-light","met-theme-dark","met-theme-auto"),document.documentElement.classList.add(`met-theme-${t}`);const n=u(e);b(n)}C(e,t)},b=e=>{if("undefined"==typeof document)return;const t=document.documentElement;t.style.setProperty("--met-bg",e.bg),t.style.setProperty("--met-text",e.text),t.style.setProperty("--met-border",e.border),t.style.setProperty("--met-shadow",e.shadow),t.style.setProperty("--met-hover-shadow",e.hoverShadow),t.style.setProperty("--met-progress-bg",e.progressBg),t.style.setProperty("--met-close-hover-bg",e.closeHoverBg),t.style.setProperty("--met-success","#10b981"),t.style.setProperty("--met-error","#ef4444"),t.style.setProperty("--met-warning","#f59e0b"),t.style.setProperty("--met-info","#3b82f6"),t.style.setProperty("--met-loading","#6366f1")},x=()=>m(c),y=e=>{f(e),v(e)},v=e=>{if("undefined"!=typeof localStorage)try{localStorage.setItem("metona-toast-theme",e)}catch(e){}},w=()=>{if("undefined"!=typeof localStorage)try{return localStorage.getItem("metona-toast-theme")||"auto"}catch(e){}return"auto"},k=()=>{"undefined"!=typeof window&&window.matchMedia&&(h&&g&&h.removeEventListener("change",g),h=window.matchMedia("(prefers-color-scheme: dark)"),g=e=>{"auto"===c&&f("auto")},h.addEventListener("change",g))},C=(e,t)=>{d.forEach(n=>{try{n(e,t)}catch(e){}})},T=e=>{const t=u(e);return`\n .met-theme-${m(e)} {\n --met-bg: ${t.bg};\n --met-text: ${t.text};\n --met-border: ${t.border};\n --met-shadow: ${t.shadow};\n --met-hover-shadow: ${t.hoverShadow};\n --met-progress-bg: ${t.progressBg};\n --met-close-hover-bg: ${t.closeHoverBg};\n }\n `},B={getSystemTheme:p,resolveTheme:m,getThemeConfig:u,applyTheme:f,getCurrentTheme:()=>c,getResolvedTheme:x,switchTheme:y,toggleTheme:()=>{const e=x();y("dark"===e?"light":"dark")},resetToAuto:()=>{y("auto")},initTheme:()=>{const e=w();f(e),k()},watchSystemTheme:k,unwatchSystemTheme:()=>{h&&g&&(h.removeEventListener("change",g),h=null,g=null)},addThemeListener:e=>(d.add(e),()=>{d.delete(e)}),removeThemeListener:e=>{d.delete(e)},clearThemeListeners:()=>{d.clear()},registerTheme:(e,t)=>{a[e]={bg:t.bg||a.light.bg,text:t.text||a.light.text,border:t.border||a.light.border,shadow:t.shadow||a.light.shadow,hoverShadow:t.hoverShadow||a.light.hoverShadow,progressBg:t.progressBg||a.light.progressBg,closeHoverBg:t.closeHoverBg||a.light.closeHoverBg}},unregisterTheme:e=>{"light"!==e&&"dark"!==e&&"auto"!==e&&delete a[e]},getAllThemes:()=>({...a}),getThemeNames:()=>Object.keys(a),hasTheme:e=>e in a,getThemePreview:e=>{const t=u(e),n=m(e);return{name:e,resolved:n,colors:{background:t.bg,text:t.text,border:t.border},isDark:"dark"===n,isLight:"light"===n,isAuto:"auto"===e}},generateThemeCSS:T,applyThemeCSS:e=>{if("undefined"==typeof document)return;const t=T(e),n="metona-toast-theme-css",o=document.getElementById(n);o&&o.remove();const i=document.createElement("style");i.id=n,i.textContent=t,document.head.appendChild(i)},removeThemeCSS:()=>{if("undefined"==typeof document)return;const e=document.getElementById("metona-toast-theme-css");e&&e.remove()},saveTheme:v,loadTheme:w},j={light:{name:"浅色",description:"明亮清晰的主题",config:a.light},dark:{name:"深色",description:"护眼舒适的暗色主题",config:a.dark},auto:{name:"自动",description:"跟随系统主题设置",config:"auto"},warm:{name:"暖色",description:"温馨舒适的暖色主题",config:a.warm}};Object.entries(j).forEach(([e,t])=>{"auto"!==e&&"auto"!==t.config&&(a[e]=t.config)});let A="zh-CN",z=new Set,M="zh-CN";const S=()=>A,L=e=>{o[e]||(e=M),A=e,F(e),q(e)},_=(e,t={})=>{const n=E(A,e);if(void 0!==n)return $(n,t);if(A!==M){const n=E(M,e);if(void 0!==n)return $(n,t)}return e},E=(e,t)=>{const n=o[e];if(!n)return;const i=t.split(".");let r=n;for(const e of i){if(!r||"object"!=typeof r||!(e in r))return;r=r[e]}return"string"==typeof r?r:void 0},$=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>void 0!==t[n]?t[n]:e),I=e=>void 0!==E(A,e)||void 0!==E(M,e),P=(e,t)=>{for(const n in t)t[n]instanceof Object&&n in e&&e[n]instanceof Object?P(e[n],t[n]):e[n]=t[n];return e},H=()=>Object.keys(o),D=e=>e in o,Y=e=>({"zh-CN":"简体中文","zh-TW":"繁體中文","en-US":"English (US)","en-GB":"English (UK)",ja:"日本語",ko:"한국어",fr:"Français",de:"Deutsch",es:"Español",pt:"Português",ru:"Русский",ar:"العربية",hi:"हिन्दी",th:"ไทย",vi:"Tiếng Việt",id:"Bahasa Indonesia",ms:"Bahasa Melayu",tr:"Türkçe",it:"Italiano",nl:"Nederlands",pl:"Polski",uk:"Українська",cs:"Čeština",sv:"Svenska",da:"Dansk",fi:"Suomi",nb:"Norsk",el:"Ελληνικά",he:"עברית",hu:"Magyar",ro:"Română",bg:"Български",hr:"Hrvatski",sk:"Slovenčina",sl:"Slovenščina",et:"Eesti",lv:"Latviešu",lt:"Lietuvių",ca:"Català",gl:"Galego",eu:"Euskara",cy:"Cymraeg",ga:"Gaeilge",mt:"Malti",is:"Íslenska",mk:"Македонски",sq:"Shqip",sr:"Српски",bs:"Bosanski",me:"Crnogorski",ka:"ქართული",hy:"Հայերեն",az:"Azərbaycan",uz:"O'zbek",kk:"Қазақ",ky:"Кыргыз",tg:"Тоҷикӣ",tk:"Türkmen",mn:"Монгол",ne:"नेपाली",si:"සිංහල",my:"မြန်မာ",km:"ខ្មែរ",lo:"ລາວ",am:"አማርኛ",sw:"Kiswahili",yo:"Yorùbá",ig:"Igbo",ha:"Hausa",zu:"isiZulu",af:"Afrikaans",xh:"isiXhosa",st:"Sesotho",tn:"Setswana",ts:"Xitsonga",ss:"siSwati",ve:"Tshivenda",nr:"isiNdebele"}[e]||e),N=e=>["ar","he","fa","ur","yi","ps","sd","ug"].includes(e)?"rtl":"ltr",O=e=>({code:e,name:Y(e),direction:N(e),isSupported:D(e),isCurrent:e===A,isFallback:e===M}),q=e=>{if("undefined"!=typeof localStorage)try{localStorage.setItem("metona-toast-locale",e)}catch(e){}},X=()=>{if("undefined"!=typeof localStorage)try{return localStorage.getItem("metona-toast-locale")||U()}catch(e){}return U()},U=()=>{if("undefined"!=typeof navigator){const e=navigator.language||navigator.userLanguage;if(e&&D(e))return e;const t=e?.split("-")[0];if(t&&D(t))return t}return M},F=e=>{z.forEach(t=>{try{t(e)}catch(e){}})},R=(e,t={})=>{try{const n=e instanceof Date?e:new Date(e);return new Intl.DateTimeFormat(A,t).format(n)}catch(t){return e.toString()}},V=(e,t={})=>{try{return new Intl.PluralRules(A,t).select(e)}catch(t){return 1===e?"one":"other"}},W={t:_,plural:(e,t,n={})=>{const o=`${e}.${V(t)}`;return I(o)?_(o,{...n,count:t}):I(e)?_(e,{...n,count:t}):e},getCurrentLocale:S,setCurrentLocale:L,switchLocale:e=>{L(e)},getFallbackLocale:()=>M,setFallbackLocale:e=>{o[e]&&(M=e)},hasTranslation:I,getTranslations:e=>o[e]||{},addTranslations:(e,t)=>{o[e]||(o[e]={}),P(o[e],t)},removeTranslation:(e,t)=>{const n=o[e];if(!n)return;const i=t.split(".");let r=n;for(let e=0;e{o[e]&&(o[e]={})},getSupportedLocales:H,isLocaleSupported:D,getLocaleName:Y,getLocaleDirection:N,getLocaleInfo:O,getAllLocaleInfo:()=>H().map(O),formatNumber:(e,t={})=>{try{return new Intl.NumberFormat(A,t).format(e)}catch(t){return e.toString()}},formatCurrency:(e,t="USD",n={})=>{try{return new Intl.NumberFormat(A,{style:"currency",currency:t,...n}).format(e)}catch(t){return e.toString()}},formatPercent:(e,t={})=>{try{return new Intl.NumberFormat(A,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2,...t}).format(e/100)}catch(t){return`${e}%`}},formatDate:R,formatTime:(e,t={})=>R(e,{hour:"numeric",minute:"numeric",second:"numeric",...t}),formatRelativeTime:(e,t={})=>{try{const n=(e instanceof Date?e:new Date(e))-new Date,o=new Intl.RelativeTimeFormat(A,{numeric:"auto",...t}),i=[{unit:"year",ms:31536e6},{unit:"month",ms:2592e6},{unit:"week",ms:6048e5},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}];for(const{unit:e,ms:t}of i)if(Math.abs(n)>=t||"second"===e){const i=Math.round(n/t);return o.format(i,e)}return e.toString()}catch(t){return e.toString()}},formatList:(e,t={})=>{try{return new Intl.ListFormat(A,t).format(e)}catch(t){return e.join(", ")}},formatPlural:V,addLocaleListener:e=>(z.add(e),()=>{z.delete(e)}),removeLocaleListener:e=>{z.delete(e)},clearLocaleListeners:()=>{z.clear()},initI18n:()=>{const e=X();L(e)},saveLocale:q,loadLocale:X,getDefaultLocale:U};o["zh-CN"],o["en-US"];const G=new Map,K=(e,t="default")=>{const[n,o]=e;return"string"==typeof n?{...o,type:o?.type||t,message:n}:n&&"object"==typeof n?{...n,type:n.type||t}:{type:t,message:""}};class Z{static _hooks=new Map;static on(e,t){return this._hooks.has(e)||this._hooks.set(e,[]),this._hooks.get(e).push(t),()=>this.off(e,t)}static off(e,t){const n=this._hooks.get(e);n&&this._hooks.set(e,n.filter(e=>e!==t))}static trigger(e,t){const n=this._hooks.get(e);n&&n.forEach(e=>{try{e(t)}catch(e){}})}constructor(e){this.id=e.id||"met-"+Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,8),this.type=e.type||"default",this.title=e.title||"",this.message=e.message??e.content??"",this.html=e.html||"",this.iconHTML=e.iconHTML||"",this.config={...i,...e},e.style&&"object"==typeof e.style&&(this.config.style={...e.style}),this.el=null,this.barEl=null,this.rafId=null,this.remaining=this.config.duration,this.startedAt=0,this.paused=!1,this.closing=!1,this._cleanups=[],this.group=e.group||null}_palette(){const e=(e=>m(e))(this.config.theme),t=r[this.type]||r.default,n=a[e]||a.light;return{theme:e,c:t,t:{bg:n.bg,border:n.border,shadow:n.shadow}}}create(){if("undefined"==typeof window||"undefined"==typeof document)return this;Z.trigger("beforeShow",this),((e=a.light)=>{if("undefined"==typeof document)return;if(l&&document.getElementById("metona-toast-styles"))return;const t=(e=>`\n /* MetonaToast 基础样式 */\n .met-container {\n pointer-events: none;\n display: flex;\n flex-direction: column;\n gap: 12px;\n box-sizing: border-box;\n padding: 24px;\n max-width: 100vw;\n position: fixed;\n z-index: 9999;\n }\n \n /* 位置样式 — 顶部位置用 column-reverse,新 toast 出现在最上方 */\n .met-container.top-left {\n top: 0;\n left: 0;\n align-items: flex-start;\n flex-direction: column-reverse;\n }\n \n .met-container.top-center {\n top: 0;\n left: 0;\n right: 0;\n align-items: center;\n flex-direction: column-reverse;\n }\n \n .met-container.top-right {\n top: 0;\n right: 0;\n align-items: flex-end;\n flex-direction: column-reverse;\n }\n \n .met-container.bottom-left {\n bottom: 0;\n left: 0;\n align-items: flex-start;\n flex-direction: column-reverse;\n }\n \n .met-container.bottom-center {\n bottom: 0;\n left: 0;\n right: 0;\n align-items: center;\n flex-direction: column-reverse;\n }\n \n .met-container.bottom-right {\n bottom: 0;\n right: 0;\n align-items: flex-end;\n flex-direction: column-reverse;\n }\n \n /* Toast基础样式 */\n .met-toast {\n position: relative;\n display: flex;\n align-items: flex-start;\n gap: 12px;\n padding: 14px 16px;\n border-radius: 12px;\n box-sizing: border-box;\n backdrop-filter: blur(14px) saturate(180%);\n -webkit-backdrop-filter: blur(14px) saturate(180%);\n font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;\n user-select: none;\n -webkit-user-select: none;\n transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), \n box-shadow 0.25s ease, \n opacity 0.25s ease;\n will-change: transform, opacity;\n flex-shrink: 0;\n pointer-events: auto;\n min-width: 240px;\n max-width: calc(100vw - 48px);\n width: 360px;\n border: 1px solid var(--met-border, rgba(0,0,0,0.06));\n background: var(--met-bg, rgba(255,255,255,0.96));\n color: var(--met-text, #1f2937);\n box-shadow: var(--met-shadow, 0 10px 36px -10px rgba(0,0,0,0.18), 0 4px 14px -4px rgba(0,0,0,0.08));\n }\n \n /* 悬停效果 */\n .met-toast:hover {\n box-shadow: var(--met-hover-shadow, 0 14px 48px -10px rgba(0,0,0,0.22), 0 6px 18px -4px rgba(0,0,0,0.10)) !important;\n }\n \n /* 可点击状态 */\n .met-toast.met-clickable {\n cursor: pointer;\n }\n \n /* 图标样式 */\n .met-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n margin-top: 1px;\n }\n \n /* 内容样式 */\n .met-content {\n flex: 1;\n min-width: 0;\n word-wrap: break-word;\n overflow-wrap: break-word;\n }\n \n /* 标题样式 */\n .met-title {\n font-weight: 600;\n font-size: 14px;\n letter-spacing: 0.1px;\n }\n \n /* 消息样式 */\n .met-message {\n font-size: 13px;\n opacity: 0.85;\n margin-top: 2px;\n }\n \n /* 关闭按钮样式 */\n .met-close {\n flex-shrink: 0;\n background: transparent;\n border: 0;\n padding: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n transition: background 0.2s, color 0.2s;\n line-height: 0;\n color: inherit;\n opacity: 0.5;\n }\n \n .met-close:hover {\n opacity: 1;\n background: var(--met-close-hover-bg, rgba(0,0,0,0.06));\n }\n \n /* 进度条样式 - 水平 */\n .met-progress {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 3px;\n overflow: hidden;\n background: var(--met-progress-bg, rgba(0,0,0,0.06));\n border-radius: 0 0 12px 12px;\n }\n \n /* 进度条样式 - 垂直 */\n .met-progress-v {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 3px;\n overflow: hidden;\n background: var(--met-progress-bg, rgba(0,0,0,0.06));\n border-radius: 12px 0 0 12px;\n }\n \n /* 进度条指示器 - 水平 */\n .met-bar {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n width: 100%;\n transform-origin: left;\n transform: scaleX(1);\n }\n \n /* 进度条指示器 - 垂直 */\n .met-bar-v {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n transform-origin: bottom;\n transform: scaleY(1);\n }\n \n /* 侧边指示器 */\n .met-side {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 4px;\n border-radius: 12px 0 0 12px;\n }\n \n /* 加载动画 */\n .met-spin {\n animation: met-rot 1s linear infinite;\n transform-origin: 50% 50%;\n }\n \n /* 离开状态 */\n .met-toast.met-leaving {\n pointer-events: none;\n z-index: 1;\n }\n \n /* 动画关键帧 */\n @keyframes met-rot {\n to {\n transform: rotate(360deg);\n }\n }\n \n /* === 进入动画:初始隐藏态 === */\n .met-anim-slide.met-toast,\n .met-anim-fade.met-toast,\n .met-anim-scale.met-toast,\n .met-anim-bounce.met-toast,\n .met-anim-flip.met-toast,\n .met-anim-rotate.met-toast,\n .met-anim-zoom.met-toast,\n .met-anim-slideUp.met-toast,\n .met-anim-slideDown.met-toast,\n .met-anim-slideLeft.met-toast,\n .met-anim-slideRight.met-toast {\n opacity: 0;\n }\n \n /* === 进入动画:@keyframes 定义 === */\n @keyframes met-slide-in {\n 0% { transform: translateX(80px); opacity: 0; }\n 65% { transform: translateX(-6px); opacity: 1; }\n 100% { transform: translateX(0); opacity: 1; }\n }\n @keyframes met-fade-in {\n 0% { opacity: 0; filter: blur(3px); }\n 100% { opacity: 1; filter: blur(0); }\n }\n @keyframes met-scale-in {\n 0% { transform: scale(0.55); opacity: 0; }\n 65% { transform: scale(1.07); opacity: 1; }\n 100% { transform: scale(1); opacity: 1; }\n }\n @keyframes met-bounce-in {\n 0% { transform: translateY(-80px); opacity: 0; animation-timing-function: ease-in; }\n 45% { transform: translateY(14px); opacity: 1; animation-timing-function: ease-out; }\n 65% { transform: translateY(-12px); animation-timing-function: ease-in; }\n 82% { transform: translateY(4px); animation-timing-function: ease-out; }\n 100% { transform: translateY(0); opacity: 1; }\n }\n @keyframes met-flip-in {\n 0% { transform: perspective(500px) rotateX(-90deg); opacity: 0; }\n 60% { transform: perspective(500px) rotateX(8deg); opacity: 1; }\n 85% { transform: perspective(500px) rotateX(-2deg); }\n 100% { transform: perspective(500px) rotateX(0); opacity: 1; }\n }\n @keyframes met-rotate-in {\n 0% { transform: rotate(-25deg) scale(0.6); opacity: 0; }\n 60% { transform: rotate(4deg) scale(1.05); opacity: 1; }\n 85% { transform: rotate(-1deg) scale(0.98); }\n 100% { transform: rotate(0) scale(1); opacity: 1; }\n }\n @keyframes met-zoom-in {\n 0% { transform: scale(0.1); opacity: 0; }\n 50% { transform: scale(1.12); opacity: 1; }\n 75% { transform: scale(0.94); }\n 100% { transform: scale(1); opacity: 1; }\n }\n @keyframes met-slideUp-in {\n 0% { transform: translateY(60px); opacity: 0; }\n 70% { transform: translateY(-6px); opacity: 1; }\n 100% { transform: translateY(0); opacity: 1; }\n }\n @keyframes met-slideDown-in {\n 0% { transform: translateY(-60px); opacity: 0; }\n 70% { transform: translateY(6px); opacity: 1; }\n 100% { transform: translateY(0); opacity: 1; }\n }\n @keyframes met-slideLeft-in {\n 0% { transform: translateX(-90px); opacity: 0; }\n 65% { transform: translateX(6px); opacity: 1; }\n 100% { transform: translateX(0); opacity: 1; }\n }\n @keyframes met-slideRight-in {\n 0% { transform: translateX(90px); opacity: 0; }\n 65% { transform: translateX(-6px); opacity: 1; }\n 100% { transform: translateX(0); opacity: 1; }\n }\n \n /* === 进入动画:绑定到 .met-show === */\n .met-anim-slide.met-toast.met-show { animation: met-slide-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-fade.met-toast.met-show { animation: met-fade-in 0.50s ease forwards; }\n .met-anim-scale.met-toast.met-show { animation: met-scale-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }\n .met-anim-bounce.met-toast.met-show { animation: met-bounce-in 0.65s ease forwards; }\n .met-anim-flip.met-toast.met-show { animation: met-flip-in 0.50s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-rotate.met-toast.met-show { animation: met-rotate-in 0.50s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-zoom.met-toast.met-show { animation: met-zoom-in 0.50s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }\n .met-anim-slideUp.met-toast.met-show { animation: met-slideUp-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-slideDown.met-toast.met-show { animation: met-slideDown-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-slideLeft.met-toast.met-show { animation: met-slideLeft-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-slideRight.met-toast.met-show { animation: met-slideRight-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n \n /* 响应式设计 */\n @media (prefers-reduced-motion: reduce) {\n .met-toast {\n transition: opacity 0.15s !important;\n }\n \n .met-toast.met-show {\n animation: none !important;\n opacity: 1 !important;\n }\n \n .met-spin {\n animation-duration: 2.5s !important;\n }\n }\n \n @media (max-width: 480px) {\n .met-container {\n padding: 12px !important;\n }\n \n .met-toast {\n width: 100% !important;\n min-width: 0 !important;\n }\n }\n \n /* 暗色主题特定样式 */\n .met-toast.met-theme-dark {\n background: rgba(28, 32, 40, 0.94);\n color: #e6e8eb;\n border-color: rgba(255, 255, 255, 0.08);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.6), \n 0 4px 14px -4px rgba(0, 0, 0, 0.4);\n }\n \n .met-toast.met-theme-dark:hover {\n box-shadow: 0 14px 48px -8px rgba(0, 0, 0, 0.6), \n 0 6px 18px -4px rgba(0, 0, 0, 0.4) !important;\n }\n \n .met-toast.met-theme-dark .met-close:hover {\n background: rgba(255, 255, 255, 0.08);\n }\n \n .met-toast.met-theme-dark .met-progress,\n .met-toast.met-theme-dark .met-progress-v {\n background: rgba(255, 255, 255, 0.08);\n }\n \n /* 亮色主题特定样式 */\n .met-toast.met-theme-light {\n background: rgba(255, 255, 255, 0.96);\n color: #1f2937;\n border-color: rgba(0, 0, 0, 0.06);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.18), \n 0 4px 14px -4px rgba(0, 0, 0, 0.08);\n }\n \n .met-toast.met-theme-light:hover {\n box-shadow: 0 14px 48px -10px rgba(0, 0, 0, 0.22), \n 0 6px 18px -4px rgba(0, 0, 0, 0.10) !important;\n }\n \n .met-toast.met-theme-light .met-close:hover {\n background: rgba(0, 0, 0, 0.06);\n }\n \n .met-toast.met-theme-light .met-progress,\n .met-toast.met-theme-light .met-progress-v {\n background: rgba(0, 0, 0, 0.06);\n }\n \n /* 自定义主题支持 */\n .met-toast[data-theme] {\n --met-bg: var(--met-theme-bg);\n --met-text: var(--met-theme-text);\n --met-border: var(--met-theme-border);\n --met-shadow: var(--met-theme-shadow);\n }\n \n /* 动画性能优化 */\n .met-toast {\n backface-visibility: hidden;\n -webkit-backface-visibility: hidden;\n perspective: 1000;\n }\n \n /* 滚动条样式 */\n .met-container::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n \n .met-container::-webkit-scrollbar-track {\n background: transparent;\n }\n \n .met-container::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 3px;\n }\n \n .met-container::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.3);\n }\n \n /* 打印样式 */\n @media print {\n .met-container {\n display: none !important;\n }\n .met-toast {\n display: none !important;\n }\n }\n \n /* 高对比度模式 */\n @media (forced-colors: active) {\n .met-toast {\n border: 2px solid ButtonText;\n }\n \n .met-close {\n border: 1px solid ButtonText;\n }\n }\n \n /* 焦点样式 */\n .met-toast:focus-visible {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n }\n \n .met-close:focus-visible {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n }\n \n /* 禁用状态 */\n .met-toast:disabled,\n .met-toast[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n /* 加载状态 */\n .met-toast.met-loading {\n cursor: wait;\n }\n \n /* 成功状态 */\n .met-toast.met-success {\n border-left: 4px solid #10b981;\n }\n \n /* 错误状态 */\n .met-toast.met-error {\n border-left: 4px solid #ef4444;\n }\n \n /* 警告状态 */\n .met-toast.met-warning {\n border-left: 4px solid #f59e0b;\n }\n \n /* 信息状态 */\n .met-toast.met-info {\n border-left: 4px solid #3b82f6;\n }\n \n /* 加载状态 */\n .met-toast.met-loading {\n border-left: 4px solid #6366f1;\n }\n \n /* 进度条动画 */\n .met-bar,\n .met-bar-v {\n transition: transform 0.1s linear;\n }\n \n /* 容器动画 */\n .met-container {\n transition: all 0.3s ease;\n }\n \n /* Toast进入动画 */\n .met-toast.met-enter {\n animation: met-enter 0.3s ease forwards;\n }\n \n /* Toast离开动画 */\n .met-toast.met-leave {\n animation: met-leave 0.3s ease forwards;\n }\n \n @keyframes met-enter {\n from {\n opacity: 0;\n transform: translateY(-20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes met-leave {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(-20px);\n }\n }\n \n /* 响应式字体大小 */\n @media (max-width: 768px) {\n .met-toast {\n font-size: 13px;\n }\n \n .met-title {\n font-size: 13px;\n }\n \n .met-message {\n font-size: 12px;\n }\n }\n \n @media (max-width: 480px) {\n .met-toast {\n font-size: 12px;\n padding: 12px 14px;\n }\n \n .met-title {\n font-size: 12px;\n }\n \n .met-message {\n font-size: 11px;\n }\n }\n \n /* 无障碍支持 */\n .met-toast[role="alert"] {\n /* 警告类型Toast的特殊样式 */\n }\n \n .met-toast[role="status"] {\n /* 状态类型Toast的特殊样式 */\n }\n \n /* 高对比度模式增强 */\n @media (prefers-contrast: high) {\n .met-toast {\n border-width: 2px;\n }\n \n .met-close {\n border: 1px solid currentColor;\n }\n }\n \n /* 暗色模式自动检测 */\n @media (prefers-color-scheme: dark) {\n .met-theme-auto .met-toast {\n background: rgba(28, 32, 40, 0.94);\n color: #e6e8eb;\n border-color: rgba(255, 255, 255, 0.08);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.6), \n 0 4px 14px -4px rgba(0, 0, 0, 0.4);\n }\n \n .met-theme-auto .met-toast:hover {\n box-shadow: 0 14px 48px -8px rgba(0, 0, 0, 0.6), \n 0 6px 18px -4px rgba(0, 0, 0, 0.4) !important;\n }\n \n .met-theme-auto .met-close:hover {\n background: rgba(255, 255, 255, 0.08);\n }\n \n .met-theme-auto .met-progress,\n .met-theme-auto .met-progress-v {\n background: rgba(255, 255, 255, 0.08);\n }\n }\n \n /* 亮色模式自动检测 */\n @media (prefers-color-scheme: light) {\n .met-theme-auto .met-toast {\n background: rgba(255, 255, 255, 0.96);\n color: #1f2937;\n border-color: rgba(0, 0, 0, 0.06);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.18), \n 0 4px 14px -4px rgba(0, 0, 0, 0.08);\n }\n \n .met-theme-auto .met-toast:hover {\n box-shadow: 0 14px 48px -10px rgba(0, 0, 0, 0.22), \n 0 6px 18px -4px rgba(0, 0, 0, 0.10) !important;\n }\n \n .met-theme-auto .met-close:hover {\n background: rgba(0, 0, 0, 0.06);\n }\n \n .met-theme-auto .met-progress,\n .met-theme-auto .met-progress-v {\n background: rgba(0, 0, 0, 0.06);\n }\n }\n \n /* 动画性能优化 */\n .met-toast {\n transform: translateZ(0);\n -webkit-transform: translateZ(0);\n }\n \n /* 触摸设备优化 */\n @media (hover: none) {\n .met-toast:hover {\n box-shadow: inherit;\n }\n }\n \n /* 滚动时固定位置 */\n .met-container {\n position: fixed;\n z-index: 9999;\n }\n \n /* 全屏模式 */\n :fullscreen .met-container {\n z-index: 2147483647;\n }\n \n /* 画中画模式 */\n :picture-in-picture .met-container {\n z-index: 2147483647;\n }\n \n /* 安全区域适配 */\n @supports (padding: max(0px)) {\n .met-container {\n padding: max(24px, env(safe-area-inset-top)) \n max(24px, env(safe-area-inset-right)) \n max(24px, env(safe-area-inset-bottom)) \n max(24px, env(safe-area-inset-left));\n }\n }\n \n /* 暗色模式安全区域 */\n @media (prefers-color-scheme: dark) {\n @supports (padding: max(0px)) {\n .met-container {\n padding: max(24px, env(safe-area-inset-top)) \n max(24px, env(safe-area-inset-right)) \n max(24px, env(safe-area-inset-bottom)) \n max(24px, env(safe-area-inset-left));\n }\n }\n }\n \n /* 高分辨率屏幕优化 */\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n .met-toast {\n border-width: 0.5px;\n }\n }\n \n /* 触摸设备优化 */\n @media (hover: none) and (pointer: coarse) {\n .met-toast {\n min-height: 48px;\n }\n \n .met-close {\n min-width: 48px;\n min-height: 48px;\n }\n }\n \n /* 键盘导航优化 */\n .met-toast:focus {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n }\n \n .met-toast:focus:not(:focus-visible) {\n outline: none;\n }\n \n .met-toast:focus-visible {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n }\n \n /* 减少动画模式 */\n @media (prefers-reduced-motion: reduce) {\n .met-toast {\n transition: opacity 0.15s ease !important;\n animation: none !important;\n }\n \n .met-bar,\n .met-bar-v {\n transition: none !important;\n }\n \n .met-container {\n transition: none !important;\n }\n }\n \n /* 高对比度模式 */\n @media (prefers-contrast: high) {\n .met-toast {\n border-width: 3px;\n border-style: solid;\n }\n \n .met-close {\n border: 2px solid currentColor;\n border-radius: 4px;\n }\n \n .met-progress,\n .met-progress-v {\n height: 4px;\n }\n \n .met-bar,\n .met-bar-v {\n height: 100%;\n }\n }\n \n /* 低分辨率屏幕优化 */\n @media (max-resolution: 1dppx) {\n .met-toast {\n border-width: 1px;\n }\n }\n \n /* 触摸设备优化 */\n @media (hover: none) and (pointer: coarse) {\n .met-toast {\n min-height: 52px;\n padding: 16px 18px;\n }\n \n .met-close {\n min-width: 52px;\n min-height: 52px;\n padding: 8px;\n }\n \n .met-icon {\n width: 28px;\n height: 28px;\n }\n }\n \n /* 大屏幕优化 */\n @media (min-width: 1200px) {\n .met-toast {\n width: 400px;\n }\n }\n \n /* 超大屏幕优化 */\n @media (min-width: 1920px) {\n .met-toast {\n width: 440px;\n }\n }\n \n /* 小屏幕优化 */\n @media (max-width: 320px) {\n .met-toast {\n width: 100%;\n min-width: 0;\n padding: 12px 14px;\n }\n \n .met-container {\n padding: 8px;\n }\n }\n \n /* 横屏优化 */\n @media (orientation: landscape) and (max-height: 500px) {\n .met-container {\n padding: 12px 24px;\n }\n \n .met-toast {\n min-height: 44px;\n padding: 10px 14px;\n }\n }\n \n /* 竖屏优化 */\n @media (orientation: portrait) and (max-width: 500px) {\n .met-container {\n padding: 12px;\n }\n \n .met-toast {\n width: 100%;\n min-width: 0;\n }\n }\n \n /* 无障碍支持 */\n .met-toast[aria-live="assertive"] {\n /* 紧急通知样式 */\n }\n \n .met-toast[aria-live="polite"] {\n /* 普通通知样式 */\n }\n \n /* 焦点陷阱 */\n .met-toast:focus-within {\n /* 包含焦点元素的Toast样式 */\n }\n \n /* 加载状态 */\n .met-toast[aria-busy="true"] {\n cursor: wait;\n }\n \n /* 禁用状态 */\n .met-toast[aria-disabled="true"] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* 隐藏状态 */\n .met-toast[aria-hidden="true"] {\n display: none;\n }\n \n /* 展开状态 */\n .met-toast[aria-expanded="true"] {\n /* 展开状态样式 */\n }\n \n /* 选中状态 */\n .met-toast[aria-selected="true"] {\n /* 选中状态样式 */\n }\n \n /* 按下状态 */\n .met-toast:active {\n transform: scale(0.98);\n }\n \n /* 加载状态动画 */\n .met-toast.met-loading::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(255, 255, 255, 0.1),\n transparent\n );\n animation: met-loading 1.5s infinite;\n }\n \n @keyframes met-loading {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(100%);\n }\n }\n \n /* 成功状态动画 */\n .met-toast.met-success::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 4px;\n height: 100%;\n background: #10b981;\n border-radius: 12px 0 0 12px;\n animation: met-success 0.3s ease;\n }\n \n @keyframes met-success {\n from {\n transform: scaleY(0);\n }\n to {\n transform: scaleY(1);\n }\n }\n \n /* 错误状态动画 */\n .met-toast.met-error::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 4px;\n height: 100%;\n background: #ef4444;\n border-radius: 12px 0 0 12px;\n animation: met-error 0.3s ease;\n }\n \n @keyframes met-error {\n from {\n transform: scaleY(0);\n }\n to {\n transform: scaleY(1);\n }\n }\n \n /* 警告状态动画 */\n .met-toast.met-warning::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 4px;\n height: 100%;\n background: #f59e0b;\n border-radius: 12px 0 0 12px;\n animation: met-warning 0.3s ease;\n }\n \n @keyframes met-warning {\n from {\n transform: scaleY(0);\n }\n to {\n transform: scaleY(1);\n }\n }\n \n /* 信息状态动画 */\n .met-toast.met-info::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 4px;\n height: 100%;\n background: #3b82f6;\n border-radius: 12px 0 0 12px;\n animation: met-info 0.3s ease;\n }\n \n @keyframes met-info {\n from {\n transform: scaleY(0);\n }\n to {\n transform: scaleY(1);\n }\n }\n \n /* 加载状态动画 */\n .met-toast.met-loading::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 4px;\n height: 100%;\n background: #6366f1;\n border-radius: 12px 0 0 12px;\n animation: met-loading-bar 1s infinite;\n }\n \n @keyframes met-loading-bar {\n 0% {\n transform: scaleY(0);\n transform-origin: top;\n }\n 50% {\n transform: scaleY(1);\n transform-origin: top;\n }\n 51% {\n transform-origin: bottom;\n }\n 100% {\n transform: scaleY(0);\n transform-origin: bottom;\n }\n }\n \n /* 进度条脉冲动画 */\n .met-bar,\n .met-bar-v {\n animation: met-pulse 2s infinite;\n }\n \n @keyframes met-pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n }\n \n /* Toast堆叠效果 */\n .met-toast + .met-toast {\n margin-top: 8px;\n }\n \n /* Toast分组 */\n .met-toast-group {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n \n /* Toast头部 */\n .met-toast-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 8px;\n }\n \n /* Toast底部 */\n .met-toast-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 12px;\n }\n \n /* Toast操作按钮 */\n .met-toast-action {\n background: transparent;\n border: 1px solid currentColor;\n padding: 6px 12px;\n border-radius: 6px;\n cursor: pointer;\n font-size: 12px;\n opacity: 0.7;\n transition: opacity 0.2s;\n }\n \n .met-toast-action:hover {\n opacity: 1;\n }\n \n /* Toast进度文本 */\n .met-toast-progress-text {\n font-size: 12px;\n opacity: 0.7;\n margin-left: 8px;\n }\n \n /* Toast时间戳 */\n .met-toast-timestamp {\n font-size: 11px;\n opacity: 0.5;\n margin-left: auto;\n }\n \n /* Toast头像 */\n .met-toast-avatar {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n object-fit: cover;\n flex-shrink: 0;\n }\n \n /* Toast图片 */\n .met-toast-image {\n max-width: 100%;\n max-height: 200px;\n border-radius: 8px;\n margin-top: 8px;\n object-fit: cover;\n }\n \n /* Toast视频 */\n .met-toast-video {\n max-width: 100%;\n max-height: 200px;\n border-radius: 8px;\n margin-top: 8px;\n }\n \n /* Toast音频 */\n .met-toast-audio {\n width: 100%;\n margin-top: 8px;\n }\n \n /* Toast代码块 */\n .met-toast-code {\n background: rgba(0, 0, 0, 0.05);\n padding: 8px 12px;\n border-radius: 6px;\n font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;\n font-size: 12px;\n margin-top: 8px;\n overflow-x: auto;\n }\n \n .met-theme-dark .met-toast-code {\n background: rgba(255, 255, 255, 0.05);\n }\n \n /* Toast引用 */\n .met-toast-quote {\n border-left: 3px solid currentColor;\n padding-left: 12px;\n margin-top: 8px;\n opacity: 0.8;\n }\n \n /* Toast列表 */\n .met-toast-list {\n margin: 8px 0 0 0;\n padding-left: 20px;\n }\n \n .met-toast-list li {\n margin-bottom: 4px;\n }\n \n /* Toast表格 */\n .met-toast-table {\n width: 100%;\n border-collapse: collapse;\n margin-top: 8px;\n font-size: 12px;\n }\n \n .met-toast-table th,\n .met-toast-table td {\n border: 1px solid rgba(0, 0, 0, 0.1);\n padding: 6px 8px;\n text-align: left;\n }\n \n .met-theme-dark .met-toast-table th,\n .met-theme-dark .met-toast-table td {\n border-color: rgba(255, 255, 255, 0.1);\n }\n \n .met-toast-table th {\n background: rgba(0, 0, 0, 0.05);\n font-weight: 600;\n }\n \n .met-theme-dark .met-toast-table th {\n background: rgba(255, 255, 255, 0.05);\n }\n \n /* Toast分割线 */\n .met-toast-divider {\n height: 1px;\n background: rgba(0, 0, 0, 0.1);\n margin: 12px 0;\n }\n \n .met-theme-dark .met-toast-divider {\n background: rgba(255, 255, 255, 0.1);\n }\n \n /* Toast标签 */\n .met-toast-tag {\n display: inline-block;\n background: rgba(0, 0, 0, 0.05);\n padding: 2px 8px;\n border-radius: 4px;\n font-size: 11px;\n margin-right: 4px;\n margin-bottom: 4px;\n }\n \n .met-theme-dark .met-toast-tag {\n background: rgba(255, 255, 255, 0.05);\n }\n \n /* Toast徽章 */\n .met-toast-badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: #3b82f6;\n color: white;\n padding: 2px 8px;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 600;\n min-width: 20px;\n height: 20px;\n }\n \n /* Toast进度环 */\n .met-toast-progress-ring {\n width: 40px;\n height: 40px;\n transform: rotate(-90deg);\n }\n \n .met-toast-progress-ring circle {\n fill: none;\n stroke-width: 3;\n stroke-linecap: round;\n }\n \n .met-toast-progress-ring .met-progress-ring-bg {\n stroke: rgba(0, 0, 0, 0.1);\n }\n \n .met-theme-dark .met-toast-progress-ring .met-progress-ring-bg {\n stroke: rgba(255, 255, 255, 0.1);\n }\n \n .met-toast-progress-ring .met-progress-ring-fill {\n stroke: #3b82f6;\n stroke-dasharray: 100;\n stroke-dashoffset: 100;\n transition: stroke-dashoffset 0.3s ease;\n }\n \n /* Toast滑块 */\n .met-toast-slider {\n width: 100%;\n height: 4px;\n background: rgba(0, 0, 0, 0.1);\n border-radius: 2px;\n margin-top: 8px;\n position: relative;\n }\n \n .met-theme-dark .met-toast-slider {\n background: rgba(255, 255, 255, 0.1);\n }\n \n .met-toast-slider-fill {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n background: #3b82f6;\n border-radius: 2px;\n transition: width 0.3s ease;\n }\n \n /* Toast开关 */\n .met-toast-switch {\n position: relative;\n display: inline-block;\n width: 36px;\n height: 20px;\n margin-top: 8px;\n }\n \n .met-toast-switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n \n .met-toast-switch-slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.1);\n border-radius: 20px;\n transition: 0.3s;\n }\n \n .met-theme-dark .met-toast-switch-slider {\n background: rgba(255, 255, 255, 0.1);\n }\n \n .met-toast-switch-slider:before {\n content: '';\n position: absolute;\n height: 16px;\n width: 16px;\n left: 2px;\n bottom: 2px;\n background: white;\n border-radius: 50%;\n transition: 0.3s;\n }\n \n .met-toast-switch input:checked + .met-toast-switch-slider {\n background: #3b82f6;\n }\n \n .met-toast-switch input:checked + .met-toast-switch-slider:before {\n transform: translateX(16px);\n }\n \n /* Toast复选框 */\n .met-toast-checkbox {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 8px;\n cursor: pointer;\n }\n \n .met-toast-checkbox input {\n width: 16px;\n height: 16px;\n cursor: pointer;\n }\n \n /* Toast单选框 */\n .met-toast-radio {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 8px;\n cursor: pointer;\n }\n \n .met-toast-radio input {\n width: 16px;\n height: 16px;\n cursor: pointer;\n }\n \n /* Toast输入框 */\n .met-toast-input {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n font-size: 13px;\n margin-top: 8px;\n background: transparent;\n color: inherit;\n }\n \n .met-theme-dark .met-toast-input {\n border-color: rgba(255, 255, 255, 0.1);\n }\n \n .met-toast-input:focus {\n outline: none;\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);\n }\n \n /* Toast文本域 */\n .met-toast-textarea {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n font-size: 13px;\n margin-top: 8px;\n background: transparent;\n color: inherit;\n resize: vertical;\n min-height: 80px;\n }\n \n .met-theme-dark .met-toast-textarea {\n border-color: rgba(255, 255, 255, 0.1);\n }\n \n .met-toast-textarea:focus {\n outline: none;\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);\n }\n \n /* Toast选择框 */\n .met-toast-select {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n font-size: 13px;\n margin-top: 8px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n }\n \n .met-theme-dark .met-toast-select {\n border-color: rgba(255, 255, 255, 0.1);\n }\n \n .met-toast-select:focus {\n outline: none;\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);\n }\n \n /* Toast下拉菜单 */\n .met-toast-dropdown {\n position: relative;\n display: inline-block;\n }\n \n .met-toast-dropdown-content {\n display: none;\n position: absolute;\n background: ${e.bg};\n min-width: 160px;\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n z-index: 1;\n padding: 8px 0;\n margin-top: 4px;\n }\n \n .met-theme-dark .met-toast-dropdown-content {\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);\n }\n \n .met-toast-dropdown:hover .met-toast-dropdown-content {\n display: block;\n }\n \n .met-toast-dropdown-item {\n padding: 8px 16px;\n cursor: pointer;\n font-size: 13px;\n }\n \n .met-toast-dropdown-item:hover {\n background: rgba(0, 0, 0, 0.05);\n }\n \n .met-theme-dark .met-toast-dropdown-item:hover {\n background: rgba(255, 255, 255, 0.05);\n }\n \n /* Toast工具提示 */\n .met-toast-tooltip {\n position: relative;\n display: inline-block;\n }\n \n .met-toast-tooltip .met-toast-tooltip-text {\n visibility: hidden;\n width: 120px;\n background: ${e.bg};\n color: ${e.text};\n text-align: center;\n border-radius: 6px;\n padding: 6px 8px;\n position: absolute;\n z-index: 1;\n bottom: 125%;\n left: 50%;\n margin-left: -60px;\n opacity: 0;\n transition: opacity 0.3s;\n font-size: 12px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n }\n \n .met-theme-dark .met-toast-tooltip .met-toast-tooltip-text {\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n }\n \n .met-toast-tooltip:hover .met-toast-tooltip-text {\n visibility: visible;\n opacity: 1;\n }\n \n /* Toast弹出框 */\n .met-toast-popover {\n position: relative;\n display: inline-block;\n }\n \n .met-toast-popover .met-toast-popover-content {\n visibility: hidden;\n background: ${e.bg};\n color: ${e.text};\n border-radius: 8px;\n padding: 12px 16px;\n position: absolute;\n z-index: 1;\n bottom: 125%;\n left: 50%;\n transform: translateX(-50%);\n opacity: 0;\n transition: opacity 0.3s;\n min-width: 200px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);\n }\n \n .met-theme-dark .met-toast-popover .met-toast-popover-content {\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);\n }\n \n .met-toast-popover:hover .met-toast-popover-content {\n visibility: visible;\n opacity: 1;\n }\n \n /* Toast模态框 */\n .met-toast-modal {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n \n .met-toast-modal-content {\n background: ${e.bg};\n color: ${e.text};\n border-radius: 12px;\n padding: 24px;\n max-width: 500px;\n width: 90%;\n max-height: 80vh;\n overflow-y: auto;\n }\n \n /* Toast抽屉 */\n .met-toast-drawer {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n }\n \n .met-toast-drawer-content {\n position: absolute;\n top: 0;\n right: 0;\n width: 300px;\n height: 100%;\n background: ${e.bg};\n color: ${e.text};\n padding: 24px;\n transform: translateX(100%);\n transition: transform 0.3s ease;\n }\n \n .met-toast-drawer.open .met-toast-drawer-content {\n transform: translateX(0);\n }\n \n /* Toast通知栏 */\n .met-toast-notification-bar {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n background: ${e.bg};\n color: ${e.text};\n padding: 12px 24px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n z-index: 9999;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n }\n \n /* Toast状态栏 */\n .met-toast-status-bar {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n background: ${e.bg};\n color: ${e.text};\n padding: 8px 24px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n z-index: 9999;\n font-size: 12px;\n box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);\n }\n `)(e);l=document.createElement("style"),l.id="metona-toast-styles",l.textContent=t.replace(/\s+/g," "),document.head.appendChild(l)})();const e=this._getContainer(),{theme:t,c:n,t:o}=this._palette();this._limitToasts(e);const i=document.createElement("div");if(i.className=this._buildClassName(t),i.setAttribute("role","error"===this.type||"warning"===this.type?"alert":"status"),i.setAttribute("aria-live","error"===this.type?"assertive":"polite"),i.dataset.id=this.id,this._applyStyles(i,t,o),this._buildContent(i,n),this.el=i,(this.config.position||"top-right").startsWith("top")?e.insertBefore(i,e.firstChild):e.appendChild(i),this._bindEvents(i),this._startTimer(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.classList.add("met-show")})}),"function"==typeof this.config.onShow)try{this.config.onShow(this)}catch(e){}return Z.trigger("afterShow",this),this}_getContainer(){const e=this.config.position||"top-right",t=this.config.zIndex||9999;if(G.has(document.body)){const t=G.get(document.body);if(t.has(e))return t.get(e)}else G.set(document.body,new Map);const n=document.createElement("div");return n.className=`met-container ${e}`,n.setAttribute("aria-label","Notifications"),n.setAttribute("role","region"),n.style.cssText=`\n display:flex;\n flex-direction:column;\n gap:${this.config.gap||12}px;\n box-sizing:border-box;\n padding:${this.config.offset||24}px;\n max-width:100vw;\n position:fixed;\n z-index:${t};\n pointer-events:none;\n ${{"top-left":"top:0;left:0;align-items:flex-start","top-center":"top:0;left:0;right:0;align-items:center","top-right":"top:0;right:0;align-items:flex-end","bottom-left":"bottom:0;left:0;align-items:flex-start","bottom-center":"bottom:0;left:0;right:0;align-items:center","bottom-right":"bottom:0;right:0;align-items:flex-end"}[e]||"top:0;right:0;align-items:flex-end"}\n `,document.body.appendChild(n),G.get(document.body).set(e,n),n}_limitToasts(e){const t=this.config.max||6,n=Array.from(e.querySelectorAll(".met-toast"));if(n.length>=t){const e=n[0],t=e&&e.dataset.id;if(t){const e=oe._toasts.get(t);e&&e.close(!0)}}}_buildClassName(e){const t=["slide","fade","scale","bounce","flip","rotate","zoom","slideUp","slideDown","slideLeft","slideRight"].includes(this.config.animation)?this.config.animation:"slide";return["met-toast",`met-${this.type}`,`met-theme-${e}`,`met-anim-${t}`,this.config.closeOnClick||this.config.draggable?"met-clickable":"",this.config.className||""].filter(Boolean).join(" ")}_applyStyles(e,t,n){const o="number"==typeof this.config.width?`${this.config.width}px`:"string"==typeof this.config.width?this.config.width:"360px",i=(t,n)=>e.style.setProperty(t,n,"important");i("position","relative"),i("flex-shrink","0"),i("min-width","240px"),i("max-width","calc(100vw - 48px)"),i("width",o),this.config.style&&Object.keys(this.config.style).length>0&&Object.entries(this.config.style).forEach(([t,n])=>{e.style[t]=n})}_buildContent(e,o){if("function"==typeof this.config.render)return e.innerHTML=this.config.render(this),void(this.barEl=e.querySelector(".met-bar, .met-bar-v"));const i=!1!==this.config.icon&&(this.iconHTML||n[this.type]),r=!1!==this.config.closeButton,s=!1!==this.config.showProgress&&this.config.duration>0,a=!i&&"default"!==this.type,l=this.title?`
${t(this.title)}
`:"",c=this.html?`
${this.html}
`:this.message?`
${t(this.message)}
`:"",d=i?`
${this.iconHTML||n[this.type]}
`:"",h=r?``:"",g=s?"vertical"===this.config.progressDirection?`
`:`
`:"",p=a?`
`:"";e.innerHTML=`\n ${d}\n ${p}\n
\n ${l}\n ${c}\n
\n ${h}\n ${g}\n `,this.barEl=e.querySelector(".met-bar, .met-bar-v")}_bindEvents(e){const t=e=>{const t=e.target;if(t.closest(".met-close"))return e.stopPropagation(),void this.close();if(!this.config.closeOnClick||t.closest(".met-close"));else{if("function"==typeof this.config.onClick)try{this.config.onClick(this)}catch(e){}this.close()}};if(e.addEventListener("click",t),this._cleanups.push(()=>e.removeEventListener("click",t)),this.config.pauseOnHover&&this.config.duration>0){const t=()=>this._pause(),n=()=>this._resume();e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),this._cleanups.push(()=>{e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",n)})}this.config.draggable&&this._bindDrag(e)}_bindDrag(e){let t=0,n=0,o=0,i=0,r=!1;const s=o=>{o.target.closest(".met-close")||(r=!0,t=o.clientX,n=o.clientY,e.setPointerCapture(o.pointerId),e.style.transition="none",this._pause())},a=s=>{r&&(o=s.clientX-t,i=s.clientY-n,e.style.transform=`translate(${o}px, ${i}px) rotate(${.1*o}deg)`,e.style.opacity=String(Math.max(0,1-Math.abs(o)/200)))},l=t=>{r&&(r=!1,e.releasePointerCapture(t.pointerId),e.style.transition="",Math.abs(o)>120?(e.style.transform=`translate(${2*o}px, ${i}px) rotate(${.2*o}deg)`,e.style.opacity="0",setTimeout(()=>this.close(!0),250)):(e.style.transform="",e.style.opacity="",this._resume()),o=i=0)};e.addEventListener("pointerdown",s),e.addEventListener("pointermove",a),e.addEventListener("pointerup",l),e.addEventListener("pointercancel",l),this._cleanups.push(()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("pointermove",a),e.removeEventListener("pointerup",l),e.removeEventListener("pointercancel",l)})}_startTimer(){if(this.config.duration<=0)return;this.startedAt=Date.now(),this.remaining=this.config.duration;const e=()=>{if(this.paused||this.closing)return;const t=Date.now()-this.startedAt;if(this.remaining=Math.max(0,this.config.duration-t),this.barEl){const e=this.remaining/this.config.duration,t="vertical"===this.config.progressDirection?`scaleY(${e})`:`scaleX(${e})`;this.barEl.style.transform=t}this.remaining<=0?this.close():this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}_pause(){this.paused||this.config.duration<=0||(this.paused=!0,cancelAnimationFrame(this.rafId),this.remaining=Math.max(0,this.config.duration-(Date.now()-this.startedAt)))}_resume(){this.paused&&(this.paused=!1,this.startedAt=Date.now()-(this.config.duration-this.remaining),this._startTimer())}update(e){if(Z.trigger("beforeUpdate",this),e.type&&(this.type=e.type),void 0!==e.title&&(this.title=e.title),void 0!==e.message&&(this.message=e.message),void 0!==e.html&&(this.html=e.html),!this.el)return Z.trigger("afterUpdate",this),this;const n=this.el.querySelector(".met-content");if(n){const e=this.title?`
${t(this.title)}
`:"",o=this.html?`
${this.html}
`:this.message?`
${t(this.message)}
`:"";n.innerHTML=`${e}${o}`}if(this.config.resetTimerOnUpdate&&this.config.duration>0&&(cancelAnimationFrame(this.rafId),this.startedAt=Date.now(),this.remaining=this.config.duration,this._startTimer()),"function"==typeof this.config.onUpdate)try{this.config.onUpdate(this)}catch(e){}return Z.trigger("afterUpdate",this),this}close(e=!1){if(this.closing)return;this.closing=!0,Z.trigger("beforeClose",this),cancelAnimationFrame(this.rafId),this._cleanups.forEach(e=>{try{e()}catch(e){}}),this._cleanups=[];const t=this.el;if(!t)return void oe._remove(this.id);const n=t.parentNode;if(n&&!e){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();t.style.position="absolute",t.style.top=e.top-o.top+"px",t.style.left=e.left-o.left+"px",t.style.width=e.width+"px",t.style.margin="0"}t.classList.add("met-leaving"),t.classList.remove("met-show");const o=this.config.position||"top-right",i="rtl"===N(S());let r="scale(.96)";r=o.includes("right")?i?"translateX(-120%)":"translateX(120%)":o.includes("left")?i?"translateX(120%)":"translateX(-120%)":o.startsWith("top")?"translateY(-20px)":"translateY(20px)",t.style.transform=r,t.style.opacity="0",setTimeout(()=>this._destroy(),e?0:300)}_destroy(){if(this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,"function"==typeof this.config.onClose)try{this.config.onClose(this)}catch(e){}Z.trigger("afterClose",this),oe._remove(this.id)}}const J=e=>`\n
\n ${e}\n
`,Q=e=>{const n=e.confirmText||_("confirm"),o=e.cancelText||_("cancel"),i=e.confirmColor||"#10b981",r=e.cancelColor||"#6b7280";return J(`\n \n \n `)},ee=e=>{const n=e.submitText||_("confirm"),o=e.cancelText||_("cancel"),i=e.submitColor||"#3b82f6",r=e.cancelColor||"#6b7280";return`\n \n ${J(`\n \n \n `)}\n `},te=e=>`\n
\n
\n
\n
0%
\n `,ne=e=>{if(!Array.isArray(e)||0===e.length)return"";const n=e.map((e,n)=>``).join("");return J(n)},oe={_toasts:new Map,_config:{...i},version:"2.0.0",configure(e){return e&&"object"==typeof e?(this._config={...this._config,...e},e.theme&&f(e.theme),e.locale&&L(e.locale),this):this},_emit(e){const t={...this._config,...e};t.content&&!t.message&&(t.message=t.content);const n=new Z(t);return n.create(),this._toasts.set(n.id,n),n},_remove(e){this._toasts.delete(e)},find(e){if(e)return this._toasts.get(e)},show(e,t={}){const n=K([e,t],"default");return this._emit(n)},success(e,t={}){const n=K([e,t],"success");return this._emit(n)},error(e,t={}){const n=K([e,t],"error");return this._emit(n)},warning(e,t={}){const n=K([e,t],"warning");return this._emit(n)},info(e,t={}){const n=K([e,t],"info");return this._emit(n)},loading(e,t={}){const n=K([e,t],"loading");n.duration=0,n.closeButton=!1,n.showProgress=!1;const o=this._emit(n);return{id:o.id,success:(e,t={})=>this._resolve(o,"success",e,t),error:(e,t={})=>this._resolve(o,"error",e,t),info:(e,t={})=>this._resolve(o,"info",e,t),warning:(e,t={})=>this._resolve(o,"warning",e,t),update:e=>(o.update(e),this),dismiss:()=>o.close()}},promise(e,t={}){if(!e||"function"!=typeof e.then)return Promise.reject(new Error("Invalid promise"));const n=t.loading||_("loading"),o=t.success||_("success"),i=t.error||_("error"),r=this.loading(n);return Promise.resolve(e).then(e=>(r.success(o),e)).catch(e=>{throw r.error(i),e})},_resolve(e,t,n,o){const i=e.id,r=this._toasts.get(i);if(!r)return null;const s=r.config.position;return r.close(),this._emit({...o,type:t,message:n,position:s})},confirm(e,t={}){return"string"!=typeof e?Promise.resolve(!1):new Promise(n=>{let o=!1;const i=e=>{o||(o=!0,clearTimeout(r),n(e))},r=setTimeout(()=>i(!1),1e4),s=this._emit({...t,type:t.type||"warning",message:e,duration:0,closeButton:!1,closeOnClick:!1,draggable:!1,html:Q(t)});setTimeout(()=>{const e=s.el?.querySelector(".met-confirm-btn"),t=s.el?.querySelector(".met-cancel-btn");e&&e.addEventListener("click",()=>{s.close(),i(!0)}),t&&t.addEventListener("click",()=>{s.close(),i(!1)})},0)})},prompt(e,t={}){return"string"!=typeof e?Promise.resolve(null):new Promise(n=>{let o=!1;const i=e=>{o||(o=!0,clearTimeout(r),n(e))},r=setTimeout(()=>i(null),1e4),s=this._emit({...t,type:t.type||"info",message:e,duration:0,closeButton:!1,closeOnClick:!1,draggable:!1,html:ee(t)});setTimeout(()=>{const e=s.el?.querySelector(".met-input"),t=s.el?.querySelector(".met-submit-btn"),n=s.el?.querySelector(".met-cancel-btn");e&&(e.focus(),e.addEventListener("keydown",t=>{"Enter"===t.key&&(s.close(),i(e.value))})),t&&t.addEventListener("click",()=>{s.close(),i(e?.value||null)}),n&&n.addEventListener("click",()=>{s.close(),i(null)})},0)})},progress(e,t={}){const n=K([e,t],"info");n.duration=0,n.closeButton=!1,n.showProgress=!1;const o=this._emit({...n,html:te(t)});return{id:o.id,setProgress(e){const t=o.el?.querySelector(".met-progress-fill"),n=o.el?.querySelector(".met-progress-text");t&&(t.style.width=`${Math.min(100,Math.max(0,e))}%`),n&&(n.textContent=`${Math.round(e)}%`)},complete(e){this.setProgress(100),setTimeout(()=>{o.update({type:"success",message:e||_("success"),html:""}),setTimeout(()=>o.close(),1e3)},300)},error(e){o.update({type:"error",message:e||_("error"),html:""}),setTimeout(()=>o.close(),2e3)},dismiss(){o.close()}}},countdown(e,t=10,n={}){if("string"!=typeof e)return{cancel:()=>{},pause:()=>{},resume:()=>{}};let o=Math.max(1,parseInt(t)||10),i=null;const r=this._emit({...n,type:n.type||"warning",message:e.replace(/\{seconds\}/g,o),duration:0,closeButton:!0,showProgress:!1}),s=()=>{if(o--,o<=0){if(clearInterval(i),r.close(),"function"==typeof n.onComplete)try{n.onComplete()}catch(e){}}else r.update({message:e.replace(/\{seconds\}/g,o)})};return i=setInterval(s,1e3),{id:r.id,cancel(){clearInterval(i),r.close()},pause(){clearInterval(i)},resume(){clearInterval(i),i=setInterval(s,1e3)}}},action(e,t=[],n={}){const o=K([e,n],"info");o.duration=n.duration??0,o.closeButton=n.closeButton??!0;const i=this._emit({...o,html:(o.html||"")+ne(t)});return Array.isArray(t)&&setTimeout(()=>{t.forEach((e,t)=>{const n=i.el?.querySelector(`.met-action-btn-${t}`);n&&"function"==typeof e.onClick&&n.addEventListener("click",()=>{try{e.onClick(i)}catch(e){}!1!==e.close&&i.close()})})},0),{id:i.id,toast:i,dismiss:()=>i.close()}},queue(e,t={}){if(!Array.isArray(e))return{then:e=>Promise.resolve().then(e),cancel:()=>{}};let n=!1;const o=new Promise(o=>{let i=0;const r=t.delay||1e3,s=t.onClose,a=()=>{if(n||i>=e.length)return void o();const l=e[i];i++;const c="string"==typeof l?l:l?.message||"",d="object"==typeof l&&null!==l?l:{},h=d.onClose;this._emit({...t,...d,message:c,duration:d.duration||t.duration||3e3,onClose:e=>{if("function"==typeof h)try{h(e)}catch(e){}if("function"==typeof s)try{s(e)}catch(e){}setTimeout(a,r)}})};a()});return{then:(e,t)=>o.then(e,t),catch:e=>o.catch(e),cancel:()=>{n=!0}}},stack(e,t={}){Array.isArray(e)&&e.forEach((e,n)=>{setTimeout(()=>{const n="string"==typeof e?e:e?.message||"";this._emit({...t,..."object"==typeof e&&null!==e?e:{},message:n})},n*(t.stagger||100))})},dismiss(e){if(e){const t=this._toasts.get(e);return void(t&&t.close())}this._toasts.forEach(e=>e.close())},clear(e){this._toasts.forEach(t=>{e&&t.config.position!==e||t.close()})},destroy(){if(this.dismiss(),"undefined"!=typeof document){document.querySelectorAll(".met-container").forEach(e=>e.parentNode&&e.parentNode.removeChild(e));const e=document.getElementById("metona-toast-styles");e&&e.parentNode.removeChild(e)}this._toasts.clear(),G.clear()},getAll(){return new Map(this._toasts)},count(){return this._toasts.size},group(e){const t=this,n={_group:e};return["show","success","error","warning","info","loading","action"].forEach(o=>{n[o]=(...n)=>{const i=n[n.length-1],r="object"==typeof i&&null!==i&&!Array.isArray(i);return r&&1===n.length?t[o]({...i,group:e}):r?(n.pop(),t[o](...n,{...i,group:e})):t[o](...n,{group:e})}}),n.dismiss=()=>t.dismissGroup(e),n.count=()=>t._groupCount(e),n},dismissGroup(e){this._toasts.forEach(t=>{t.group===e&&t.close()})},_groupCount(e){let t=0;return this._toasts.forEach(n=>{n.group===e&&t++}),t}},ie=new Map;Object.entries({bounce:{enter:{transform:"translateY(-80px)",opacity:0},leave:{transform:"translateY(20px)",opacity:1},duration:650,easing:"ease"},slideUp:{enter:{transform:"translateY(60px)",opacity:0},leave:{transform:"translateY(0)",opacity:1},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideDown:{enter:{transform:"translateY(-60px)",opacity:0},leave:{transform:"translateY(0)",opacity:1},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideLeft:{enter:{transform:"translateX(-90px)",opacity:0},leave:{transform:"translateX(0)",opacity:1},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideRight:{enter:{transform:"translateX(90px)",opacity:0},leave:{transform:"translateX(0)",opacity:1},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"}}).forEach(([e,t])=>{s[e]=t});const re=new class{constructor(){this.animations=new Map,this.activeAnimations=new Map,this.animationId=0,this._registerDefaults()}_registerDefaults(){Object.entries(s).forEach(([e,t])=>{this.register(e,t)})}register(e,t){const n={name:e,enter:t.enter||{},leave:t.leave||{},duration:t.duration||300,easing:t.easing||"cubic-bezier(0.4, 0, 0.2, 1)",delay:t.delay||0,iterations:t.iterations||1,direction:t.direction||"normal",fillMode:t.fillMode||"forwards"};this.animations.set(e,n),ie.set(e,n)}unregister(e){this.animations.delete(e),ie.delete(e)}get(e){return this.animations.get(e)||s[e]||null}apply(e,t,n={}){return new Promise((o,i)=>{const r=this.get(t);if(!r)return void o();const s={...r,...n},a=++this.animationId;Object.assign(e.style,s.enter),e.offsetHeight;const l=[{...s.enter},{...s.leave}],c={duration:s.duration,easing:s.easing,delay:s.delay,iterations:s.iterations,direction:s.direction,fill:s.fillMode},d=e.animate(l,c);this.activeAnimations.set(a,{element:e,animation:d,config:s}),d.onfinish=()=>{Object.assign(e.style,s.leave),this.activeAnimations.delete(a),o()},d.oncancel=()=>{this.activeAnimations.delete(a),i(new Error(`Animation "${t}" was cancelled`))}})}enter(e,t,n={}){return this.get(t)?this.apply(e,t,{...n,direction:"normal"}):Promise.resolve()}leave(e,t,n={}){return this.get(t)?this.apply(e,t,{...n,direction:"reverse"}):Promise.resolve()}cancelAll(){this.activeAnimations.forEach(({animation:e})=>{e.cancel()}),this.activeAnimations.clear()}cancel(e){this.activeAnimations.forEach(({element:t,animation:n},o)=>{t===e&&(n.cancel(),this.activeAnimations.delete(o))})}pauseAll(){this.activeAnimations.forEach(({animation:e})=>{e.pause()})}resumeAll(){this.activeAnimations.forEach(({animation:e})=>{e.play()})}pause(e){this.activeAnimations.forEach(({element:t,animation:n})=>{t===e&&n.pause()})}resume(e){this.activeAnimations.forEach(({element:t,animation:n})=>{t===e&&n.play()})}getActiveCount(){return this.activeAnimations.size}getActiveAnimations(){return new Map(this.activeAnimations)}hasActiveAnimation(e){for(const{element:t}of this.activeAnimations.values())if(t===e)return!0;return!1}getConfig(){return{animations:Array.from(this.animations.keys()),activeCount:this.getActiveCount()}}reset(){this.cancelAll(),this.animations.clear(),this._registerDefaults()}destroy(){this.cancelAll(),this.animations.clear(),this.activeAnimations.clear()}},se={apply:(e,t,n={})=>re.apply(e,t,n),enter:(e,t,n={})=>re.enter(e,t,n),leave:(e,t,n={})=>re.leave(e,t,n),cancelAll(){re.cancelAll()},cancel(e){re.cancel(e)},pauseAll(){re.pauseAll()},resumeAll(){re.resumeAll()},pause(e){re.pause(e)},resume(e){re.resume(e)},getActiveCount:()=>re.getActiveCount(),hasActiveAnimation:e=>re.hasActiveAnimation(e),register(e,t){re.register(e,t)},unregister(e){re.unregister(e)},get:e=>re.get(e),getAnimationNames:()=>Array.from(re.animations.keys()),getConfig:()=>re.getConfig(),reset(){re.reset()},destroy(){re.destroy()}};class ae{constructor(){this.plugins=new Map,this.initialized=!1}register(e,t){if(this.plugins.has(e))return this;if(!t||"object"!=typeof t||!t.name&&!t.version)return this;if(this.plugins.set(e,{name:e,...t,installed:!1,enabled:!0}),t.install)try{t.install(this),this.plugins.get(e).installed=!0}catch(e){}return this}unregister(e){const t=this.plugins.get(e);if(!t)return this;if(t.uninstall)try{t.uninstall(this)}catch(e){}return this.plugins.delete(e),this}get(e){return this.plugins.get(e)||null}has(e){return this.plugins.has(e)}getAll(){return Array.from(this.plugins.values())}getNames(){return Array.from(this.plugins.keys())}enable(e){const t=this.plugins.get(e);return t&&(t.enabled=!0),this}disable(e){const t=this.plugins.get(e);return t&&(t.enabled=!1),this}isEnabled(e){const t=this.plugins.get(e);return!!t&&t.enabled}destroy(){this.plugins.forEach((e,t)=>{if(e.destroy)try{e.destroy(this)}catch(e){}}),this.plugins.clear()}}const le={keyboard:{name:"keyboard",version:"1.0.0",description:"ESC 关闭所有 Toast",_handler:null,install(){"undefined"!=typeof document&&(this._handler=e=>{"Escape"===e.key&&document.querySelectorAll(".met-toast .met-close").forEach(e=>{try{e.click()}catch(e){}})},document.addEventListener("keydown",this._handler))},uninstall(){this._handler&&"undefined"!=typeof document&&(document.removeEventListener("keydown",this._handler),this._handler=null)}},persistence:{name:"persistence",version:"1.0.0",description:"自动持久化配置到 localStorage",storageKey:"metona-toast-config",install(){if("undefined"!=typeof localStorage)try{const e=localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}catch(e){return null}return null},save(e){if("undefined"!=typeof localStorage)try{localStorage.setItem(this.storageKey,JSON.stringify(e))}catch(e){}},uninstall(){if("undefined"!=typeof localStorage)try{localStorage.removeItem(this.storageKey)}catch(e){}}},accessibility:{name:"accessibility",version:"1.0.0",description:"通过屏幕阅读器朗读 Toast 内容",announce(e){if("undefined"==typeof document)return;const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";const n=_(e.type)||e.type;t.textContent=`${n}: ${e.title||""} ${e.message||""}`,document.body.appendChild(t),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},3e3)}}},ce={createManager:()=>new ae,register:(e,t)=>de.register(e,t),unregister:e=>de.unregister(e),get:e=>de.get(e),has:e=>de.has(e),getAll:()=>de.getAll(),getNames:()=>de.getNames(),enable:e=>de.enable(e),disable:e=>de.disable(e),isEnabled:e=>de.isEnabled(e),getPreset:e=>le[e]||null,getAllPresets:()=>({...le}),createPlugin:e=>({name:e.name||"custom",version:e.version||"1.0.0",description:e.description||"",hooks:e.hooks||{},install:e.install||null,uninstall:e.uninstall||null,...e}),validatePlugin(e){const t=[];return e&&"object"==typeof e||t.push("Plugin must be an object"),e.name||e.version||t.push("Plugin must have a name or version"),{valid:0===t.length,errors:t}}},de=new ae,he="2.0.0",ge={...oe,version:he,animations:se,themes:B,i18n:W,plugins:ce,presetPlugins:le,use(e,t={}){if("string"==typeof e){const n=le[e];if(!n)return this;if(this.plugins.register(e,{...n,...t}),"accessibility"===e&&Z.on("afterShow",e=>n.announce(e)),"persistence"===e){const e=n.install();e&&this.configure(e),Z.on("afterClose",()=>{n.save(this.getConfig())})}}else if(e&&"object"==typeof e){const n=e.name||"custom";this.plugins.register(n,{...e,...t})}return this},init(e={}){return e.config&&this.configure(e.config),e.theme&&this.themes.switchTheme(e.theme),e.locale&&this.i18n.switchLocale(e.locale),e.plugins&&Array.isArray(e.plugins)&&e.plugins.forEach(e=>{this.use(e)}),this},destroy(){if(this.dismiss(),this.plugins&&"function"==typeof this.plugins.destroy&&this.plugins.destroy(),this.themes&&("function"==typeof this.themes.clearThemeListeners&&this.themes.clearThemeListeners(),"function"==typeof this.themes.unwatchSystemTheme&&this.themes.unwatchSystemTheme()),this.i18n&&"function"==typeof this.i18n.clearLocaleListeners&&this.i18n.clearLocaleListeners(),this.animations&&"function"==typeof this.animations.cancelAll&&this.animations.cancelAll(),"undefined"!=typeof document){document.querySelectorAll(".met-container").forEach(e=>e.parentNode&&e.parentNode.removeChild(e));const e=document.getElementById("metona-toast-styles");e&&e.parentNode.removeChild(e)}this._toasts.clear()},getStatus(){return{version:he,toasts:this._toasts.size,theme:this.themes?.getCurrentTheme?.()||"auto",locale:this.i18n?.getCurrentLocale?.()||"zh-CN",plugins:this.plugins?.getNames?.()||[],animations:this.animations?.getActiveCount?.()||0}},getConfig(){return{...this._config}},updateConfig(e){return e&&"object"==typeof e&&(this._config={...this._config,...e}),this},resetConfig(){return this._config={...i},this},getToasts(){return Array.from(this._toasts.values())},hasToasts(){return this._toasts.size>0},getToast(e){return e&&this._toasts.get(e)||null},closeAll(){this._toasts.forEach(e=>e.close())},clearAll(){this._toasts.forEach(e=>e.close())},pauseAll(){this._toasts.forEach(e=>e._pause())},resumeAll(){this._toasts.forEach(e=>e._resume())},updateAll(e){e&&"object"==typeof e&&this._toasts.forEach(t=>t.update(e))},findToasts(e){return"function"!=typeof e?[]:Array.from(this._toasts.values()).filter(e)},findByType(e){return this.findToasts(t=>t.type===e)},findByPosition(e){return this.findToasts(t=>t.config.position===e)}};if("function"==typeof B.initTheme&&B.initTheme(),"function"==typeof W.initI18n&&W.initI18n(),"undefined"!=typeof window){window.MeToast=ge,window.Met=ge,ge._notify=t=>{"undefined"!=typeof Notification&&"denied"!==Notification.permission&&document.hidden&&("default"!==Notification.permission?e(t):Notification.requestPermission().then(n=>{"granted"===n&&e(t)}))};const e=e=>{try{new Notification(e.title||e.type,{body:e.message})}catch(e){}};Z.on("afterShow",e=>{e.config.notifyWhenHidden&&ge._notify(e)})}e.MeToast=ge,e.Met=ge,e.Toast=Z,e.VERSION=he,e.default=ge,e.meToast=ge,Object.defineProperty(e,"__esModule",{value:!0})});