1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6746],{55951:function(e,i,s){"use strict";s.d(i,{M:function(){return n}});var l=s(2784),r=s(96651),a=s(75813),o=s(52322);let t=e=>{let{color:i="black",size:s=24,...l}=e;return(0,o.jsxs)(r.ny,{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...l,children:[(0,o.jsx)(r.y$,{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",stroke:i}),(0,o.jsx)(r.y$,{d:"M3 16.2V21m0 0h4.8M3 21l6-6",stroke:i}),(0,o.jsx)(r.y$,{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",stroke:i}),(0,o.jsx)(r.y$,{d:"M3 7.8V3m0 0h4.8M3 3l6 6",stroke:i})]})};t.displayName="Expand";let n=(0,l.memo)((0,a.H)(t))},69077:function(e,i,s){"use strict";s.d(i,{m:function(){return n}});var l=s(2784),r=s(96651),a=s(75813),o=s(52322);let t=e=>{let{color:i="black",size:s=24,...l}=e;return(0,o.jsxs)(r.ny,{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...l,children:[(0,o.jsx)(r.y$,{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",stroke:i}),(0,o.jsx)(r.aH,{points:"16 6 12 2 8 6",stroke:i}),(0,o.jsx)(r.x1,{x1:"12",x2:"12",y1:"2",y2:"15",stroke:i})]})};t.displayName="Share";let n=(0,l.memo)((0,a.H)(t))},96377:function(e,i,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/zaps/[zapId]",function(){return s(91629)}])},91629:function(e,i,s){"use strict";s.r(i),s.d(i,{ZapPage:function(){return Q},__N_SSP:function(){return V},default:function(){return K}});var l=s(52322),r=s(49794),a=s(2784),o=s(66160),t=s(65457),n=s(11728),_=s(6857),d=s(55951),p=s(69077),c=s(96651),x=s(75813);let f=e=>{let{color:i="black",size:s=24,...r}=e;return(0,l.jsxs)(c.ny,{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...r,children:[(0,l.jsx)(c.y$,{d:"M20 7h-9",stroke:i}),(0,l.jsx)(c.y$,{d:"M14 17H5",stroke:i}),(0,l.jsx)(c.Cd,{cx:"17",cy:"17",r:"3",stroke:i}),(0,l.jsx)(c.Cd,{cx:"7",cy:"7",r:"3",stroke:i})]})};f.displayName="Settings2";let u=(0,a.memo)((0,x.H)(f));var m=s(77750),b=s(28007),h=s(90413),v=s(28588),w=s(24203),g=s(61581),y=s(91952),j=s(65496),z=s(83111),k=s(43086),S=s(94686),N=s(46678),I=s(32330),$=s(54554);let F=" is_Flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _gap-t-space-2 ",P=" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-bold _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color _pr-t-space-3--53 _pl-t-space-3--53 font_body ",D=e=>{var i,s,r;let{zapId:a}=e,{data:c,isLoading:x,error:f}=(0,b.B)(a),{data:D}=(0,h.V)(a),{data:A}=(0,g.s)(null==c?void 0:c.user_id),{push:C}=(0,k.t)(),{copyToClipboard:T,isCopied:Z}=(0,N.m)({}),{data:E}=(0,$.p)();return!x&&(null==c?void 0:c.file_content)?(0,l.jsxs)(m.z4,{variant:"content",h:"100%",children:[(0,l.jsx)(y.a,{zapData:c}),(0,l.jsx)(w.u,{title:null==c?void 0:c.name}),(0,l.jsxs)(t.p,{pt:50,children:[(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-1 _fd-column _h-10037 _fg-1 ",children:[(0,l.jsx)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _h-400px _mah-400px _ox-hidden _oy-hidden _bg-background ",children:(null==c?void 0:c.file_type)==="html"?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(S.h,{srcDoc:null==c?void 0:c.file_content,style:{flex:1}})}):(0,l.jsx)(j.d,{language:(null==c?void 0:c.file_type)||"txt",children:null==c?void 0:c.file_content})}),(0,l.jsx)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _mt-t-space-3 _jc-space-betwe3241 _ai-center _pr-t-space-3--53 _pl-t-space-3--53 ",children:(0,l.jsxs)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _gap-t-space-2 _ai-center ",children:[(0,l.jsx)(n.E,{source:{uri:null==c?void 0:null===(i=c.profiles)||void 0===i?void 0:i.avatar_url},w:30,h:30,borderRadius:"$8"}),(0,l.jsx)("span",{className:" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-500 _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color font_body ",children:null==c?void 0:null===(s=c.profiles)||void 0===s?void 0:s.name})]})}),(0,l.jsxs)("div",{className:" is_Flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _gap-t-space-2 _mt-t-space-4 _pr-t-space-3--53 _pl-t-space-3--53 ",children:[(0,l.jsx)(_.z,{size:"$3",borderRadius:"$8",icon:d.M,onPress:()=>{C({pathname:"/zaps/[zapId]/fullscreen",query:{zapId:a}})},children:"Full Screen"}),(0,l.jsx)(_.z,{size:"$3",borderRadius:"$8",icon:p.m,onPress:()=>{T("".concat(z._O,"/zaps/").concat(a))},children:Z?"Copied":"Share"}
1),(null==E?void 0:E.id)===(null==c?void 0:c.user_id)&&(0,l.jsx)(I.z,{zap:c,size:"$3",borderRadius:"$8",icon:u,children:"Visibility"})]}),(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _mt-t-space-3 _pr-t-space-3--53 _pl-t-space-3--53 ",children:[(0,l.jsx)("span",{className:" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-bold _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color font_body ",children:"Description"}),(0,l.jsx)("p",{className:" is_Paragraph _dsp-inline _bxs-border-box _ww-break-word _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-f-weight-4 _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-1--75 _col-color _ussel-auto _whiteSpace-normal font_body ",children:null==c?void 0:c.description})]}),(0,l.jsx)("div",{className:" is_Separator _dsp-flex _ai-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _btc-borderColor _brc-borderColor _bbc-borderColor _blc-borderColor _fs-1 _btw-0px _brw-0px _bbw-1px _blw-0px _fg-1 _h-0px _mah-0px _mt-t-space-5 _mr-t-space-5 _mb-t-space-5 _ml-t-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid _transform-translateY-1736186894 "}),D&&(null==D?void 0:D.length)>0&&(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _gap-t-space-3 ",children:[(0,l.jsx)("span",{className:P,children:"Recommended Zaps"}),(0,l.jsx)(t.p,{horizontal:!0,showsHorizontalScrollIndicator:!1,space:"$3",px:"$3.5",children:(0,l.jsx)("div",{className:F,children:D.map(e=>(0,l.jsx)(v.n,{zap:e},null==e?void 0:e.id))})})]}),A&&(null==A?void 0:A.length)>0&&(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _gap-t-space-3 _mt-t-space-5 ",children:[(0,l.jsxs)("span",{className:P,children:["More Zaps from ",null==c?void 0:null===(r=c.profiles)||void 0===r?void 0:r.name]}),(0,l.jsx)(t.p,{horizontal:!0,showsHorizontalScrollIndicator:!1,space:"$3",px:"$3.5",children:(0,l.jsx)("div",{className:F,children:A.map(e=>(0,l.jsx)(v.n,{zap:e},null==e?void 0:e.id))})})]})]}),(0,l.jsx)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _h-100px "})]})]}):(0,l.jsx)(o.$,{})};s(26377);var A=s(77425),C=s(34182),T=s(39608);let Z=" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-f-weight-2 _ls-f-letterSpa1360334204 _fos-f-size-2 _lh-f-lineHeigh112921 _col-color font_body ",E=e=>{var i,s;let{zap:r}=e;return(0,l.jsx)(A.r,{href:{pathname:"/zaps/[zapId]",query:{zapId:null==r?void 0:r.slug}},children:(0,l.jsxs)("div",{className:" is_Flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _gap-t-space-2 ",children:[(0,l.jsx)(n.E,{source:{uri:r.image_url||"https://placeholder.com/300x200"},h:95,w:170,borderRadius:"$4"}),(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-1 _fd-column _fg-1 ",children:[(0,l.jsx)("span",{className:" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-bold _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color font_body ",children:r.name||"Zap"}),(0,l.jsxs)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _ai-center _o-0--7 _gap-t-space-2 ",children:[(0,l.jsxs)("span",{className:Z,children:["By ",(null==r?void 0:null===(i=r.profiles)||void 0===i?void 0:i.admin_role)==="admin"?"Sparks AI":null==r?void 0:null===(s=r.profiles)||void 0===s?void 0:s.name]}),(null==r?void 0:r.view_count)&&(0,l.jsx)("span",{className:" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-f-weight-4 _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color font_body ",children:"\xb7"}),(null==r?void 0:r.view_count)&&(0,l.jsxs)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _ai-center _gap-t-space-1 ",children:[(0,l.jsx)(T.b,{size:16}),(0,l.jsxs)("span",{className:Z,children:[r.view_count||"0"," views"]})]})]}),(0,l.jsx)("span",{className:" is_SizableText _dsp--webkit-box _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-f-weight-2 _ls-f-letterSpa1360334204 _fos-f-size-2 _lh-f-lineHeigh112921 _col-color _WebkitLineClamp-2 _WebkitBoxOrient-vertical _ox-hidden _oy-hidden _h-45px font_body ",children:r.description||"No description available"})]})]})})};s(21942);var R=s(25145);let H=" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-bold _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color font_body ",q=e=>{var i,s,r,a;let{zapId:o}=e,{data:c,isLoading:x,error:f}=(0,b.B)(o),{data:S}=(0,h.V)(o),{data:F}
1=(0,g.s)(null==c?void 0:c.user_id),{push:P}=(0,k.t)(),{copyToClipboard:D,isCopied:T}=(0,N.m)({}),{data:Z}=(0,$.p)();return(0,l.jsxs)(m.z4,{variant:"content",children:[(0,l.jsx)(y.a,{zapData:c}),(0,l.jsx)(w.u,{title:null==c?void 0:c.name}),(0,l.jsx)(t.p,{flex:1,h:"100%",w:"100%",p:"$3.5",pt:70,children:(0,l.jsxs)("div",{className:" is_Flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-1 _dsp-flex _fd-row _fg-1 _gap-t-space-3--53 ",children:[(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-1 _fd-column _fg-1 _h-10037 ",children:[(0,l.jsx)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _h-700px _btlr-t-radius-6 _btrr-t-radius-6 _bbrr-t-radius-6 _bblr-t-radius-6 _ox-hidden _oy-hidden _bg-background ",children:(null==c?void 0:c.file_type)==="html"?(0,l.jsx)("iframe",{srcDoc:null==c?void 0:c.file_content,style:{flex:1}}):(0,l.jsx)(j.d,{language:null!==(a=null==c?void 0:c.file_type)&&void 0!==a?a:"txt",style:R.RY,showLineNumbers:!0,customStyle:{maxWidth:"100%",whiteSpace:"pre",zIndex:1e5,background:"transparent",padding:"0rem 1rem"},codeTagProps:{style:{fontSize:"0.9rem",fontFamily:"var(--font-mono)"}},children:null==c?void 0:c.file_content})}),(0,l.jsxs)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _mt-t-space-3 _jc-space-betwe3241 _ai-center ",children:[(0,l.jsxs)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _gap-t-space-2 _ai-center ",children:[(0,l.jsx)(n.E,{source:{uri:null==c?void 0:null===(i=c.profiles)||void 0===i?void 0:i.avatar_url},w:30,h:30,borderRadius:"$8"}),(0,l.jsx)("span",{className:" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-500 _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color font_body ",children:null==c?void 0:null===(s=c.profiles)||void 0===s?void 0:s.name})]}),(0,l.jsxs)("div",{className:" is_Flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _gap-t-space-2 ",children:[(0,l.jsx)(A.r,{href:{pathname:"/zaps/[zapId]/fullscreen",query:{zapId:o}},children:(0,l.jsx)(_.z,{size:"$3",borderRadius:"$8",icon:d.M,onPress:()=>{P({pathname:"/zaps/[zapId]/fullscreen",query:{zapId:o}})},children:"Full Screen"})}),(0,l.jsx)(_.z,{size:"$3",borderRadius:"$8",icon:p.m,onPress:()=>{D("".concat(z._O,"/zaps/").concat(o))},children:T?"Copied":"Share"}),(null==Z?void 0:Z.id)===(null==c?void 0:c.user_id)&&(0,l.jsx)(I.z,{zap:c,size:"$3",borderRadius:"$8",icon:u,children:"Visibility"})]})]}),(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _mt-t-space-3 ",children:[(0,l.jsx)("span",{className:H,children:"Description"}),(0,l.jsx)("p",{className:" is_Paragraph _dsp-inline _bxs-border-box _ww-break-word _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-f-weight-4 _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-1--75 _col-color _ussel-auto _whiteSpace-normal font_body ",children:null==c?void 0:c.description})]}),(0,l.jsx)("div",{className:" is_Separator _dsp-flex _ai-stretch _fd-column _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _btc-borderColor _brc-borderColor _bbc-borderColor _blc-borderColor _fs-1 _btw-0px _brw-0px _bbw-1px _blw-0px _fg-1 _h-0px _mah-0px _mt-t-space-5 _mb-t-space-5 _bbs-solid _bts-solid _bls-solid _brs-solid _transform-translateY-1736186894 "}),F&&F.length>0&&(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _gap-t-space-3 ",children:[(0,l.jsxs)("span",{className:H,children:["More Zaps from ",null==c?void 0:null===(r=c.profiles)||void 0===r?void 0:r.name]}),(0,l.jsx)(C.MI,{listKey:"moreZaps",itemDimension:130,spacing:10,maxItemsPerRow:3,data:F,renderItem:e=>{let{item:i}=e;return(0,l.jsx)(v.n,{zap:i})}})]})]}),(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _gap-t-space-3 _w-3037 ",children:[(0,l.jsx)("span",{className:H,children:"Recommended Zaps"}),S.map(e=>(0,l.jsx)(E,{zap:e},null==e?void 0:e.id))]})]})})]})};s(59591);var M=s(41732);let L=e=>{let i=(0,r.d)();return!M.isWeb||i?(0,l.jsx)(D,{...e}):(0,l.jsx)(q,{...e})};var W=s(97729),O=s.n(W),B=s(54803),V=!0;let Q=e=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(O(),{children:(0,l.jsx)("title",{children:"Bot"})}),(0,l.jsx)(B.T,{children:(0,l.jsx)(L,{...e})})]});var K=Q},94686:function(e,i,s){"use strict";s.d(i,{h:function(){return r}});var l=s(52322);let r=e=>{let{style:i={},...s}=e;return(0,l.jsx)("iframe",{style:{height:"100%",width:"100%",flex:1,...null!=i?i:{}},...s})}},60876:function(e,i,s){"use strict";s.d(i,{p:function(){return t}});var l=s(52322),r=s(41732),a=s(55351),o=s(83111);let t=e=>{let{children:i,openGraph:s,...t}=e;return r.isWeb?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.PB,{openGraph:{site_name:"Sparks AI",...null!=s?s:{}},twitter:{handle:"@SparksAIApp",site:"@SparksAIApp",cardType:"summary_large_image"},additionalMetaTags:[{name:"application-name",content:"Sparks AI"},{property:"og:instagram",content:"@sparksaiapp"},{property:"og:reddit",content:"r/sparksai"},{property:"og:discord",content:"https://discord.gg/QUd3YTzKaZ"},{property:"og:youtube",content:"https://www.youtube.com/@SparksAI-z9z"},{property:"og:linkedin",content:"https://www.linkedin.com/company/sparksai"}],additionalLinkTags:[{rel:"icon",href:"".concat(o._O,"/favicon.ico")}],...t}),i]}):null}},65496:function(e,i,s){"use strict";s.d(i,{d:function(){return o}});var l=s(52322),r=s(21484),a=s(25145);let o=e=>(0,l.jsx)(r.Z,{style:a.RY,PreTag:"div",showLineNumbers:!0,wrapLines:!0,customStyle:{maxWidth:"100%",pointerEvents:"all",zIndex:1e5,background:"transparent",...e.customStyle,...e.style},codeTagProps:{style:{fontSize:"0.9rem",fontFamily:"var(--font-mono)"}},...e})},32330:function(e,i,s){"use strict";s.d(i,{z:function(){return S}});var l=s(52322),r=s(98428),a=s(6857),o=s(66160),t=s(8341),n=s(61773),_=s(179),d=s(33654),p=s(69515),c=s(60418),x=s(1706),f=s(38
110),u=s(18769),m=s(69158),b=s(46678),h=s(83111),v=s(91560),w=s(69819);let g=[{label:"Private",value:"private"},{label:"Anyone with link",value:"link"},{label:"Public",value:"public"}],y=e=>(0,p.D)({mutationFn:async()=>{try{let{data:i}=await c.Z.post("/api/zap-metadata",{zapId:null==e?void 0:e.id});return i}catch(e){console.log(null==e?void 0:e.message);return}},onSuccess:()=>{h.Eh.invalidateQueries({queryKey:[v.i.zap,null==e?void 0:e.slug]})}}),j=e=>(0,p.D)({mutationFn:async i=>{let{data:s,error:l}=await w.Z.from("zaps").update({visibility:i}).eq("slug",e).single();if(l)throw console.log("sharing error",l),l;return s},onSuccess:()=>{h.Eh.invalidateQueries({queryKey:[v.i.zap,e]})}}),z=e=>(0,p.D)({mutationFn:async()=>{let{data:i}=await w.Z.from("zaps").select("*").eq("slug",e).single();if((null==i?void 0:i.visibility)==="public"||(null==i?void 0:i.visibility)==="link")return i;if(!(null==i?void 0:i.file_content))throw Error("No content found for zap.");let{data:s,error:l}=await w.Z.from("zaps").update({visibility:"link"}).eq("slug",e).select("*").single();if(l)throw console.log("sharing error",l),l;return s},onSuccess:()=>{h.Eh.invalidateQueries({queryKey:[v.i.zap,e]})}}),k=e=>{let{zap:i}=e,{isPending:s,mutateAsync:d}=j(null==i?void 0:i.slug),{isCopied:p,copyToClipboard:c}=(0,b.m)({}),f={variant:"outlined",borderWidth:"$0.5",fontWeight:"500",jc:"space-between",hoverStyle:{}},m={jc:"space-between",fontWeight:"500",theme:"active"},v=async e=>{try{await d(e)}catch(e){console.error("Error changing visibility:",e)}};return(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column _gap-t-space-3 _pt-t-space-5 _pr-t-space-5 _pb-t-space-5 _pl-t-space-5 ",children:[(0,l.jsx)("span",{className:" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-f-weight-4 _ls-f-letterSpa1360334202 _fos-f-size-4 _lh-f-lineHeigh112923 _col-color font_body ",children:"Share your zap with others or keep it private."}),(0,l.jsxs)("div",{className:" is_Div _dsp-flex _ai-stretch _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _fd-column ",children:[(0,l.jsxs)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-0 _dsp-flex _fd-row _ai-center _gap-t-space-3 _mb-t-space-2 ",children:[(0,l.jsx)("span",{className:" is_SizableText _dsp-inline _bxs-border-box _ww-break-word _whiteSpace-pre-wrap _mt-0px _mr-0px _mb-0px _ml-0px _ff-f-family _fow-500 _ls-f-letterSpa1360334203 _fos-f-size-3 _lh-f-lineHeigh112922 _col-color font_body ",children:"Visibility"}),s&&(0,l.jsx)(u.a,{height:20})]}),(0,l.jsx)(r.ZA,{borderRadius:"$8",children:g.map(e=>(0,l.jsx)(r.ZA.Item,{children:(0,l.jsx)(a.z,{scaleIcon:1.3,iconAfter:(null==i?void 0:i.visibility)===e.value&&(s?(0,l.jsx)(o.$,{}):(0,l.jsx)(n.J,{})),...(null==i?void 0:i.visibility)===e.value?m:f,onPress:()=>v(e.value),disabled:s,children:e.label})},e.value))})]}),(0,l.jsxs)("div",{className:" is_Flex _fb-auto _bxs-border-box _pos-relative _mih-0px _miw-0px _fs-1 _dsp-flex _fd-row _ai-center _fg-1 _gap-t-space-2 ",children:[(0,l.jsx)(t.II,{value:"".concat(h._O,"/zaps/").concat(null==i?void 0:i.slug),disabled:!0,flex:1}),(0,l.jsx)(x.E,{jc:"flex-start",icon:p?n.J:_.r,isDisabled:(null==i?void 0:i.visibility)==="private",onPress:()=>{c("".concat(h._O,"/zaps/").concat(null==i?void 0:i.slug))},borderRadius:"$8",color:"white",style:{background:"linear-gradient(90deg, #FFA547 0%, #FF775F 100%)",fontWeight:800},children:p?"Copied Link":"Copy Link"})]})]})},S=e=>{let{zap:i,...s}=e,{isOpen:r,onToggle:a,onOpen:o}=(0,m.y)(),{copyToClipboard:t,isCopied:_}=(0,b.m)({}),{mutateAsync:p,isPending:c}=y(i),{isPending:u,mutateAsync:h}=z(null==i?void 0:i.slug),v=async e=>{var s,l;null==e||null===(s=e.preventDefault)||void 0===s||s.call(e),null==e||null===(l=e.stopPropagation)||void 0===l||l.call(e),(null==i?void 0:i.image_url)||await p(),(null==i?void 0:i.visibility)!=="private"&&(null==i?void 0:i.visibility)||await h(),o()};return(0,l.jsx)(f.k,{open:r,onOpenChange:a,title:"Share Zap",trigger:(0,l.jsx)(x.E,{icon:_?n.J:d.C,onPress:v,size:"$2",borderRadius:"$6",scaleIcon:1.2,scaleSpace:.5,isLoading:u||c,...s}),children:(0,l.jsx)(k,{zap:i})})};s(57740)},90413:function(e,i,s){"use strict";s.d(i,{V:function(){return t}});var l=s(69819),r=s(94424),a=s(91560);let o=async(e,i)=>{var s;let r=l.Z.from("zaps").select("\n *,\n profiles(id, name, avatar_url, admin_role)\n ").eq("visibility","public").not("image_url","is",null).range((e-1)*25,25*e-1);(null==i?void 0:i.searchQuery)&&(r=r.textSearch("zap_search",i.searchQuery)),r=r.order((null==i?void 0:i.sort)==="newest"?"created_at":"view_count",{ascending:!1});let a=await r;return a.error?(console.error("Error fetching public zaps:",a.error),[]):null!==(s=a.data)&&void 0!==s?s:[]};function t(e){var i,s;let l={sort:(null==e?void 0:e.sort)||"popular",searchQuery:(null==e?void 0:e.searchQuery)||""},{data:t,...n}=(0,r.N)({queryKey:[a.i.publicZapList,l],queryFn:e=>{let{pageParam:i=1}=e;return o(i,l)},initialPageParam:1,getNextPageParam:(e,i)=>e.length<25?void 0:i.length+1});return{data:null!==(s=null==t?void 0:null===(i=t.pages)||void 0===i?void 0:i.flat())&&void 0!==s?s:[],...n}}},91952:function(e,i,s){"use strict";s.d(i,{a:function(){return t}});var l=s(52322);
1s(2784);var r=s(55351),a=s(60876),o=s(83111);let t=e=>{let{zapData:i}=e;return(0,l.jsx)(a.p,{title:"".concat(null==i?void 0:i.name," - Sparks AI Zap"),description:(null==i?void 0:i.description)||"Use ".concat(null==i?void 0:i.name,", an AI zap on Sparks AI."),canonical:"".concat(o._O,"/zaps/").concat(null==i?void 0:i.slug),openGraph:{url:"".concat(o._O,"/zaps/").concat(null==i?void 0:i.slug),title:"".concat(null==i?void 0:i.name," - Sparks AI Zap"),description:(null==i?void 0:i.description)||"Use ".concat(null==i?void 0:i.name,", an AI zap on Sparks AI."),images:[{url:(null==i?void 0:i.image_url)||"".concat(o._O,"/logo2.jpeg"),width:800,height:600,alt:"".concat(null==i?void 0:i.name," image")}]},children:(0,l.jsx)(r.Gz,{name:null==i?void 0:i.name,price:"Free",priceCurrency:"USD",applicationCategory:"UtilitiesApplication",operatingSystem:"Web",description:(null==i?void 0:i.description)||"Use ".concat(null==i?void 0:i.name,", an AI zap on Sparks AI."),url:"".concat(o._O,"/zaps/").concat(null==i?void 0:i.slug)})})}},28007:function(e,i,s){"use strict";s.d(i,{B:function(){return _}});var l=s(69819),r=s(42180),a=s(91560),o=s(83111),t=s(90065);let n=async e=>{var i;if(console.log("zapId",e),!e)return;let s=(0,t.R)(e),r=await l.Z.from("zaps").select("*, profiles (*)").eq("short_id",s).single();return null!==(i=null==r?void 0:r.data)&&void 0!==i?i:{}};function _(e){return(0,r.a)({queryKey:[a.i.zap,e],queryFn:()=>n(e),refetchOnWindowFocus:!1},o.Eh)}},90065:function(e,i,s){"use strict";s.d(i,{R:function(){return l}});let l=e=>e?e.split("-").pop():""},21942:function(){},59591:function(){},57740:function(){},26377:function(){}},function(e){e.O(0,[6425,1349,679,5416,1082,4029,8341,6378,362,2122,2678,4685,9097,6022,5482,9171,490,1062,7585,2888,9774,179],function(){return e(e.s=96377)}),_N_E=e.O()}]);
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.