youtuber-blog-frontend/build/client/_app/immutable/nodes/6.BOnEodOB.js
2024-06-07 16:10:14 +02:00

4 lines
6.9 KiB
JavaScript

import{s as B,c as y,y as T,e as N,d as O,f as P,i as $,D as A,k as u,u as F,g as M,a as G,E as C,z as H,b,j as h,p as J,l as K,t as w,h as v,n as Q,F as k,m as V}from"../chunks/scheduler.ncJpckHt.js";import{S as z,i as I,t as i,a as _,c as m,b as p,m as d,d as g,g as W,e as X}from"../chunks/index.DNKwBhZH.js";import{e as D,u as Y,o as Z}from"../chunks/each.C-Vm-bAH.js";import{T as ee,a as te,b as se,c as q,d as L,e as S}from"../chunks/table-row.Clc1lodG.js";import{g as ae}from"../chunks/spread.CgU5AtxT.js";import{c as R,B as le}from"../chunks/button.Dry7Ezxz.js";import"../chunks/index.Bf9t7sah.js";import{A as ne}from"../chunks/arrow-up-right.DlzuEt35.js";function re(f){let e,s,t;const n=f[3].default,l=y(n,f,f[2],null);let o=[{class:s=R("mt-4 text-sm text-muted-foreground",f[0])},f[1]],a={};for(let r=0;r<o.length;r+=1)a=T(a,o[r]);return{c(){e=N("caption"),l&&l.c(),this.h()},l(r){e=O(r,"CAPTION",{class:!0});var c=P(e);l&&l.l(c),c.forEach($),this.h()},h(){A(e,a)},m(r,c){u(r,e,c),l&&l.m(e,null),t=!0},p(r,[c]){l&&l.p&&(!t||c&4)&&F(l,n,r,r[2],t?G(n,r[2],c,null):M(r[2]),null),A(e,a=ae(o,[(!t||c&1&&s!==(s=R("mt-4 text-sm text-muted-foreground",r[0])))&&{class:s},c&2&&r[1]]))},i(r){t||(i(l,r),t=!0)},o(r){_(l,r),t=!1},d(r){r&&$(e),l&&l.d(r)}}}function oe(f,e,s){const t=["class"];let n=C(e,t),{$$slots:l={},$$scope:o}=e,{class:a=void 0}=e;return f.$$set=r=>{e=T(T({},e),H(r)),s(1,n=C(e,t)),"class"in r&&s(0,a=r.class),"$$scope"in r&&s(2,o=r.$$scope)},[a,n,o,l]}class fe extends z{constructor(e){super(),I(this,e,oe,re,B,{class:0})}}function U(f,e,s){const t=f.slice();return t[1]=e[s],t[3]=s,t}function ce(f){let e,s,t;return s=new ne({props:{class:"h-4 w-4"}}),{c(){e=w(`Export as CSV\r
`),m(s.$$.fragment)},l(n){e=v(n,`Export as CSV\r
`),p(s.$$.fragment,n)},m(n,l){u(n,e,l),d(s,n,l),t=!0},p:Q,i(n){t||(i(s.$$.fragment,n),t=!0)},o(n){_(s.$$.fragment,n),t=!1},d(n){n&&$(e),g(s,n)}}}function $e(f){let e;return{c(){e=w("A list of recent signups on your website.")},l(s){e=v(s,"A list of recent signups on your website.")},m(s,t){u(s,e,t)},d(s){s&&$(e)}}}function ue(f){let e;return{c(){e=w("Email")},l(s){e=v(s,"Email")},m(s,t){u(s,e,t)},d(s){s&&$(e)}}}function ie(f){let e;return{c(){e=w("Date and Time")},l(s){e=v(s,"Date and Time")},m(s,t){u(s,e,t)},d(s){s&&$(e)}}}function _e(f){let e,s,t,n;return e=new L({props:{class:"max-w-[300px]",$$slots:{default:[ue]},$$scope:{ctx:f}}}),t=new L({props:{class:"text-end",$$slots:{default:[ie]},$$scope:{ctx:f}}}),{c(){m(e.$$.fragment),s=b(),m(t.$$.fragment)},l(l){p(e.$$.fragment,l),s=h(l),p(t.$$.fragment,l)},m(l,o){d(e,l,o),u(l,s,o),d(t,l,o),n=!0},p(l,o){const a={};o&16&&(a.$$scope={dirty:o,ctx:l}),e.$set(a);const r={};o&16&&(r.$$scope={dirty:o,ctx:l}),t.$set(r)},i(l){n||(i(e.$$.fragment,l),i(t.$$.fragment,l),n=!0)},o(l){_(e.$$.fragment,l),_(t.$$.fragment,l),n=!1},d(l){l&&$(s),g(e,l),g(t,l)}}}function me(f){let e,s;return e=new q({props:{$$slots:{default:[_e]},$$scope:{ctx:f}}}),{c(){m(e.$$.fragment)},l(t){p(e.$$.fragment,t)},m(t,n){d(e,t,n),s=!0},p(t,n){const l={};n&16&&(l.$$scope={dirty:n,ctx:t}),e.$set(l)},i(t){s||(i(e.$$.fragment,t),s=!0)},o(t){_(e.$$.fragment,t),s=!1},d(t){g(e,t)}}}function pe(f){let e=f[1].email+"",s;return{c(){s=w(e)},l(t){s=v(t,e)},m(t,n){u(t,s,n)},p(t,n){n&1&&e!==(e=t[1].email+"")&&V(s,e)},d(t){t&&$(s)}}}function de(f){let e=new Date(f[1].created_at).toLocaleString()+"",s;return{c(){s=w(e)},l(t){s=v(t,e)},m(t,n){u(t,s,n)},p(t,n){n&1&&e!==(e=new Date(t[1].created_at).toLocaleString()+"")&&V(s,e)},d(t){t&&$(s)}}}function ge(f){let e,s,t,n,l;return e=new S({props:{class:"max-w-[300px] overflow-hidden overflow-ellipsis text-nowrap",$$slots:{default:[pe]},$$scope:{ctx:f}}}),t=new S({props:{class:"text-end",$$slots:{default:[de]},$$scope:{ctx:f}}}),{c(){m(e.$$.fragment),s=b(),m(t.$$.fragment),n=b()},l(o){p(e.$$.fragment,o),s=h(o),p(t.$$.fragment,o),n=h(o)},m(o,a){d(e,o,a),u(o,s,a),d(t,o,a),u(o,n,a),l=!0},p(o,a){const r={};a&17&&(r.$$scope={dirty:a,ctx:o}),e.$set(r);const c={};a&17&&(c.$$scope={dirty:a,ctx:o}),t.$set(c)},i(o){l||(i(e.$$.fragment,o),i(t.$$.fragment,o),l=!0)},o(o){_(e.$$.fragment,o),_(t.$$.fragment,o),l=!1},d(o){o&&($(s),$(n)),g(e,o),g(t,o)}}}function j(f,e){let s,t,n;return t=new q({props:{$$slots:{default:[ge]},$$scope:{ctx:e}}}),{key:f,first:null,c(){s=k(),m(t.$$.fragment),this.h()},l(l){s=k(),p(t.$$.fragment,l),this.h()},h(){this.first=s},m(l,o){u(l,s,o),d(t,l,o),n=!0},p(l,o){e=l;const a={};o&17&&(a.$$scope={dirty:o,ctx:e}),t.$set(a)},i(l){n||(i(t.$$.fragment,l),n=!0)},o(l){_(t.$$.fragment,l),n=!1},d(l){l&&$(s),g(t,l)}}}function be(f){let e=[],s=new Map,t,n,l=D(f[0].signups);const o=a=>a[3];for(let a=0;a<l.length;a+=1){let r=U(f,l,a),c=o(r);s.set(c,e[a]=j(c,r))}return{c(){for(let a=0;a<e.length;a+=1)e[a].c();t=k()},l(a){for(let r=0;r<e.length;r+=1)e[r].l(a);t=k()},m(a,r){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(a,r);u(a,t,r),n=!0},p(a,r){r&1&&(l=D(a[0].signups),W(),e=Y(e,r,o,1,a,l,s,t.parentNode,Z,j,t,U),X())},i(a){if(!n){for(let r=0;r<l.length;r+=1)i(e[r]);n=!0}},o(a){for(let r=0;r<e.length;r+=1)_(e[r]);n=!1},d(a){a&&$(t);for(let r=0;r<e.length;r+=1)e[r].d(a)}}}function he(f){let e,s,t,n,l,o;return e=new fe({props:{$$slots:{default:[$e]},$$scope:{ctx:f}}}),t=new te({props:{$$slots:{default:[me]},$$scope:{ctx:f}}}),l=new se({props:{$$slots:{default:[be]},$$scope:{ctx:f}}}),{c(){m(e.$$.fragment),s=b(),m(t.$$.fragment),n=b(),m(l.$$.fragment)},l(a){p(e.$$.fragment,a),s=h(a),p(t.$$.fragment,a),n=h(a),p(l.$$.fragment,a)},m(a,r){d(e,a,r),u(a,s,r),d(t,a,r),u(a,n,r),d(l,a,r),o=!0},p(a,r){const c={};r&16&&(c.$$scope={dirty:r,ctx:a}),e.$set(c);const x={};r&16&&(x.$$scope={dirty:r,ctx:a}),t.$set(x);const E={};r&17&&(E.$$scope={dirty:r,ctx:a}),l.$set(E)},i(a){o||(i(e.$$.fragment,a),i(t.$$.fragment,a),i(l.$$.fragment,a),o=!0)},o(a){_(e.$$.fragment,a),_(t.$$.fragment,a),_(l.$$.fragment,a),o=!1},d(a){a&&($(s),$(n)),g(e,a),g(t,a),g(l,a)}}}function we(f){let e,s,t,n,l;return s=new le({props:{size:"sm",class:"ml-auto gap-1",$$slots:{default:[ce]},$$scope:{ctx:f}}}),s.$on("click",ve),n=new ee({props:{$$slots:{default:[he]},$$scope:{ctx:f}}}),{c(){e=N("div"),m(s.$$.fragment),t=b(),m(n.$$.fragment),this.h()},l(o){e=O(o,"DIV",{class:!0});var a=P(e);p(s.$$.fragment,a),t=h(a),p(n.$$.fragment,a),a.forEach($),this.h()},h(){J(e,"class","mx-auto w-full max-w-[1000px]")},m(o,a){u(o,e,a),d(s,e,null),K(e,t),d(n,e,null),l=!0},p(o,[a]){const r={};a&16&&(r.$$scope={dirty:a,ctx:o}),s.$set(r);const c={};a&17&&(c.$$scope={dirty:a,ctx:o}),n.$set(c)},i(o){l||(i(s.$$.fragment,o),i(n.$$.fragment,o),l=!0)},o(o){_(s.$$.fragment,o),_(n.$$.fragment,o),l=!1},d(o){o&&$(e),g(s),g(n)}}}async function ve(){const e=await(await fetch("/emails/export")).text(),s=new Blob([e],{type:"text/csv"}),t=window.URL.createObjectURL(s),n=document.createElement("a");n.href=t,n.setAttribute("download","data.csv"),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(t)}function ke(f,e,s){let{data:t}=e;return f.$$set=n=>{"data"in n&&s(0,t=n.data)},[t]}class Re extends z{constructor(e){super(),I(this,e,ke,we,B,{data:0})}}export{Re as component};