PageSourceSearch

https://app.churnkey.co/assets/index-ClapYV82.js

js churnkey.co collected 2026-09-24 20:14:05 UTC 6,850 bytes, 2 lines download raw bytes

1import{d as $,ae as A,s as w,v as V,a as l,b as s,l as b,i as M,e as x,j as a,w as f,m as p,F as C,r as _,g as O,o as i,E as y,af as T,t as d,n as h,ag as j,ah as z,B as S,ai as G}from"./index-V_hZsPnK.js";import{P as v,q as U}from"./PulseQuestion-CLZwWpu-.js";import{E as F}from"./index-BjvsloZK.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"[email protected]"}}catch{}})();try{(function(){var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new r.Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="a755cd24-0127-4e1f-a9b2-f0e7b63516ca",r._sentryDebugIdIdentifier="sentry-dbid-a755cd24-0127-4e1f-a9b2-f0e7b63516ca")})()}catch{}const Y={class:"max-w-4xl"},H={class:"flex items-center justify-between mb-6"},J={key:0,class:"text-sm font-semibold text-brand-brown"},K={key:1,class:"text-sm font-semibold text-brand-brown"},Q={key:2,class:"text-center py-20 bg-white border border-brand-sand rounded-2xl"},W={key:3,class:"divide-y divide-brand-sand border border-brand-sand rounded-xl bg-white"},X=["onClick"],Z={class:"min-w-0 flex-1"},ee={class:"text-sm font-semibold text-gray-900 truncate"},te={class:"mt-0.5 text-xs text-brand-medium-brown truncate"},se={key:0},ne={key:1},ae=["onClick"],oe={class:"mb-2.5"},ie={class:"text-sm font-semibold leading-5 text-gray-900"},le={class:"mt-0.5 text-xs leading-5 text-brand-medium-brown"},de=["aria-pressed","onClick"],re={key:0,class:"absolute right-3 top-3 flex h-5 w-5 items-center justify-center rounded-full bg-[#5e6ad2] text-white","aria-hidden":"true"},ue={class:"block pr-7 text-sm font-semibold leading-5 text-gray-900"},ce={class:"block mt-1.5 text-xs leading-[1.45] text-brand-medium-brown"},ge=$({__name:"index",setup(r){const o=A(),E=O(),k=w(!1),m=w(!1),g=w("nps"),P=new Set(["nps","csat","ces","pmf"]),q=[{id:"standard",name:"Standard measures",description:"Includes the standard scale and scoring",templates:v.filter(n=>P.has(n.id))},{id:"custom",name:"Create your own",description:"Choose how customers answer",templates:v.filter(n=>!P.has(n.id))}];V(D);function D(){o.fetchPulses()}function L(n){return n.triggerType==="action"?`After ${n.triggerAction}`:"Next visit"}async function B(){k.value=!0;try{const e=(v.find(u=>u.id===g.value)??v[0]).question(),t=await o.createPulse({name:"Untitled Pulse",questionConfig:e,triggerType:"immediate",frequencyMode:"once",samplingRate:100,holdoutPercentage:0,windowDays:7});t?(m.value=!1,E.push(`/pulse/manage/${t.id}`)):S.error("Could not create Pulse")}finally{k.value=!1}}function I(n){E.push(`/pulse/manage/${n.id}`)}async function N(n,e){try{e&&!n.publishedAt?await o.publish(n.id):await o.setEnabled(n.id,e)}catch{S.error("Could not update Pulse")}}async function R(n){try{await G.confirm(`Delete "${n.name}"? This can't be undone.`,"Delete Pulse",{confirmButtonText:"Delete",cancelButtonText:"Cancel",type:"warning"}),await o.deletePulse(n.id)}catch{}}return(n,e)=>(i(),l("div",Y,[s("div",H,[e[6]||(e[6]=s("h2",{class:"text-xl font-bold text-gray-900"},"Pulses",-1)),a(o).pulses.length?(i(),M(a(y),{key:0,type:"primary",onClick:e[0]||(e[0]=t=>m.value=!0)},{default:f(()=>[...e[5]||(e[5]=[p("New Pulse",-1)])]),_:1})):x("",!0)]),a(o).loadState===a(T).LOADING?(i(),l("p",J," Loading… ")):a(o).loadState===a(T).ERROR_LOADING?(i(),l("div",K,[e[8]||(e[8]=p(" Couldn't load Pulses. ",-1)),b(a(y),{size:"small",onClick:D},{default:f(()=>[...e[7]||(e[7]=[p("Retry",-1)])]),_:1})])):a(o).pulses.length?(i(),l("div",W,[(i(!0),l(C,null,_(a(o).pulses,t=>(i(),l("div",{key:t.id,class:"flex items-center gap-4 px-5 py-4 cursor-pointer hover:bg-brand-light-sand/40 transition-colors group first:rounded-t-xl last:rounded-b-xl",onClick:u=>I(t)},[s("div",Z,[s("p",ee,d(t.questionConfig?.prompt||t.question),1),s("p",te,[p(d(t.name)+" · "+d(L(t)),1),t.questionConfig?(i(),l("span",se," · "+d(a(U)(t.questionConfig.kind)),1)):x("",!0),t.samplingRate!==100?(i(),l("span",ne," · "+d(t.samplingRate)+"%",1)):x("",!0)])]),s("span",{class:h(["text-xs font-bold px-2.5 py-0.5 rounded-full shrink-0",t.enabled?"bg-green-100 text-green-800":"bg-brand-light-sand text-brand-medium-brown"])},d(t.enabled?"Live":t.publishedAt?"Off":"Draft"),3),s("div",{class:"shrink-0 flex items-center gap-3",onClick:e[2]||(e[2]=j(()=>{},["stop"]))},[b(a(F),{"model-value":t.enabled,size:"small",onChange:u=>N(t,!!u)},null,8,["model-value","onChange"]),s("button",{type:"button",class:"text-xs font-semibold text-brand-medium-brown opacity-0 group-hover:opacity-100 hover:text-red-600 transition-all",onClick:u=>R(t)}," Delete ",8,ae)])],8,X))),128))])):(i(),l("div",Q,[e[10]||(e[10]=s("h3",{class:"text-2xl font-bold tracking-tight text-gray-900"},"Ask your first question.",-1)),e[11]||(e[11]=s("p",{class:"mt-2 text-md text-brand-brown max-w-md mx-auto"}," Create a short survey and choose when it appears in your product. ",-1)),b(a(y),{type:"primary",class:"mt-6",onClick:e[1]||(e[1]=t=>m.value=!0)},{default:f(()=>[...e[9]||(e[9]=[p("New Pulse",-1)])]),_:1})])),b(a(z),{modelValue:m.value,"onUpdate:modelValue":e[4]||(e[4]=t=>m.value=t),class:"pulse-template-dialog",title:"Start with a question",width:"680px","align-center":""},{footer:f(()=>[b(a(y),{onClick:e[3]||(e[3]=t=>m.value=!1)},{default:f(()=>[...e[13]||(e[13]=[p("Cancel",-1)])]),_:1}),b(a(y),{type:"primary",loading:k.value,onClick:B},{default:f(()=>[...e[14]||(e[14]=[p("Continue",-1)])]),_:1},8,["loading"])]),default:f(()=>[e[15]||(e[15]=s("p",{class:"pulse-template-dialog__intro"}," Choose a survey type. You can edit the question and settings before publishing. ",-1)),(i(),l(C,null,_(q,(t,u)=>s("section",{key:t.id,class:h(u?"mt-6":"")},[s("div",oe,[s("h3",ie,d(t.name),1),s("p",le,d(t.description),1)]),s("div",{class:h(["grid grid-cols-1 gap-3",t.id==="standard"?"sm:grid-cols-2":"sm:grid-cols-3"])},[(i(!0),l(C,null,_(t.templates,c=>(i(),l("button",{key:c.id,type:"button",class:h(["group relative min-h-24 text-left rounded-xl border px-4 py-3.5 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#5e6ad2]/30",g.value===c.id?"border-[#5e6ad2] bg-[#5e6ad2]/[0.05] shadow-sm":"border-brand-sand bg-white hover:border-brand-medium-brown hover:bg-brand-light-sand/20"]),"aria-pressed":g.value===c.id,onClick:fe=>g.value=c.id},[g.value===c.id?(i(),l("span",re,[...e[12]||(e[12]=[s("svg",{viewBox:"0 0 16 16",class:"h-3 w-3",fill:"none"},[s("path",{d:"m4 8.25 2.4 2.4L12 5.5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):x("",!0),s("span",ue,d(c.name),1),s("span",ce,d(c.description),1)],10,de))),128))],2)],2)),64))]),_:1},8,["modelValue"])]))}});
1export{ge as default};
2//# sourceMappingURL=index-ClapYV82.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.