import{S as V,i as j,s as G,k as m,q as $,a as k,l as p,m as g,r as q,h,c as x,n as u,b as v,G as _,B as w,I as H,o as M,e as I,J as y,u as z}from"../../chunks/index-b346583a.js";function E(f,a,e){const s=f.slice();return s[2]=a[e],s}function D(f){let a,e,s=f[2].data.prompt+"",c,n,o,i,l;return{c(){a=m("div"),e=m("h1"),c=$(s),n=k(),o=m("img"),l=k(),this.h()},l(r){a=p(r,"DIV",{});var t=g(a);e=p(t,"H1",{class:!0});var d=g(e);c=q(d,s),d.forEach(h),n=x(t),o=p(t,"IMG",{loading:!0,src:!0,class:!0}),l=x(t),t.forEach(h),this.h()},h(){u(e,"class","text-black dark:text-white font-semibold p-2 min-h-[8ch] text-center"),u(o,"loading","lazy"),y(o.src,i=f[2].data.images[0])||u(o,"src",i),u(o,"class","rounded-3xl")},m(r,t){v(r,a,t),_(a,e),_(e,c),_(a,n),_(a,o),_(a,l)},p(r,t){t&1&&s!==(s=r[2].data.prompt+"")&&z(c,s),t&1&&!y(o.src,i=r[2].data.images[0])&&u(o,"src",i)},d(r){r&&h(a)}}}function S(f){let a,e=f[2].data.images.length>0&&D(f);return{c(){e&&e.c(),a=I()},l(s){e&&e.l(s),a=I()},m(s,c){e&&e.m(s,c),v(s,a,c)},p(s,c){s[2].data.images.length>0?e?e.p(s,c):(e=D(s),e.c(),e.m(a.parentNode,a)):e&&(e.d(1),e=null)},d(s){e&&e.d(s),s&&h(a)}}}function B(f){let a,e,s,c,n,o=f[0],i=[];for(let l=0;ln.json()).then(n=>{e(0,s=n)})}return M(()=>{c();const n=window.setInterval(c,2e3);return()=>{clearInterval(n)}}),[s]}class P extends V{constructor(a){super(),j(this,a,J,B,G,{})}}export{P as default};