text: import{V as s,C as e,S as t,i as a,s as n,e as r,t as l,k as c,c as o,a as i,g as u,d as f,n as d,b as h,N as g,f as p,F as y,h as m,W as v,X as w,Y as b,Z as S,_ as E,$ as M,B as k,P as H,a0 as N,u as R,v as X,r as q,I as D,a1 as L,a2 as O,H as T}from"./vendor-c052606d.js";const I=(()=>{const t=e([]),a=(s,e="default")=>{t.update((t=>[...t,{id:"_"+Math.random().toString(36).substr(2,9),type:e,message:s}]))},n=s(t,((s,e)=>{if(e(s),s.length>0){const s=setTimeout((()=>{t.update((s=>(s.shift(),s)))}),3e3);return()=>{clearTimeout(s)}}})),{subscribe:r}=n;return{subscribe:r,send:a,danger:s=>a(s,"danger"),warning:s=>a(s,"warning"),info:s=>a(s,"info"),success:s=>a(s,"success")}})();function J(s,e,t){const a=s.slice();return a[2]=e[t],a}function V(s){let e,t;return{c(){e=r("i"),this.h()},l(s){e=o(s,"I",{class:!0}),i(e).forEach(f),this.h()},h(){h(e,"class",t=v(s[2].icon)+" svelte-rlsdwl")},m(s,t){p(s,e,t)},p(s,a){2&a&&t!==(t=v(s[2].icon)+" svelte-rlsdwl")&&h(e,"class",t)},d(s){s&&f(e)}}}function x(s,e){let t,a,n,v,k,H,N,R,X=e[2].message+"",q=T,D=e[2].icon&&V(e);return{key:s,first:null,c(){t=r("div"),a=r("div"),n=l(X),v=c(),D&&D.c(),k=c(),this.h()},l(s){t=o(s,"DIV",{class:!0,style:!0});var e=i(t);a=o(e,"DIV",{class:!0});var r=i(a);n=u(r,X),r.forEach(f),v=d(e),D&&D.l(e),k=d(e),e.forEach(f),this.h()},h(){h(a,"class","content svelte-rlsdwl"),h(t,"class","toast svelte-rlsdwl"),g(t,"background",e[0][e[2].type]),this.first=t},m(s,e){p(s,t,e),y(t,a),y(a,n),y(t,v),D&&D.m(t,null),y(t,k),R=!0},p(s,a){e=s,(!R||2&a)&&X!==(X=e[2].message+"")&&m(n,X),e[2].icon?D?D.p(e,a):(D=V(e),D.c(),D.m(t,k)):D&&(D.d(1),D=null),(!R||3&a)&&g(t,"background",e[0][e[2].type])},r(){N=t.getBoundingClientRect()},f(){w(t),q(),b(t,N)},a(){q(),q=S(t,N,L,{})},i(s){R||(E((()=>{H||(H=M(t,O,{y:-30},!0)),H.run(1)})),R=!0)},o(s){H||(H=M(t,O,{y:-30},!1)),H.run(0),R=!1},d(s){s&&f(t),D&&D.d(),s&&H&&H.end()}}}function C(s){let e,t,a=[],n=new Map,l=s[1];const c=s=>s[2].id;for(let r=0;r<l.length;r+=1){let e=J(s,l,r),t=c(e);n.set(t,a[r]=x(t,e))}return{c(){e=r("div");for(let s=0;s<a.length;s+=1)a[s].c();this.h()},l(s){e=o(s,"DIV",{class:!0});var t=i(e);for(let e=0;e<a.length;e+=1)a[e].l(t);t.forEach(f),this.h()},h(){h(e,"class","notifications svelte-rlsdwl")},m(s,n){p(s,e,n);for(let t=0;t<a.length;t+=1)a[t].m(e,null);t=!0},p(s,[t]){if(3&t){l=s[1],k();for(let s=0;s<a.length;s+=1)a[s].r();a=H(a,t,c,1,s,l,n,e,N,x,null,J);for(let s=0;s<a.length;s+=1)a[s].a();R()}},i(s){if(!t){for(let s=0;s<l.length;s+=1)X(a[s]);t=!0}},o(s){for(let e=0;e<a.length;e+=1)q(a[e]);t=!1},d(s){s&&f(e);for(let e=0;e<a.length;e+=1)a[e].d()}}}function $(s,e,t){let a;D(s,I,(s=>t(1,a=s)));let{themes:n={danger:"#E26D69",success:"#84C991",warning:"#f0ad4e",info:"#5bc0de",default:"#aaaaaa"}}=e;return s.$$set=s=>{"themes"in s&&t(0,n=s.themes)},[n,a]}class B extends t{constructor(s){super(),a(this,s,$,C,n,{themes:0})}}async function P(s,e=null){var t=new XMLHttpRequest;t.onreadystatechange=function(){t.readyState===XMLHttpRequest.DONE&&200===t.status&&e(t)},t.open("GET",s,!0),t.send(null)}async function _(s,e,t=null,a=null){var n=new XMLHttpRequest;n.open(e,s,!0),n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE)switch(n.status){case 404:a({error:404});break;case 500:a({error:500});break;case 200:a(JSON.parse(n.response));break;default:a({error:n.status})}},null!=t&&(t=JSON.stringify(t)),n.send(t)}async function j(s,e){return new Promise((function(t,a){var n=new XMLHttpRequest;n.open(s,e),n.onreadystatechange=function(){if(4===n.readyState)switch(n.status){case 200:t(JSON.parse(n.response));default:a(null)}},n.send()}))}async function F(s,e,t,a){var n=new XMLHttpRequest;n.open(e,s,!0),n.responseType="arraybuffer",n.dataType="blob",n.onreadystatechange=function(){if(4!==n.readyState||200!==n.status)return!1;a([n.response])},t=JSON.stringify(t),n.send(t)}export{B as T,_ as a,F as g,j as m,I as n,P as x};
  