PageSourceSearch

https://app.hightouch.com/assets/index-C3zbKTe2.js

js hightouch.com collected 2026-09-24 07:24:01 UTC 35,847 bytes, 7 lines download raw bytes

1import{bR as dt,fK as ut,bS as Se,bQ as K,fL as ht,fM as ft,fN as gt,dZ as mt,fO as pt,fP as we,fQ as G,bT as xt,cg as bt,ao as M,af as r,r as b,bN as yt,an as vt,fR as jt,bw as St}from"./vendor-B2oIjyY4.js";import{R as C,B as D,T,C as J,b0 as We,aG as Ge,gc as wt,a as kt,cu as Ue,mg as Et,S as Ct,TC as Tt,ru as It,TD as Rt,h as Bt,am as de,dH as Ot,i as be,is as Dt,az as Nt,dq as Je,ae as At,aa as Pt,fr as Mt,cr as _t,an as le,ay as Te,g8 as Ie,ry as Ft,rA as Ae,fa as Lt,gN as $t,de as zt,L as Wt,eo as Gt}from"./main-CJK8sxkW.js";import{d as Ut}from"./index-cjBYrcFE.js";import{g as Ve,e as Pe,E as Jt}from"./utils-DnDWukUz.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";class Vt{constructor(t,n,s){this.from=t,this.to=n,this.diagnostic=s}}class X{constructor(t,n,s){this.diagnostics=t,this.panel=n,this.selected=s}static init(t,n,s){let o=t,i=s.facet(U).markerFilter;i&&(o=i(o,s));let a=K.set(o.map(c=>c.from==c.to||c.from==c.to-1&&s.doc.lineAt(c.from).to==c.from?K.widget({widget:new tn(c),diagnostic:c}).range(c.from):K.mark({attributes:{class:"cm-lintRange cm-lintRange-"+c.severity+(c.markClass?" "+c.markClass:"")},diagnostic:c,inclusive:!0}).range(c.from,c.to)),!0);return new X(a,n,se(a))}}function se(e,t=null,n=0){let s=null;return e.between(n,1e9,(o,i,{spec:a})=>{if(!(t&&a.diagnostic!=t))return s=new Vt(o,i,a.diagnostic),!1}),s}function Ht(e,t){let n=t.pos,s=t.end||n,o=e.state.facet(U).hideOn(e,n,s);if(o!=null)return o;let i=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(a=>a.is(Re))||e.changes.touchesRange(i.from,Math.max(i.to,s)))}function Yt(e,t){return e.field($,!1)?t:t.concat(we.appendConfig.of(Xe))}function qt(e,t){return{effects:Yt(e,[Re.of(t)])}}const Re=we.define(),He=we.define(),Ye=we.define(),$=ft.define({create(){return new X(K.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),s=null,o=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);s=se(n,e.selected.diagnostic,i)||se(n,null,i)}!n.size&&o&&t.state.facet(U).autoPanel&&(o=null),e=new X(n,o,s)}for(let n of t.effects)if(n.is(Re)){let s=t.state.facet(U).autoPanel?n.value.length?ye.open:null:e.panel;e=X.init(n.value,s,t.state)}else n.is(He)?e=new X(e.diagnostics,n.value?ye.open:null,e.selected):n.is(Ye)&&(e=new X(e.diagnostics,e.panel,n.value));return e},provide:e=>[gt.from(e,t=>t.panel),Se.decorations.from(e,t=>t.diagnostics)]}),Qt=K.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function Xt(e,t,n){let{diagnostics:s}=e.state.field($),o=[],i=2e8,a=0;s.between(t-(n<0?1:0),t+(n>0?1:0),(d,x,{spec:f})=>{t>=d&&t<=x&&(d==x||(t>d||n>0)&&(t<x||n<0))&&(o.push(f.diagnostic),i=Math.min(d,i),a=Math.max(x,a))});let c=e.state.facet(U).tooltipFilter;return c&&(o=c(o,e.state)),o.length?{pos:i,end:a,above:e.state.doc.lineAt(i).to<a,create(){return{dom:Kt(e,o)}}}:null}function Kt(e,t){return G("ul",{class:"cm-tooltip-lint"},t.map(n=>Qe(e,n,!1)))}const Me=e=>{let t=e.state.field($,!1);return!t||!t.panel?!1:(e.dispatch({effects:He.of(!1)}),!0)},Zt=dt.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(U);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:t}=this.view,{sources:n}=t.facet(U);n.length&&Promise.all(n.map(s=>Promise.resolve(s(this.view)))).then(s=>{let o=s.reduce((i,a)=>i.concat(a));this.view.state.doc==t.doc&&this.view.dispatch(qt(this.view.state,o))},s=>{ut(this.view.state,s)})}}update(e){let t=e.state.facet(U);(e.docChanged||t!=e.startState.facet(U)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),U=mt.define({combine(e){return Object.assign({sources:e.map(t=>t.source).filter(t=>t!=null)},pt(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(t,n)=>t?n?s=>t(s)||n(s):t:n}))}});function en(e,t={}){return[U.of({source:e,config:t}),Zt,Xe]}function qe(e){let t=[];if(e)e:for(let{name:n}of e){for(let s=0;s<n.length;s++){let o=n[s];if(/[a-zA-Z]/.test(o)&&!t.some(i=>i.toLowerCase()==o.toLowerCase())){t.push(o);continue e}}t.push("")}return t}function Qe(e,t,n){var s;let o=n?qe(t.actions):[];return G("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},G("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(s=t.actions)===null||s===void 0?void 0:s.map((i,a)=>{let c=!1,d=R=>{if(R.preventDefault(),c)return;c=!0;let B=se(e.state.field($).diagnostics,t);B&&i.apply(e,B.from,B.to)},{name:x}=i,f=o[a]?x.indexOf(o[a]):-1,E=f<0?x:[x.slice(0,f),G("u",x.slice(f,f+1)),x.slice(f+1)];return G("button",{type:"button",class:"cm-diagnosticAction",onclick:d,onmousedown:d,"aria-label":` Action: ${x}${f<0?"":` (access key "${o[a]})"`}.`},E)}),t.source&&G("div",{class:"cm-diagnosticSource"},t.source))}class tn extends xt{constructor(t){super(),this.diagnostic=t}eq(t){return t.diagnostic==this.diagnostic}toDOM(){return G("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class _e{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Qe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ye{constructor(t){this.view=t,this.items=[];let n=o=>
vendor: 5,353 bytes, line 1
1{if(o.keyCode==27)Me(this.view),this.view.focus();else if(o.keyCode==38||o.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(o.keyCode==40||o.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(o.keyCode==36)this.moveSelection(0);else if(o.keyCode==35)this.moveSelection(this.items.length-1);else if(o.keyCode==13)this.view.focus();else if(o.keyCode>=65&&o.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],a=qe(i.actions);for(let c=0;c<a.length;c++)if(a[c].toUpperCase().charCodeAt(0)==o.keyCode){let d=se(this.view.state.field($).diagnostics,i);d&&i.actions[c].apply(t,d.from,d.to)}}else return;o.preventDefault()},s=o=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(o.target)&&this.moveSelection(i)};this.list=G("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:s}),this.dom=G("div",{class:"cm-panel-lint"},this.list,G("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Me(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field($).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field($),s=0,o=!1,i=null;for(t.between(0,this.view.state.doc.length,(a,c,{spec:d})=>{let x=-1,f;for(let E=s;E<this.items.length;E++)if(this.items[E].diagnostic==d.diagnostic){x=E;break}x<0?(f=new _e(this.view,d.diagnostic),this.items.splice(s,0,f),o=!0):(f=this.items[x],x>s&&(this.items.splice(s,x-s),o=!0)),n&&f.diagnostic==n.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),i=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),s++});s<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();this.items.length==0&&(this.items.push(new _e(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:c})=>{let d=c.height/this.list.offsetHeight;a.top<c.top?this.list.scrollTop-=(c.top-a.top)/d:a.bottom>c.bottom&&(this.list.scrollTop+=(a.bottom-c.bottom)/d)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let t=this.list.firstChild;function n(){let s=t;t=s.nextSibling,s.remove()}for(let s of this.items)if(s.dom.parentNode==this.list){for(;t!=s.dom;)n();t=s.dom.nextSibling}else this.list.insertBefore(s.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field($),s=se(n.diagnostics,this.items[t].diagnostic);s&&this.view.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:Ye.of(s)})}static open(t){return new ye(t)}}function nn(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function pe(e){return nn(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const rn=Se.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:pe("#d11")},".cm-lintRange-warning":{backgroundImage:pe("orange")},".cm-lintRange-info":{backgroundImage:pe("#999")},".cm-lintRange-hint":{backgroundImage:pe("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),Xe=[$,Se.decorations.compute([$],e=>{let{selected:t,panel:n}=e.field($);return!t||!n||t.from==t.to?K.none:K.set([Qt.range(t.from,t.to)])}),ht(Xt,{hideOn:Ht}),rn];var xe={},Fe;function sn(){if(Fe)return xe;
1Fe=1;var e={b:"\b",f:"\f",n:`
2`,r:"\r",t:"	",'"':'"',"/":"/","\\":"\\"},t=97;xe.parse=function(g,me,F){var j={},A=0,S=0,u=0,Z=F&&F.bigint&&typeof BigInt<"u";return{data:q("",!0),pointers:j};function q(l,h){_();var m;W(l,"value");var w=k();switch(w){case"t":H("rue"),m=!0;break;case"f":H("alse"),m=!1;break;case"n":H("ull"),m=null;break;case'"':m=ee();break;case"[":m=oe(l);break;case"{":m=Q(l);break;default:V(),"-0123456789".indexOf(w)>=0?m=te():O()}return W(l,"valueEnd"),_(),h&&u<g.length&&O(),m}function _(){e:for(;u<g.length;){switch(g[u]){case" ":S++;break;case"	":S+=4;break;case"\r":S=0;break;case`
3`:S=0,A++;break;default:break e}u++}}function ee(){for(var l="",h;h=k(),h!='"';)h=="\\"?(h=k(),h in e?l+=e[h]:h=="u"?l+=y():P()):l+=h;return l}function te(){var l="",h=!0;g[u]=="-"&&(l+=k()),l+=g[u]=="0"?k():z(),g[u]=="."&&(l+=k()+z(),h=!1),(g[u]=="e"||g[u]=="E")&&(l+=k(),(g[u]=="+"||g[u]=="-")&&(l+=k()),l+=z(),h=!1);var m=+l;return Z&&h&&(m>Number.MAX_SAFE_INTEGER||m<Number.MIN_SAFE_INTEGER)?BigInt(l):m}function oe(l){_();var h=[],m=0;if(k()=="]")return h;for(V();;){var w=l+"/"+m;h.push(q(w)),_();var I=k();if(I=="]")break;I!=","&&P(),_(),m++}return h}function Q(l){_();var h={};if(k()=="}")return h;for(V();;){var m=p();k()!='"'&&P();var w=ee(),I=l+"/"+B(w);ae(I,"key",m),W(I,"keyEnd"),_(),k()!=":"&&P(),_(),h[w]=q(I),_();var L=k();if(L=="}")break;L!=","&&P(),_()}return h}function H(l){for(var h=0;h<l.length;h++)k()!==l[h]&&P()}function k(){ce();var l=g[u];return u++,S++,l}function V(){u--,S--}function y(){for(var l=4,h=0;l--;){h<<=4;var m=k().toLowerCase();m>="a"&&m<="f"?h+=m.charCodeAt()-t+10:m>="0"&&m<="9"?h+=+m:P()}return String.fromCharCode(h)}function z(){for(var l="";g[u]>="0"&&g[u]<="9";)l+=k();if(l.length)return l;ce(),O()}function W(l,h){ae(l,h,p())}function ae(l,h,m){j[l]=j[l]||{},j[l][h]=m}function p(){return{line:A,column:S,pos:u}}function O(){throw new SyntaxError("Unexpected token "+g[u]+" in JSON at position "+u)}function P(){V(),O()}function ce(){if(u>=g.length)throw new SyntaxError("Unexpected end of JSON input")}},xe.stringify=function(g,me,F){if(!s(g))return;var j=0,A,S,u=typeof F=="object"?F.space:F;switch(typeof u){case"number":var Z=u>10?10:u<0?0:Math.floor(u);u=Z&&ae(Z," "),A=Z,S=Z;break;case"string":u=u.slice(0,10),A=0,S=0;for(var q=0;q<u.length;q++){var _=u[q];switch(_){case" ":S++;break;case"	":S+=4;break;case"\r":S=0;break;case`
4`:S=0,j++;break;default:throw new Error("whitespace characters not allowed in JSON")}A++}break;default:u=void 0}var ee="",te={},oe=0,Q=0,H=0,k=F&&F.es6&&typeof Map=="function";return V(g,0,""),{json:ee,pointers:te};function V(p,O,P){switch(W(P,"value"),typeof p){case"number":case"bigint":case"boolean":y(""+p);break;case"string":y(f(p));break;case"object":p===null?y("null"):typeof p.toJSON=="function"?y(f(p.toJSON())):Array.isArray(p)?ce():k?p.constructor.BYTES_PER_ELEMENT?ce():p instanceof Map?h():p instanceof Set?h(!0):l():l()}W(P,"valueEnd");function ce(){if(p.length){y("[");for(var m=O+1,w=0;w<p.length;w++){w&&y(","),z(m);var I=s(p[w])?p[w]:null,L=P+"/"+w;V(I,m,L)}z(O),y("]")}else y("[]")}function l(){var m=Object.keys(p);if(m.length){y("{");for(var w=O+1,I=0;I<m.length;I++){var L=m[I],ne=p[L];if(s(ne)){I&&y(",");var re=P+"/"+B(L);z(w),W(re,"key"),y(f(L)),W(re,"keyEnd"),y(":"),u&&y(" "),V(ne,w,re)}}z(O),y("}")}else y("{}")}function h(m){if(p.size){y("{");for(var w=O+1,I=!0,L=p.entries(),ne=L.next();!ne.done;){var re=ne.value,De=re[0],Ne=m?!0:re[1];if(s(Ne)){I||y(","),I=!1;var Ce=P+"/"+B(De);z(w),W(Ce,"key"),y(f(De)),W(Ce,"keyEnd"),y(":"),u&&y(" "),V(Ne,w,Ce)}ne=L.next()}z(O),y("}")}else y("{}")}}function y(p){Q+=p.length,H+=p.length,ee+=p}function z(p){if(u){for(ee+=`
5`+ae(p,u),oe++,Q=0;p--;)j?(oe+=j,Q=S):Q+=S,H+=A;H+=1}}function W(p,O){te[p]=te[p]||{},te[p][O]={line:oe,column:Q,pos:H}}function ae(p,O){return Array(p+1).join(O)}};var n=["number","bigint","boolean","string","object"];function s(g){return n.indexOf(typeof g)>=0}var o=/"|\\/g,i=/[\b]/g,a=/\f/g,c=/\n/g,d=/\r/g,x=/\t/g;function f(g){return g=g.replace(o,"\\$&").replace(a,"\\f").replace(i,"\\b").replace(c,"\\n").replace(d,"\\r").replace(x,"\\t"),'"'+g+'"'}var E=/~/g,R=/\//g;function B(g){return g.replace(E,"~0").replace(R,"~1")}return xe}var on=sn();const an=bt(on),cn="/assets/debugger-empty-state-DXhZrq2a.svg",ke="parent_model_evaluation",Ke="journey_evaluation";var v=(e=>(e.Accepted="accepted",e.Rejected="rejected",e.Filtered="filtered",e.Error="error",e))(v||{}),N=(e=>(e.Moved="moved",e.Unchanged="unchanged",e.Error="error",e))(N||{});function ln(e){const t=new Set(e.map(i=>i.spanId)),n=M.groupBy(e.filter(i=>i.parentSpanId&&t.has(i.parentSpanId)),i=>i.parentSpanId),s=i=>!i.parentSpanId||!t.has(i.parentSpanId),o=i=>({...i,children:M.sortBy(n[i.spanId]??[],a=>a.startTime).map(o)});return e.filter(s).map(o)}function ue(e){return[e,...e.children].reduce((t,n)=>n.status==="ERROR"?"error":t,"ok")}function Ze(e,t,n){if(e.some(o=>o.status==="ERROR"))return v.Error;if(t.length===0)return n;const s=t.map(o=>o.result);return s.includes(v.Rejected)?v.Rejected:s.includes(v.Accepted)?v.Accepted:v.Filtered}function Ee(e){return e.warehouseSync?e.warehouseSync.syncName??e.warehouseSync.syncSlug:e.forwardingSync?e.forwardingSync.syncName??e.forwardingSync.syncSlug:e.audience?e.audience.modelName??e.audience.modelSlug??"Audience":e.journey&&e.step===Ke?e.journey.journeyName:{routing:"Event Router",forwarding:"Forwarding",warehousing:"Warehousing",audience_evaluation:"Audience Evaluation",parent_model_evaluation:"Realtime Audiences",journey_evaluation:"Realtime Journey"}[e.step]??e.step}function dn(e){return Ze([e],[...e.decisions,...e.children.flatMap(t=>t.decisions)],v.Accepted)}function et(){return{[v.Accepted]:[],[v.Rejected]:[],[v.Filtered]:[],[v.Error]:[]}}function un(e){return{syncsByOutcome:{...et(),...M.groupBy(e,dn)}}}function tt(e){return e.children.flatMap(t=>t.step===ke?[t]:tt(t))}function nt(e){return[...e.children.filter(t=>t.step!==ke),...tt(e).flatMap(nt)]}function hn(e){return e.some(n=>n.status==="ERROR")?N.Error:e.some(n=>n.decisions.some(s=>s.result==="accepted"))?N.Moved:N.Unchanged}function fn(e){const t=Object.values(M.mapValues(M.groupBy(e,n=>{var s;return((s=n.journey)==null?void 0:s.journeyId)??n.spanId}),n=>{var o,i;const s=n[0];return{journeyId:((o=s.journey)==null?void 0:o.journeyId)??s.spanId,journeyName:((i=s.journey)==null?void 0:i.journeyName)??Ee(s),steps:n,outcome:hn(n)}}));return{journeyGroups:t,journeyGroupsByOutcome:{[N.Moved]:[],[N.Unchanged]:[],[N.Error]:[],...M.groupBy(t,n=>n.outcome)}}}function rt(e){const[t,n]=M.partition(nt(e),s=>s.step===Ke);return{...gn(n),...fn(t)}}function gn(e){const[t,n]=M.partition(e,i=>i.audience),s=Object.values(M.mapValues(M.groupBy(t,i=>i.audience.modelId),i=>{const a=i[0],c=i.flatMap(d=>d.decisions);return{modelId:a.audience.modelId,modelName:a.audience.modelName,modelSlug:a.audience.modelSlug,childSpans:i,outcome:Ze(i,c,v.Filtered)}})),o={...et(),...M.groupBy(s,i=>i.outcome)};
5return{audienceChildren:t,nonAudienceChildren:n,audienceGroups:s,audienceGroupsByOutcome:o}}const mn=({status:e})=>e==="ok"?r.jsx(We,{color:"success.base"}):r.jsx(Ge,{color:"danger.base"}),st=({expanded:e})=>r.jsx(D,{boxSize:4,color:"text.secondary",flexShrink:0,as:e?wt:kt}),pn=40,xn=16,it=({node:e,depth:t})=>{var a;const[n,s]=b.useState(!1),o=(((a=e.children)==null?void 0:a.length)??0)>0,i=`${pn+t*xn}px`;return r.jsxs(r.Fragment,{children:[r.jsxs(C,{pl:i,pr:4,py:2,gap:2,align:"center",justify:"space-between",borderTopWidth:"hairline",borderTopStyle:"solid",borderColor:"base.border",bg:e.bg,cursor:o?"pointer":"default",_hover:o?{bg:e.hoverBg??"base.background"}:void 0,onClick:o?()=>s(!n):void 0,children:[r.jsxs(C,{gap:2,align:"center",children:[e.content,o&&r.jsx(st,{expanded:n})]}),e.right&&r.jsx(C,{gap:3,align:"center",flexShrink:0,children:e.right})]}),n&&e.children.map(c=>r.jsx(it,{node:c,depth:t+1},c.key))]})},ie=({nodes:e,depth:t=0})=>r.jsx(r.Fragment,{children:e.map(n=>r.jsx(it,{node:n,depth:t},n.key))}),he=({label:e,status:t,expanded:n,onToggle:s})=>r.jsx(C,{px:4,py:3,gap:3,align:"center",justify:"space-between",cursor:s?"pointer":void 0,_hover:s?{bg:"base.background"}:void 0,onClick:s,children:r.jsxs(C,{gap:2,align:"center",children:[r.jsx(D,{sx:{svg:{h:5,w:5}},flexShrink:0,children:r.jsx(mn,{status:t})}),r.jsx(T,{fontWeight:"medium",children:e}),n!=null&&r.jsx(st,{expanded:n})]})}),bn={accepted:{icon:We,color:"success.base"},rejected:{icon:Ge,color:"danger.base"},filtered:{icon:Et,color:"text.tertiary"}},yn=({result:e,reason:t})=>{const{icon:n,color:s}=bn[e],o=e==="filtered";return r.jsxs(C,{gap:2,align:"flex-start",children:[r.jsx(D,{as:n,color:s,flexShrink:0}),r.jsx(T,{size:"sm",color:o?"text.tertiary":void 0,fontWeight:o?void 0:"medium",children:t})]})};function fe(e){return e.map((t,n)=>({key:`${t.result}-${t.reason}-${n}`,content:r.jsx(yn,{result:t.result,reason:t.reason})}))}const vn=({decisions:e})=>r.jsx(ie,{nodes:fe(e)});function ge(e,t=!0){const n=Ee(e),s=ue(e),o=t&&s==="error";return{key:e.spanId,bg:o?"danger.background":void 0,hoverBg:o?"danger.background":void 0,content:r.jsx(T,{size:"sm",fontWeight:"medium",color:o?"danger.base":void 0,children:n}),children:[...fe(e.decisions),...e.children.map(i=>ge(i,t))]}}function ve(e){return[...e.decisions.map(t=>`${t.result}:${t.reason}`),...e.children.map(t=>t.step)].join(`
6`)}function jn(e,t){const n=e[0];return e.every(s=>ve(s)===ve(n))?t(n):e.map((s,o)=>({key:s.spanId,content:r.jsxs(T,{size:"sm",fontWeight:"medium",children:["Step ",o+1]}),children:t(s)}))}function Sn(e){return[...fe(e.decisions),...e.children.map(t=>ge(t,!1))]}function wn(e){const t=e.modelName??e.modelSlug??`Audience ${e.modelId}`,n=e.outcome===v.Error;return{key:e.modelId,bg:n?"danger.background":void 0,hoverBg:n?"danger.background":void 0,content:r.jsx(T,{size:"sm",fontWeight:"medium",color:n?"danger.base":void 0,children:t}),children:jn(e.childSpans,Sn)}}function Le(e){return[...fe(e.decisions),...e.children.filter(t=>t.step!==ke).map(t=>ge(t,!1))]}function kn(e){const t=e[0];return e.every(n=>ve(n)===ve(t))?Le(t):e.flatMap(n=>Le(n).map(s=>({...s,key:`${n.spanId}-${s.key}`})))}function En(e){const t=e.outcome===N.Error;return{key:e.journeyId,bg:t?"danger.background":void 0,hoverBg:t?"danger.background":void 0,content:r.jsx(T,{size:"sm",fontWeight:"medium",color:t?"danger.base":void 0,children:e.journeyName}),children:kn(e.steps)}}const je=({span:e,showStatus:t=!0})=>r.jsx(ie,{nodes:[ge(e,t)]}),Cn=({node:e})=>{const[t,n]=b.useState(!0);return r.jsxs(J,{children:[r.jsx(he,{label:Ee(e),status:ue(e),expanded:t,onToggle:()=>n(!t)}),t&&r.jsx(ie,{nodes:fe(e.decisions)})]})},ot={[v.Accepted]:{label:"accepted",variant:"success"},[v.Rejected]:{label:"rejected",variant:"warning"},[v.Filtered]:{label:"filtered",variant:"inactive"},[v.Error]:{label:"failed",variant:"error"}},at=[v.Accepted,v.Rejected,v.Error,v.Filtered],Tn={[N.Moved]:{label:"moved",variant:"success"},[N.Unchanged]:{label:"unchanged",variant:"inactive"},[N.Error]:{label:"failed",variant:"error"}},In=[N.Moved,N.Error,N.Unchanged];function Be(e,t,n){return n.length===0?null:{key:e,content:r.jsxs(r.Fragment,{children:[r.jsx(Ue,{variant:t.variant}),r.jsxs(T,{size:"sm",color:"text.secondary",children:[n.length," ",t.label]})]}),children:n}}const ct=({groups:e,groupsByOutcome:t})=>{const[n,s]=b.useState(!1),i=t[v.Error].length>0?"error":"ok",a=at.map(c=>Be(c,ot[c],(t[c]??[]).map(d=>wn(d)))).filter(c=>c!=null);return r.jsxs(J,{children:[r.jsx(he,{label:`Forwarded to ${e.length}
6 realtime ${e.length===1?"audience":"audiences"}`,status:i,expanded:n,onToggle:()=>s(!n)}),n&&r.jsx(ie,{nodes:a})]})},Rn=({syncs:e,syncsByOutcome:t})=>{const[n,s]=b.useState(!1),i=t[v.Error].length>0?"error":"ok",a=at.map(c=>Be(c,ot[c],(t[c]??[]).map(d=>ge(d,!1)))).filter(c=>c!=null);return r.jsxs(J,{children:[r.jsx(he,{label:`Forwarded to ${e.length} event ${e.length===1?"sync":"syncs"}`,status:i,expanded:n,onToggle:()=>s(!n)}),n&&r.jsx(ie,{nodes:a})]})},lt=({groups:e,groupsByOutcome:t})=>{const[n,s]=b.useState(!1),i=t[N.Error].length>0?"error":"ok",a=In.map(c=>Be(c,Tn[c],(t[c]??[]).map(d=>En(d)))).filter(c=>c!=null);return r.jsxs(J,{children:[r.jsx(he,{label:`Evaluated ${e.length} realtime ${e.length===1?"journey":"journeys"}`,status:i,expanded:n,onToggle:()=>s(!n)}),n&&r.jsx(ie,{nodes:a})]})};function Bn(e,t){var x,f;const n=b.useRef(null),s=b.useRef(0),[o,i]=b.useState(!0),a=Tt({input:{sourceId:e,eventId:t}},{enabled:!!(e&&t)&&o,refetchInterval:o?1e3:!1,refetchIntervalInBackground:!0,staleTime:0}),c=((f=(x=a.data)==null?void 0:x.getEventTrace)==null?void 0:f.spans)??null,d=a.dataUpdatedAt;return b.useEffect(()=>{d===0||!c||(c===n.current?(s.current+=1,s.current>=15&&i(!1)):(n.current=c,s.current=0))},[d,c]),b.useEffect(()=>{n.current=null,s.current=0,i(!0)},[t]),{spans:c,isLoading:a.isLoading}}const On=({sourceId:e,eventId:t})=>{const{spans:n,isLoading:s}=Bn(e,t);if(s&&!n)return r.jsxs(J,{align:"center",justify:"center",height:"100%",gap:2,children:[r.jsx(Ct,{size:"lg"}),r.jsx(T,{color:"text.secondary",children:"Loading trace…"})]});if(!n||n.length===0)return r.jsx(J,{align:"center",justify:"center",height:"100%",gap:2,children:r.jsx(T,{color:"text.secondary",children:"No trace available for this event."})});const o=ln(n);return r.jsx(J,{gap:2,p:2,children:o.map(i=>r.jsx(Nn,{node:i},i.spanId))})};function Dn(e){const t=M.groupBy(e,n=>n.step==="forwarding"||n.forwardingSync?"forwardingSyncs":n.step==="warehousing"||n.warehouseSync?"warehouseSyncs":n.step===ke?"audienceParents":"otherChildren");return{forwardingSyncs:t.forwardingSyncs??[],warehouseSyncs:t.warehouseSyncs??[],audienceParents:t.audienceParents??[],otherChildren:t.otherChildren??[]}}const Nn=({node:e})=>{const t=ue(e),n=e.step==="routing",s=b.useMemo(()=>n?Dn(e.children):null,[n,e.children]),o=b.useMemo(()=>s&&s.forwardingSyncs.length>0?un(s.forwardingSyncs):null,[s]),i=b.useMemo(()=>n?null:rt(e),[n,e]);if(!n){const a=Ee(e);return r.jsxs(Y,{status:t,children:[r.jsx(he,{label:a,status:t}),e.children.length===0&&e.decisions.length>0&&r.jsx(vn,{decisions:e.decisions}),i==null?void 0:i.nonAudienceChildren.map(c=>r.jsx(je,{span:c},c.spanId)),i&&i.audienceGroups.length>0&&r.jsx(ct,{groups:i.audienceGroups,groupsByOutcome:i.audienceGroupsByOutcome}),i&&i.journeyGroups.length>0&&r.jsx(lt,{groups:i.journeyGroups,groupsByOutcome:i.journeyGroupsByOutcome})]})}return r.jsxs(r.Fragment,{children:[r.jsx(Y,{status:t,children:r.jsx(Cn,{node:e})}),s&&o&&s.forwardingSyncs.length>0&&r.jsx(Y,{children:r.jsx(Rn,{syncs:s.forwardingSyncs,syncsByOutcome:o.syncsByOutcome})}),s==null?void 0:s.warehouseSyncs.map(a=>r.jsx(An,{span:a},a.spanId)),s==null?void 0:s.audienceParents.map(a=>r.jsx(Pn,{node:a},a.spanId)),s==null?void 0:s.otherChildren.map(a=>r.jsx(Y,{children:r.jsx(je,{span:a})},a.spanId))]})},Y=({status:e,children:t})=>r.jsx(D,{borderWidth:"hairline",borderStyle:"solid",borderColor:"base.border",borderRadius:"md",overflow:"hidden",bg:e==="error"?"danger.background":void 0,children:t}),An=({span:e})=>{const t=ue(e);return r.jsx(Y,{status:t,children:r.jsx(je,{span:e})})},Pn=({node:e})=>{const{audienceGroups:t,audienceGroupsByOutcome:n,journeyGroups:s,journeyGroupsByOutcome:o,nonAudienceChildren:i}=b.useMemo(()=>rt(e),[e]);return r.jsxs(r.Fragment,{children:[t.length>0&&r.jsx(Y,{children:r.jsx(ct,{groups:t,groupsByOutcome:n})}),s.length>0&&r.jsx(Y,{children:r.jsx(lt,{groups:s,groupsByOutcome:o})}),i.map(a=>r.jsx(Y,{status:ue(a),children:r.jsx(je,{span:a})},a.spanId))]})},Vn=()=>{const{source:t}=It(),[n,s]=b.useState([]),[o,i]=b.useState([]),[a,c]=b.useState(),[d,x]=b.useState(),f=b.useRef(0),{isRunning:E,pause:R,restart:B}=Ut.useTimer({expiryTimestamp:new Date(Date.now()+36e5),autoStart:!0}),[g,me]=b.useState(""),F=(()=>{var S,u;if(n.length===0)return"100";const j=Math.abs((((S=n[0])==null?void 0:S.rateLimitIgnoredCount)??0)-(((u=n[n.length-1])==null?void 0:u.rateLimitIgnoredCount)??0)),A=100*(n.length/(n.length+j));return A<1&&j>0?"<1":A.toFixed(0)})();return Rt({input:{sourceId:t.id,lastSeenEventId:d}}
6,{refetchInterval:E?2e3:0,refetchIntervalInBackground:!0,select:j=>j.getLiveSourceEvents,onSuccess:j=>{if(j){j.latestEventId&&x(j.latestEventId);const A=j.events;A.length>0&&(f.current=A.length),s(S=>[...A,...S])}}}),b.useEffect(()=>{i(g===""?[]:n.filter(j=>JSON.stringify(j.payload).toLowerCase().includes(g.toLowerCase())))},[g,n]),r.jsxs(J,{width:"100%",height:"70vh",gap:"4px",children:[r.jsxs(C,{gap:4,justify:"space-between",height:"48px",align:"center",children:[r.jsxs(C,{gap:2,children:[r.jsx(Bt,{children:"Events"}),r.jsx(de,{children:Ot(n.length)})]}),r.jsxs(C,{gap:2,align:"center",children:[r.jsx(be,{icon:Dt,"aria-label":"Clear events",onClick:()=>{c(void 0),s([])},children:"Clear events"}),r.jsx(D,{width:"105px",children:r.jsx(be,{isJustified:!0,icon:E?Nt:Je,onClick:()=>{E?R():B(new Date(Date.now()+36e5),!0)},children:E?"Pause":"Resume"})})]})]}),r.jsx(C,{width:"100%",children:r.jsx(At,{placeholder:"Search for events by name, type, or payload content…",value:g,width:"100%",onChange:j=>{me(j.target.value)}})}),r.jsxs(C,{padding:"12px 0px",align:"center",overflow:"hidden",children:[g!==""?r.jsx(T,{color:"text.placeholder",whiteSpace:"pre-wrap",children:`${o.length} results for "${g}" · `}):null,r.jsxs(Pt,{message:"When event volume is high, the events displayed are automatically sampled.",children:["Displaying"," ",F==="100"?"all":`${F}% of`," ","received event data"]})]}),r.jsxs(C,{display:"grid",gridTemplateColumns:"minmax(300px, 2fr) 3fr",ga
6p:"16px",overflow:"auto",height:"100%",children:[r.jsx(Fn,{event:a,search:g,clearSearch:()=>me(""),setEvent:c,events:g!==""?o:n,prependedCountRef:f,isRunning:E,onResume:()=>B(new Date(Date.now()+36e5),!0)}),r.jsx(J,{overflow:"hidden",flex:1,children:a?r.jsx(Mn,{event:a,sourceId:t.id}):r.jsx(Mt,{variant:"card",height:"100%",imageUrl:cn,message:"Select an event to view its payload."})})]})]})},Mn=({event:e,sourceId:t})=>{var f;const{appShowEventTrace:n}=vt(),s=!!n,[o,i]=b.useState("payload"),a=Oe(e);b.useEffect(()=>{!s&&o==="trace"&&i("payload")},[s,o]);const c=(f=Ve(e.payload))==null?void 0:f.toString(),d=JSON.stringify(e.payload,null,4),x=Pe[e.payload.type]??Pe.track;return r.jsxs(D,{borderWidth:"hairline",borderStyle:"solid",borderColor:"base.border",borderRadius:"xl",boxShadow:"buttonShadowLight",color:"text-primary",position:"relative",display:"flex",flexDir:"column",h:"100%",overflow:"hidden",children:[r.jsxs(D,{px:3,py:2,gap:4,minH:"56px",h:"56px",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottomWidth:"hairline",borderBottomStyle:"solid",borderColor:"base.border",children:[r.jsxs(C,{align:"center",gap:2,minW:0,children:[r.jsx(D,{as:x,flexShrink:0,boxSize:6,color:"text.secondary"}),r.jsxs(D,{overflow:"auto",children:[r.jsx(_t,{fontWeight:"medium",children:c}),r.jsx(T,{color:"text.secondary",children:M.capitalize(e.payload.type)})]})]}),r.jsxs(C,{align:"center",gap:2,flexShrink:0,children:[a.status==="warning"?r.jsx(le,{message:a.message,children:r.jsx(de,{svgIcon:Te,variant:"warning",size:"md",children:"Warning"})}):a.status==="blocked"?r.jsx(le,{message:a.message,children:r.jsx(de,{svgIcon:Ie,variant:"error",size:"md",children:"Blocked"})}
6):null,s?r.jsxs(Ft,{size:"sm",value:o,onChange:E=>i(E),children:[r.jsx(Ae,{label:"Payload",value:"payload"}),r.jsx(Ae,{label:"Trace",value:"trace"})]}):null,r.jsx(Lt,{text:d})]})]}),s&&o==="trace"?r.jsx(D,{flex:1,minHeight:0,overflow:"auto",children:r.jsx(On,{sourceId:t,eventId:e.payload.messageId})}):r.jsx(_n,{event:e})]})},_n=({event:e})=>{const t=Oe(e),n=an.stringify(e.payload,null,4),s=Se.theme({".cm-tooltip-hover":{background:"var(--chakra-colors-white) !important",border:"1px solid var(--chakra-colors-gray-300) !important",borderRadius:"6px",boxShadow:"var(--chakra-shadows-md)",padding:"4px 8px"}}),o=en(()=>e.validation.violations.filter(a=>a.dataPath!=null&&a.field!=="$root").map(a=>{const c=n.pointers[a.dataPath];return{from:(c.key??c.value).pos,to:c.valueEnd.pos,severity:t.status==="blocked"?"error":"warning",message:ze(a)}}),{delay:0});return r.jsxs(r.Fragment,{children:[r.jsx(D,{flex:1,overflow:"auto",children:r.jsx(Gt,{bg:"transparent",language:"json",value:n.json,readOnly:!0,extensions:[o,s]},e.id)}),e.validation.violations.length>0&&r.jsx(D,{children:r.jsx(jt,{ml:0,px:3,py:2,spacing:2,bg:"base.lightBackgroun
6d",borderTopWidth:"hairline",borderTopStyle:"solid",borderColor:"base.border",children:e.validation.violations.map(ze).sort().map((i,a)=>r.jsxs(St,{display:"flex",alignItems:"center",children:[r.jsx(D,{sx:{svg:{h:5,w:5}},children:t.status==="blocked"?r.jsx(Ie,{color:"danger.base"}):r.jsx(Te,{color:"warning.base"})}),r.jsx(T,{ml:3,variant:"monospace",children:i})]},a))})})]})},$e=56,Fn=({event:e,events:t,search:n,setEvent:s,clearSearch:o,prependedCountRef:i,isRunning:a,onResume:c})=>{const d=b.useRef(null),x=yt({count:t.length,getScrollElement:()=>d.current,estimateSize:()=>$e}),f=b.useRef(!1);b.useLayoutEffect(()=>{const R=i.current;R>0&&d.current&&((f.current||e)&&(d.current.scrollTop+=R*$e),i.current=0)},[t,i,e]);const E=n?r.jsxs(r.Fragment,{children:[r.jsxs(T,{whiteSpace:"pre-wrap",color:"text.secondary",children:["No events found for search ",r.jsxs(T,{fontWeight:"medium",children:['"',n,'"']})]}),r.jsx(be,{mt:1,variant:"primary",size:"md",onClick:()=>o(),children:"Clear search"})]}):r.jsxs(T,{color:"text.secondary",children:["Not seeing anything? Make sure you’ve installed the SDK correctly. Check out our"," ",r.jsx(Wt,{href:"https://hightouch.com/docs/events/overview",children:"Events documentation"})," ","to learn more."]});return r.jsx(D,{ref:d,height:"100%",flex:1,borderWidth:"hairline",borderStyle:"solid",borderColor:"base.border",borderRadius:"xl",boxShadow:"buttonShadowLight",onScroll:()=>{var R;f.current=(((R=d.current)==null?void 0:R.scrollTop)??0)>0},overflow:"auto",tabIndex:0,_focusVisible:{outlineColor:"primary.border"},children:t!=null&&t.length?r.jsx(D,{as:"ul",listStyleType:"none",height:`${x.getTotalSize()}px`,width:"100%",p:0,position:"relative",children:x.getVirtualItems().map(R=>{const B=t[R.index];return B?r.jsx(Ln,{virtualItem:R,event:B,isSelected:!!(e&&e.id===B.id),onClick:()=>{s(B)}},String(R.key)):null})}):r.jsx(J,{m:"auto",h:"100%",p:4,align:"center",justify:"center",gap:2,textAlign:"center",children:a?r.jsxs(r.Fragment,{children:[r.jsx(Ue,{variant:"success",children:"Waiting for events…"}),E]}):r.jsxs(r.Fragment,{children:[r.jsx(T,{color:"text.secondary",fontWeight:"medium",children:"Event feed is paused"}),r.jsx(be,{mt:1,variant:"primary",size:"md",icon:Je,onClick:c,children:"Resume"})]})})})},Ln=({event:e,onClick:t,isSelected:n,virtualItem:s})=>{var a;const o=Oe(e),i=(a=Ve(e.payload))==null?void 0:a.toString();return r.jsx(C,{as:"li",position:"absolute",top:0,left:0,transform:`translateY(${s.start}px)`,minH:"56px",height:"56px",w:"100%",_notLast:{borderBottomWidth:"hairline",borderBottomStyle:"solid",borderColor:"base.border"},children:r.jsxs(C,{as:"button","aria-label":`Click to view event details: ${i}`,cursor:"pointer",boxSize:"100%",bg:n?"primary.background":"white",display:"flex",alignItems:"center",gap:2,px:2,textAlign:"left",_hover:{bg:n?"primary.background":"base.background"},transitionProperty:"background-color",transitionDuration:"fast",transitionTimingFunction:"easeOutQuad",_focusVisible:{outline:"1px solid",outlineColor:"primary.border",outlineOffset:"-2px"},onClick:t,children:[r.jsx(Jt,{eventType:e.payload.type,title:i}),r.jsxs(C,{gap:3,alignItems:"center",justifyContent:"end",shrink:0,children:[o.status==="warning"?r.jsx(le,{message:o.message,children:r.jsx(de,{svgIcon:Te,variant:"warning",size:"sm",children:"Warning"})}):o.status==="blocked"?r.jsx(le,{message:o.message,children:r.jsx(de,{svgIcon:Ie,variant:"error",size:"sm",children:"Blocked"})}):null,e.payload.timestamp&&r.jsx(le,{message:zt(e.payload.timestamp),children:r.jsx(T,{color:"text.tertiary",size:"sm",children:$t(e.payload.timestamp)})})]})]})})},Oe=({validation:e})=>{if(e.isBlockedViolation){const t=e.blockReasons??[];return t.includes("schema_violation")?{status:"blocked",message:"This event has schema violation(s) and is blocked due to your contracts settings"}:t.includes("undeclared_schema")?{status:"blocked",message:"Undeclared events are blocked in your contracts settings"}:t.includes("undeclared_fields")?{status:"blocked",message:"Events with undeclared fields are blocked in your contracts settings"}:{status:"blocked",message:"This event is blocked due to an invali
6d schema"}}return e.violations.length>0?{status:"warning",message:"This event has schema violation(s) but is still allowed due to your contracts settings"}:{status:"ok"}};function ze(e){return e.field&&e.undeclaredField?`${e.field} ${e.message}: ${e.undeclaredField}`:e.field?`${e.field} ${e.message}`:e.message}export{Vn as Debugger};
7//# sourceMappingURL=index-C3zbKTe2.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.