1import{d as Q,g as h,w as A}from"./C64u8BFd.js";import{aT as x}from"./BPAoz2ir.js";function E(e,u,r,i){var n,o,m=!1,R=r.length>=2,V=(t,a,l)=>{if(n=a,R&&(o=t),!m){let c=u(t,a,l);if(u.length<2)a(c);else return c}m=!1},b=Q(e,V,i),k=!Array.isArray(e);function p(t){var a=r(t,o);k?(m=!0,e.set(a)):a.forEach((l,c)=>{m=!0,e[c].set(l)}),m=!1}var y=!1;function w(t){var a,l,c,f;if(y){f=t(h(b)),n(f);return}var _=b.subscribe(P=>{y?a?l=!0:a=!0:c=P});f=t(c),y=!0,n(f),_(),y=!1,l&&(f=h(b)),a&&p(f)}return{subscribe:b.subscribe,set(t){w(()=>t)},update:w}}const j=20,s=A([]),T=A(null),g=new Map,D=e=>{if(g.has(e))return;const u=setTimeout(()=>{g.delete(e),M(e)},1e3);g.set(e,u)},B=e=>{const u=g.get(e);u&&clearTimeout(u)};function H(e){e.id&&B(e.id),s.update(u=>u.map(r=>r.id===e.id?{...r,...e}:r))}function L(e){s.update(u=>[e,...u].slice(0,j))}function N(e){h(s).find(u=>u.id===e.id)?H(e):L(e)}function U(e){s.update(u=>(e?D(e):u.forEach(r=>{D(r.id)}),u.map(r=>r.id===e||e===void 0?{...r,visible:!1}:r)))}function M(e){s.update(u=>e===void 0?[]:u.filter(r=>r.id!==e))}function J(e){T.set(e)}function K(e){let u;T.update(r=>(u=e-(r||0),null)),s.update(r=>r.map(i=>({...i,pauseDuration:i.pauseDuration+u})))}const W={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3};function X(e={}){return{toasts:E(s,r=>r.map(i=>{var n,o;return{...e,...e[i.type],...i,duration:i.duration||((n=e[i.type])==null?void 0:n.duration)||(e==null?void 0:e.duration)||W[i.type],style:[e.style,(o=e[i.type])==null?void 0:o.style,i.style].join(";")}}),r=>r),pausedAt:T}}const q=e=>typeof e=="function",S=(e,u)=>q(e)?e(u):e,z=(()=>{let e=0;return()=>(e+=1,e.toString())})(),Y=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){const u=matchMedia("(prefers-reduced-motion: reduce)");e=!u||u.matches}return e}})(),C=(e,u="blank",r)=>({createdAt:Date.now(),visible:!0,type:u,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||z()}),v=e=>(u,r)=>{const i=C(u,e,r);return N(i),i.id},d=(e,u)=>v("blank")(e,u);d.error=v("error");d.success=v("success");d.loading=v("loading");d.custom=v("custom");d.dismiss=e=>{U(e)};d.remove=e=>M(e);d.promise=(e,u,r)=>{const i=d.loading(u.loading,{...r,...r==null?void 0:r.loading});return e.then(n=>(d.success(S(u.success,n),{id:i,...r,...r==null?void 0:r.success}),n)).catch(n=>{d.error(S(u.error,n),{id:i,...r,...r==null?void 0:r.error})}),e};x();export{H as a,K as e,Y as p,J as s,d as t,X as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.