PageSourceSearch

https://www.promoamp.com/_app/immutable/nodes/54.B_sTADI_.js

js promoamp.com collected 2026-10-03 21:29:13 UTC 8,727 bytes, 5 lines download raw bytes

1import"../chunks/NZTpNUN0.js";import{o as ye}from"../chunks/DCDCaYga.js";import{p as be,F as _e,l as j,v as ke,t as we,a as l,b as $e,s as Ce,d as t,f as h,o as d,j as a,c as s,r as o,e as Ze,n as _,g as L,i as Pe}from"../chunks/CswluXHk.js";import{i as X}from"../chunks/Cvwav-Rz.js";import{c as k}from"../chunks/DCqg9Lcd.js";import{a as je}from"../chunks/sqsHMH9B.js";import{p as Ie}from"../chunks/BGX793Ew.js";import"../chunks/aH0YTA77.js";import{t as m}from"../chunks/CFi-xeDB.js";import{C as E}from"../chunks/BFGY4aR1.js";import{B as K}from"../chunks/CGaxensS.js";import{I as Y}from"../chunks/DuX34-Zw.js";import{L as ee}from"../chunks/CMmMJQVx.js";import{S as N}from"../chunks/BatQt1sd.js";import{L as te}from"../chunks/Da_J7eHO.js";import{E as Se}from"../chunks/AxoGEqQz.js";var Ue=h('<div class="flex justify-center py-8"><!></div>'),Te=h('<div class="flex items-center justify-between"><div><h3 class="text-lg font-semibold">Enable Zapier Integration</h3> <p class="text-sm text-gray-600">Turn on webhook notifications for your Zapier automations</p></div> <!></div>'),Le=h(`<div class="space-y-4"><div><h3 class="text-lg font-semibold mb-2">Webhook Configuration</h3> <p class="text-sm text-gray-600 mb-4">Paste the Catch Hook URL from Zapier to send Promo Amp events into
2              your Zap.</p></div> <div class="space-y-4"><div><!> <div class="mt-2"><!></div> <p class="text-xs text-gray-500 mt-1">In Zapier, use Webhooks by Zapier and choose Catch Hook to get
3                the URL.</p></div> <div><!> <div class="flex gap-2 mt-2"><!> <!></div> <p class="text-xs text-gray-500 mt-1">If set, Promo Amp includes this token in the webhook payload as <code>api_key</code>.</p></div></div> <div class="flex gap-2"><!></div></div>`),Ee=h(`<div class="space-y-4"><div><h3 class="text-lg font-semibold mb-2">Event Configuration</h3> <p class="text-sm text-gray-600 mb-4">Choose which events should trigger your Zapier automation</p></div> <div class="space-y-4"><div class="flex items-center justify-between"><div><div class="font-medium">New Competition Entry</div> <p class="text-sm text-gray-600">Triggered when someone enters a competition</p></div> <!></div> <div class="flex items-center justify-between"><div><div class="font-medium">Action Completed</div> <p class="text-sm text-gray-600">Triggered when a user completes an action (follow, share,
4                  etc.)</p></div> <!></div></div></div>`),Fe=h(`<div class="space-y-4"><h3 class="text-lg font-semibold">Setup Instructions</h3> <div class="space-y-3 text-sm"><div class="flex gap-3"><span class="flex-shrink-0 w-6 h-6 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center text-xs font-medium">1</span> <div><p class="font-medium">Create a Zapier account</p> <p class="text-gray-600">Sign up at zapier.com if you don't have an account</p></div></div> <div class="flex gap-3"><span class="flex-shrink-0 w-6 h-6 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center text-xs font-medium">2</span> <div><p class="font-medium">Create a new Zap</p> <p class="text-gray-600">Choose "Webhooks by Zapier" as your trigger app</p></div></div> <div class="flex gap-3"><span class="flex-shrink-0 w-6 h-6 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center text-xs font-medium">3</span> <div><p class="font-medium">Get your webhook URL</p> <p class="text-gray-600">Copy the Catch Hook URL from Zapier and paste it above</p></div></div> <div class="flex gap-3"><span class="flex-shrink-0 w-6 h-6 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center text-xs font-medium">4</span> <div><p class="font-medium">Configure and save</p> <p class="text-gray-600">Choose your events, test the webhook, and save your settings</p></div></div></div></div>`),ze=h("<!> Save Integration",1),Oe=h('<div class="space-y-6"><!> <!> <!> <!> <div class="flex gap-4"><!></div></div>'),Re=h('<div class="w-full mx-auto p-6"><div class="mb-8"><div class="flex items-center gap-4 mb-4"><img src="https://img.promoamp.com/icons/zapier.svg" alt="Zapier" class="h-10 w-auto"/> <div><h1 class="text-2xl font-bold">Zapier Integration</h1> <p class="text-gray-600">Connect Promo Amp to thousands of apps through Zapier webhooks</p></div></div> <div class="flex items-center gap-4 text-sm text-gray-500"><a class="hover:text-gray-700">← Back to Integrations</a> <a href="https://zapier.com/apps/webhooks/help" target="_blank" class="flex items-center gap-1 hover:text-gray-700">Zapier Webhooks Guide <!></a></div></div> <!></div>');function tt(ae,se){be(se,!0);const oe=()=>Ze(Ie,"$page",re),[re,ie]=Ce(),ne=_e("user"),{currentTeam:F}=ne;let z=j(!1),S=j(!1),g=j(""),w=j(""),U=j(!1),x=j(ke({newEntry:!0,actionCompleted:!0,competitionCreated:!1,competitionEnded:!1}));ye(async()=>{await le()});async function le(){d(z,!0);try{const e=await fetch("/api/integrations/zapier/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:F.team.id})});if(e.ok){const r=await e.json();r.config&&(d(g,r.webhookUrl||"",!0),d(w,r.config.api_key||"",!0),d(U,r.config.enabled||!1,!0),d(x,{...a(x),...r.config.events},!0))}}catch(e){console.error("Failed to load Zapier integration:",e),m.error("Failed to load integration settings")}finally{d(z,!1)}}async function de(){if(!a(g).trim()){m.error("Please enter your Zapier webhook URL");return}d(S,!0);try{const e=await fetch("/api/integrations/zapier/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teamId:F.team.id,config:{api_key:a(w).trim(),webhook_url:a(g).trim(),enabled:a(U),events:a(x)}})});if(e.ok)m.success("Zapier integration saved successfully!");else{const r=await e.json();m.error(r.error||"Failed to save integration")}}catch(e){console.error("Failed to save Zapier integration:",e),m.error("Failed to save integration")}finally{d(S,!1)}}
4async function ce(){if(!a(g).trim()){m.error("Please enter a webhook URL");return}try{const e=await fetch("/api/integrations/zapier/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({webhookUrl:a(g).trim(),apiKey:a(w).trim(),teamId:F.team.id})});if(e.ok)m.success("Test webhook sent successfully!");else{const r=await e.json();m.error(r.error||"Failed to send test webhook")}}catch(e){console.error("Failed to test webhook:",e),m.error("Failed to send test webhook")}}function pe(){d(w,`zap_${crypto.randomUUID().replace(/-/g,"")}`)}var O=Re(),R=s(O),B=t(s(R),2),G=s(B),H=t(G,2),ve=t(s(H));Se(ve,{class:"w-3 h-3"}),o(H),o(B),o(R);var fe=t(R,2);{var me=e=>{var r=Ue(),T=s(r);te(T,{}),o(r),l(e,r)},ue=e=>{var r=Oe(),T=s(r);k(T,()=>E,(v,u)=>{u(v,{class:"p-6",children:(p,I)=>{var i=Te(),n=t(s(i),2);k(n,()=>N,(f,$)=>{$(f,{get checked(){return a(U)},set checked(y){d(U,y,!0)}})}),o(i),l(p,i)},$$slots:{default:!0}})});var J=t(T,2);k(J,()=>E,(v,u)=>{u(v,{class:"p-6",children:(p,I)=>{var i=Le(),n=t(s(i),2),f=s(n),$=s(f);ee($,{for:"webhookUrl",children:(c,A)=>{_();var b=L("Webhook URL");l(c,b)},$$slots:{default:!0}});var y=t($,2),W=s(y);Y(W,{id:"webhookUrl",placeholder:"https://hooks.zapier.com/hooks/catch/...",class:"flex-1",get value(){return a(g)},set value(c){d(g,c,!0)}}),o(y),_(2),o(f);var C=t(f,2),Z=s(C);ee(Z,{for:"apiKey",children:(c,A)=>{_();var b=L("Verification Token (optional)");l(c,b)},$$slots:{default:!0}});var P=t(Z,2),q=s(P);Y(q,{id:"apiKey",placeholder:"Optional shared secret for your Zap",class:"flex-1",get value(){return a(w)},set value(c){d(w,c,!0)}});var ge=t(q,2);K(ge,{variant:"outline",onclick:pe,children:(c,A)=>{_();var b=L("Generate");l(c,b)},$$slots:{default:!0}}),o(P),_(2),o(C),o(n);var Q=t(n,2),xe=s(Q);K(xe,{onclick:ce,variant:"outline",children:(c,A)=>{_();var b=L("Test Webhook");l(c,b)},$$slots:{default:!0}}),o(Q),o(i),l(p,i)},$$slots:{default:!0}})});var D=t(J,2);k(D,()=>E,(v,u)=>{u(v,{class:"p-6",children:(p,I)=>{var i=Ee(),n=t(s(i),2),f=s(n),$=t(s(f),2);k($,()=>N,(C,Z)=>{Z(C,{get checked(){return a(x).newEntry},set checked(P){a(x).newEntry=P}})}),o(f);var y=t(f,2),W=t(s(y),2);k(W,()=>N,(C,Z)=>{Z(C,{get checked(){return a(x).actionCompleted},set checked(P){a(x).actionCompleted=P}})}),o(y),o(n),o(i),l(p,i)},$$slots:{default:!0}})});var M=t(D,2);k(M,()=>E,(v,u)=>{u(v,{class:"p-6",children:(p,I)=>{var i=Fe();l(p,i)},$$slots:{default:!0}})});var V=t(M,2),he=s(V);K(he,{onclick:de,get disabled(){return a(S)},class:"px-8",children:(v,u)=>{var p=ze(),I=Pe(p);{var i=n=>{te(n,{class:"w-4 h-4 mr-2"})};X(I,n=>{a(S)&&n(i)})}_(),l(v,p)},$$slots:{default:!0}}),o(V),o(r),l(e,r)};X(fe,e=>{a(z)?e(me):e(ue,-1)})}o(O),we(()=>je(G,"href",`/brand/${oe().params.teamSlug??""}/settings/integrations`)),l(ae,O),$e(),ie()}export{tt as component};
5//# sourceMappingURL=54.B_sTADI_.js.map

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.