PageSourceSearch

https://app.hightouch.com/assets/experiment-CAejOp02.js

js hightouch.com collected 2026-09-24 07:25:35 UTC 4,506 bytes, 2 lines download raw bytes

1import{as as M,r as c,t as j,b9 as O,af as e}from"./vendor-B2oIjyY4.js";import{fx as T,fy as R,fz as $,fA as z,f5 as H,w as V,e1 as W,cN as q,C as b,c8 as f,T as G,L as J,B as y,aY as p,e as U,R as v,H as F,b8 as E,i as w}from"./main-CJK8sxkW.js";import{C as Q}from"./chart-data-context-pGhEpRr3.js";import{f as Y}from"./use-metric-selector-options-CUKipgJE.js";import{m as K,i as N}from"./types-Ze9Yrb3J.js";import{E as X}from"./outlet-WAux6o1M.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";import"./use-measurement-columns-Doc6Nvnn.js";import"./use-chart-configure-permission-Dw2zdSql.js";import"./common-DtlkiB79.js";const Z=(m,l)=>{const o=[];l.edges.forEach(i=>{i.from_node_id===m.id&&o.push(i.to_node_id)});const s=[];return l.nodes.forEach(i=>{o.includes(i.id)&&s.push({id:i.id,name:i.name,percentage:i.config.percentage,enabled:!0,isHoldoutGroup:!1})}),s},fs=()=>{var _;const{experimentId:m}=M(),{data:l,isFetching:o}=T({id:m}),s=l==null?void 0:l.experiments_by_pk,i=s==null?void 0:s.segment,t=(_=s==null?void 0:s.journey_nodes)==null?void 0:_[0],n=t==null?void 0:t.journey_version,a=s==null?void 0:s.message_experiment,r=a!=null,{config:h,isLoading:C}=R({enabled:r}),g=(i==null?void 0:i.parent)??(n==null?void 0:n.parent_model)??(r?(h==null?void 0:h.parent_model)??void 0:void 0),S=c.useMemo(()=>i!=null&&i.splits?j(i.splits.map(Y),d=>d.isHoldoutGroup?0:1,d=>d.name):t&&n?j(Z(t,n),d=>d.name):r?j(K((a==null?void 0:a.arms)??[]),d=>d.name):[],[i==null?void 0:i.splits,t,n,r,a]),[k,x]=c.useState(!1),L=c.useMemo(()=>$(new Date),[]),{mutateAsync:u,isLoading:B}=z(),I=c.useCallback(async()=>
1{s!=null&&s.id&&(await u({id:s.id,input:{completed_at:O().toISOString()}}),x(!1))},[u,s==null?void 0:s.id]),A=c.useCallback(async()=>{s!=null&&s.id&&await u({id:s.id,input:{completed_at:null}})},[u,s==null?void 0:s.id]),D=(s==null?void 0:s.segment_id)!=null,P=(s==null?void 0:s.journey_node_id)!=null;return!o&&!C&&(!s||!g||D&&!i||P&&!t)?e.jsx(H,{subtitle:"An error occurred while fetching this resource. Please try again, or contact support if the issue persists.",title:"Experiment, audience, or parent model not found"}):e.jsx(Q,{children:e.jsxs(V,{crumbs:[{label:"Experiments",link:"/experiments"},...s?[{label:s.name}]:[]],title:s?`${s.name} - Experiments`:"Experiments",isTabsLoading:o,tabs:[{variant:"card",path:"overview",title:"Overview",isDisabled:!!(s&&!N(s)),hasBottomPadding:!0},{variant:"form",path:"configuration",title:"Configuration"},{variant:"form",path:"schedule",title:"Schedule"}],header:e.jsx(y,{as:U,isLoading:o,flex:1,children:e.jsxs(v,{justifyContent:"space-between",alignItems:"center",children:[e.jsxs(b,{children:[e.jsx(F,{size:"lg",children:s==null?void 0:s.name}),e.jsx(f,{color:"text.secondary",children:s==null?void 0:s.description})]}),((s==null?void 0:s.segment_id)||(s==null?void 0:s.journey_node_id)||r)&&e.jsxs(v,{gap:2,children:[(s==null?void 0:s.segment_id)&&e.jsx(E,{href:`/audiences/${s.segment_id}`,isExternal:!0,directionIcon:p,children:"View audience"}),(s==null?void 0:s.journey_node_id)&&n&&t&&e.jsx(E,{href:`/journeys/${n.id}?view=node-details&nodeId=${t.id}&tab=settings`,isExternal:!0,directionIcon:p,children:"View journey"}),r&&(a==null?void 0:a.message)&&e.jsx(E,{href:`/native-delivery/messages/${a.message.id}`,isExternal:!0,directionIcon:p,children:"View message"}),!r&&(s==null?void 0:s.completed_at)&&e.jsx(w,{variant:"primary",onClick:A,isLoading:B,children:"Restart experiment"}),!r&&!(s!=null&&s.completed_at)&&e.jsx(w,{variant:"primary",onClick:()=>x(!0),children:"End experiment"})]})]})}),children:[o||!s||!g?e.jsx(W,{}):e.jsx(X,{context:{experiment:s,segment:i??void 0,journeyNode:t,journey:n??void 0,splits:S,parentModel:g}}),!o&&s&&s.status=="running"&&e.jsx(q,{isOpen:k,variant:"warning",title:"End experiment?",confirmButtonText:"Confirm",onClose:()=>x(!1),onConfirm:I,children:e.jsxs(b,{gap:4,children:[e.jsxs(f,{children:["This will set the end of the experiment to today (",e.jsx(G,{fontWeight:"semibold",children:L}),") at 11:59:59 PM."]}),e.jsx(f,{children:"Are you sure you want to end this experiment?"}),i&&e.jsxs(f,{size:"sm",color:"text.tertiary",children:["Audience syncs will not be affected."," ",e.jsx(J,{isExternal:!0,href:`/audiences/${i.id}/syncs`,fontSize:"sm",children:e.jsxs(y,{display:"inline-flex",flexDir:"row",alignItems:"center",gap:1,children:["View syncs",e.jsx(y,{as:p,boxSize:3})]})})]})]})})]})})};export{fs as ExperimentPage};
2//# sourceMappingURL=experiment-CAejOp02.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.