PageSourceSearch

https://thetool.company/_next/static/chunks/2v_dz-r9kdn1e.js

js thetool.company collected 2026-10-02 01:55:40 UTC 79,829 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,596058,886673,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(409797),s=e.i(941388),a=e.i(37727),l=e.i(167881),r=e.i(23750),o=e.i(10708),d=e.i(447170),c=e.i(967416);let u="rounded-[20px] [corner-shape:squircle] squircle-field-fallback border border-transparent bg-white dark:bg-black";e.s(["FIELD_INNER",0,"border-0 bg-transparent! dark:bg-transparent! shadow-none focus-visible:ring-0 focus-visible:border-0","FIELD_SHELL",0,u],886673);var p=e.i(419829),m=e.i(308408),h=e.i(859397),f=e.i(579423),x=e.i(880028),g=e.i(739201),b=e.i(801914),y=e.i(567136);function k({surface:e,firedBy:i,agent:s,model:a,effort:l,stepTypes:r,onApply:d,onModelChange:c,onEffortChange:u,onRunningChange:v}){let{name:j}=(0,y.useAgentBrand)(),[N,w]=(0,n.useState)(""),[S,C]=(0,n.useState)([]),[_,I]=(0,n.useState)([]),[E,T]=(0,n.useState)(!1),[M,A]=(0,n.useState)(null),D=(0,h.useAssistantSlashItems)(f.EMPTY_CATALOG,!0),L=(0,n.useRef)(null),$=(0,b.toAgent)(s),P=(0,n.useMemo)(()=>[{value:"",label:"Machine default",tagline:"Whatever that Mac is set to",efforts:null},...(0,b.modelOptionsFor)($).map(e=>({...e,efforts:null}))],[$]),O=(0,b.effortOptionsFor)($);(0,n.useEffect)(()=>{v?.(E)},[E,v]);let R=(0,n.useRef)(!1);(0,n.useEffect)(()=>()=>{R.current=!0},[]);let q=(0,n.useCallback)(async e=>{let t=Date.now()+18e4;for(;!R.current&&Date.now()<t;){if(await new Promise(e=>setTimeout(e,2e3)),R.current)return;let t=await fetch(`/api/ai-step/configure?run_id=${encodeURIComponent(e)}`),n=await t.json().catch(()=>({}));if("done"===n.state&&n.setup){d(n.setup),w(""),C([]),I([]),T(!1);return}if("failed"===n.state){A(n.reason??"That turn did not finish."),T(!1);return}}R.current||(A(`${j} is taking too long. Fill the fields in below, or try again.`),T(!1))},[j,d]);async function F(){let t=N.trim();if(!t||E)return;A(null),T(!0);let n=await fetch("/api/ai-step/configure",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,surface:e,fired_by:i,step_types:r,mentions:S.map(e=>({id:e.id,name:e.name,token:e.token,record_type:e.recordType??null,href:e.href??null})),skills:_.filter(e=>"skill"===e.kind).map(e=>({id:e.id,name:e.name})),agent:s,model:a,effort:l})}),o=await n.json().catch(()=>({}));if(!n.ok||!o.run_id){A(o.error??"Could not start that."),T(!1);return}q(o.run_id)}return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)(o.Label,{className:"text-xs",children:["Tell ",j," what this step should do"]}),(0,t.jsx)(p.ChatInputBox,{text:N,onTextChange:e=>{w(e),I(t=>{let n=(0,f.pruneCommandChips)(e,t);return n.length===t.length?t:n})},onSubmit:()=>void F(),disabled:E,rows:3,placeholder:"sequence"===e?"e.g. read their last reply and tell me whether they are interested, and when they want to be chased":"e.g. read the reply and tell me if it is a real buying signal or noise",wrapperClassName:"white-surface !border-transparent !bg-white dark:!bg-black rounded-[20px] [corner-shape:squircle] squircle-field-fallback",inlineMentionChips:!0,mentionPlatforms:["member"],mentions:S,onMentionsChange:C,memberMentionSearch:m.searchRecordMentions,slashCommands:D.items,onSlashItemPicked:e=>{let t=D.chipById.get(e.id);t&&I(e=>[...e,t])},handleRef:L,trailingActions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.DictateButton,{onText:e=>w(t=>t?`${t} ${e}`:e),focusTarget:()=>L.current?.focus()}),c&&(0,t.jsx)(g.ModelPill,{agent:$,models:P,model:a??"",effort:l??O[Math.floor(O.length/2)]??"",onModel:e=>c(e||null),onEffort:e=>u?.(e||null)})]})}),M&&(0,t.jsx)("p",{className:"text-[11px] text-destructive",children:M})]})}var v=e.i(783618),j=e.i(647163);function N({answers:e,branchOn:n,className:i}){let s=e.filter(e=>String(e.key??"").trim());return 0===s.length?null:(0,t.jsx)("div",{className:(0,j.cn)("space-y-2",i),children:(0,t.jsx)("ul",{className:"space-y-2",children:s.map(e=>{let i,s=String(e.key).trim(),a=(e.choices??[]).map(e=>String(e).trim()).filter(Boolean),l=!!n&&n===s&&a.length>0;return(0,t.jsxs)("li",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-xs font-semibold underline decoration-dotted decoration-foreground
1/40 underline-offset-[3px]",children:(i=s.replace(/_/g," ").trim())?i[0].toUpperCase()+i.slice(1):s}),e.description&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug",children:e.description}),a.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:a.map(e=>(0,t.jsx)("span",{className:(0,v.pillClass)("default","shrink-0"),children:e},e))}):(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Free text"}),l&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"The sequence forks here — one arm per answer, and anything else carries straight on."})]},s)})})})}var w=e.i(450263);let S="builder-section p-3 space-y-3",C="text-[11px] font-medium text-muted-foreground uppercase tracking-wider";e.s(["AiStepPanel",0,function({surface:e,firedBy:p,agent:m,model:h,effort:f,onAgentChange:x,promptField:g,stepTypes:v,needs:_,onSelectStep:I,answers:E,onAnswersChange:T,answersHelp:M,branch:A,onUnavailable:D,onUnavailableChange:L,unavailableFailLabel:$,unavailableHelp:P,onApplySetup:O}){let R=(0,b.toAgent)(m),q=(0,b.modelOptionsFor)(R),F=(0,b.effortOptionsFor)(R),{agent:B}=(0,y.useAgentBrand)(),[z,H]=(0,n.useState)(!1),W=(0,n.useCallback)(e=>H(e),[]),U=(e,t)=>T(E.map((n,i)=>i===e?{...n,...t}:n));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:S,children:[(0,t.jsx)("p",{className:C,children:"Prompt"}),(0,t.jsx)(k,{surface:e,firedBy:p,agent:m,model:h,effort:f,stepTypes:v,onApply:O,onModelChange:e=>x({model:e}),onEffortChange:e=>x({effort:e}),onRunningChange:W}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(o.Label,{className:"text-xs",children:"What it does"}),(0,t.jsxs)("div",{className:(0,j.cn)(u,"relative"),children:[(0,t.jsx)("div",{className:z?"invisible":void 0,children:g}),z&&(0,t.jsx)(w.AgentThinkingStatus,{agent:B,className:"absolute left-3 top-3 text-sm",markClassName:"h-4 w-4",children:"Setting the step up…"})]})]})]}),E.some(e=>String(e.key??"").trim())&&(0,t.jsxs)("div",{className:S,children:[(0,t.jsx)("p",{className:C,children:"Answers"}),(0,t.jsx)(N,{answers:E,branchOn:A?.value})]}),_&&_.length>0&&(0,t.jsxs)("div",{className:S,children:[(0,t.jsx)("p",{className:C,children:"Still needs you"}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"These steps are on the canvas but cannot run yet. Anything named in the box above was wired up; the rest is a pick only you can make."}),(0,t.jsx)("ul",{className:"space-y-1.5",children:_.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>I?.(e.id),className:(0,j.cn)(u,"flex w-full items-center justify-between gap-2 px-3 py-2 text-left transition-colors hover:bg-[#F0EEE6] dark:hover:bg-accent"),children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:e.label}),(0,t.jsx)("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:e.missing.join(", ")})]})},e.id))})]}),(0,t.jsxs)("details",{className:"builder-section group p-3",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 marker:content-none",children:[(0,t.jsx)("span",{className:C,children:"Edit the details"}),(0,t.jsx)(i.ChevronDownIcon,{className:"size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-180"})]}),(0,t.jsxs)("div",{className:"space-y-3 pt-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(o.Label,{className:"text-xs",children:"Agent"}),(0,t.jsx)(d.SearchableSelect,{value:R,onValueChange:e=>x({agent:e,model:null,effort:null}),options:b.AGENT_PROVIDERS.map(e=>({value:e,label:b.AGENTS[e].cli}))})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(o.Label,{className:"text-xs",children:"Model"}),(0,t.jsx)(d.SearchableSelect,{value:h??"",onValueChange:e=>x({model:e||null}),options:[{value:"",label:"Machine default"},...q.map(e=>({value:e.value,label:e.label}))]})]})]}),F.length>0&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(o.Label,{className:"text-xs",children:"Reasoning effort"}),(0,t.jsx)(d.SearchableSelect,{value:f??"",onValueChange:e=>x({effort:e||null}),options:[{value:"",label:"Machine default"},...F.map(e=>({value:e,label:e}))]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(o.Label,{className:"text-xs",children:"Answers"}),(0,t.jsxs)(l.Button,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-[11px]",onClick:()=>T([...E,{key:"",choices:[]}]),children:[(0,t.jsx)(s.Plus,{className:"mr-1 h-3 w-3"}),"Add"]})]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:M}),E.map((e,n)=>(0,t.jsxs)("div",{className:"space-y-1.5 rounded-[20px] [corner-shape:squircle] squircle-field-fallback border border-transparent bg-white dark:bg-black p-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(r.Input,{value:e.key??"",onChange:e=>U(n,{key:e.target.value}),placeholder:"key, e.g. category",className:"h-7 text-xs"}),(0,t.jsx)(l.Button,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0",onClick:()=>T(E.filter((e,t)=>
1t!==n),String(e.key??"").trim()||void 0),children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]}),(0,t.jsx)(r.Input,{value:e.description??"",onChange:e=>U(n,{description:e.target.value}),placeholder:"what this means (optional)",className:"h-7 text-xs"}),(0,t.jsx)(c.MultiSelectChips,{value:e.choices??[],onChange:e=>U(n,{choices:e}),options:e.choices??[],placeholder:"Add a choice",customLabel:"Add",className:"px-1 py-0.5"})]},n))]}),A&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(o.Label,{className:"text-xs",children:"Branch on"}),(0,t.jsx)(d.SearchableSelect,{value:A.value,onValueChange:A.onChange,options:[{value:"",label:"Carry straight on"},...A.options]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:A.help})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(o.Label,{className:"text-xs",children:"If your Mac is asleep"}),(0,t.jsx)(d.SearchableSelect,{value:D,onValueChange:e=>L("fail"===e?"fail":"continue"),options:[{value:"continue",label:"Carry on without an answer"},{value:"fail",label:$}]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:P})]})]})]})]})}],596058)},739201,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(643531),s=e.i(664659),a=e.i(59377),l=e.i(319036),r=e.i(450263),o=e.i(640248),d=e.i(363848),c=e.i(105031),u=e.i(978200),p=e.i(127491),m=e.i(801914);let h={none:"None",minimal:"Minimal",default:"Default",low:"Low",medium:"Medium",high:"High",xhigh:"Extra",max:"Max",ultra:"Ultra"},f={anthropic:{Mark:o.ClaudeIcon,bg:"bg-[#D97757]"},openai:{Mark:c.OpenAIIcon,bg:"bg-[#0D0D0D]"},google:{Mark:function({className:e,...n}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",...n,children:(0,t.jsx)("path",{d:"M12 24C12 17.373 6.627 12 0 12C6.627 12 12 6.627 12 0C12 6.627 17.373 12 24 12C17.373 12 12 17.373 12 24Z"})})},bg:"bg-[#4285F4]"},cursor:{Mark:d.CursorIcon,bg:"bg-[#26251E]"},moonshot:{Mark:function({className:e,...n}){return(0,t.jsxs)("svg",{viewBox:"0 0 512 512",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",...n,children:[(0,t.jsx)("path",{d:"M342.065 189.759c1.886-2.42 3.541-4.63 5.289-6.77.81-1.007.74-1.771-.046-2.824-7.58-9.965-8.298-21.028-3.935-32.254 3.275-8.448 10.52-12.406 19.373-13.25 5.52-.521 10.936.046 15.959 2.73 6.596 3.53 10.438 8.912 11.688 16.341.995 5.926.81 11.712-.868 17.452-2.974 10.161-10.277 15.427-20.287 16.758-8.31 1.11-16.734 1.25-25.113 1.817-.648.046-1.308 0-2.06 0z",fill:"#027AFF"}),(0,t.jsx)("path",{d:"M321.512 144.254h-50.064l-39.637 90.384h-56.036v-89.99H131v232.868h44.787v-98.103h78.973c13.598 0 26.015-7.927 31.744-20.252v118.355h44.787v-98.103c0-23.342-18.239-42.97-41.523-44.671v-.116h-24.593a45.577 45.577 0 0026.884-24.534l29.453-65.838z"})]})},bg:"bg-[#000000]"},zhipu:{Mark:function({className:e,...n}){return(0,t.jsxs)("svg",{viewBox:"4 5.5 22 19",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-hidden":"true",...n,children:[(0,t.jsx)("path",{d:"M15.47,7.1l-1.3,1.85c-0.2,0.29-0.54,0.47-0.9,0.47h-7.1V7.09C6.16,7.1,15.47,7.1,15.47,7.1z"}),(0,t.jsx)("polygon",{points:"24.3,7.1 13.14,22.91 5.7,22.91 16.86,7.1"}),(0,t.jsx)("path",{d:"M14.53,22.91l1.31-1.86c0.2-0.29,0.54-0.47,0.9-0.47h7.09v2.33H14.53z"})]})},bg:"bg-[#2D2D2D]"},other:{Mark:u.SparkleIcon,bg:"bg-[#8A8782]"}};function x({vendor:e,className:n="h-5 w-5"}){let{Mark:i,bg:s}=f[e];return(0,t.jsx)("div",{className:`${n} shrink-0 flex items-center justify-center squircle ${s}`,children:(0,t.jsx)(i,{className:"size-[58%] text-white"})})}function g({index:e,count:i,onIndex:s}){let a=(0,n.useRef)(null),[l,r]=(0,n.useState)(!1),o=(0,n.useCallback)(t=>{let n=a.current;if(!n)return e;let s=n.getBoundingClientRect();return Math.round(Math.min(1,Math.max(0,(t-s.left)/s.width))*(i-1))},[i,e]),d=e/(i-1)*100;return(0,t.jsx)("div",{className:"mx-3.5 mb-3 cursor-pointer touch-none select-none py-2",onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),r(!0),s(o(e.clientX))},onPointerMove:e=>{l&&s(o(e.clientX))},onPointerUp:()=>r(!1),onPointerCancel:()=>r(!1),children:(0,t.jsxs)("div",{ref:a,className:"relative h-1 rounded-full bg-foreground
1/10",children:[(0,t.jsx)("div",{className:`absolute inset-y-0 left-0 rounded-full bg-[#A6BFD0] ${l?"":"transition-[width] duration-150"}`,style:{width:`${d}%`}}),Array.from({length:i}).map((n,s)=>s>e?(0,t.jsx)("span",{className:"absolute top-1/2 h-[3px] w-[3px] -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground/20",style:{left:`${s/(i-1)*100}%`}},s):null),(0,t.jsx)("span",{className:`absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white ring-1 ring-black/10 shadow-[0_1px_3px_rgba(0,0,0,0.3)] ${l?"scale-110":"transition-[left] duration-150"}`,style:{left:`${d}%`}})]})})}e.s(["ModelPill",0,function({agent:e,models:o,model:d,effort:c,fast:u,onModel:f,onEffort:b,onFast:y}){let[k,v]=(0,n.useState)(!1),j=o.find(e=>e.value===d),N=!!j?.hasFast&&!!y,w=o.length>8,[S,C]=(0,n.useState)(""),_=S.trim().toLowerCase(),I=_?o.filter(e=>e.label.toLowerCase().includes(_)||e.tagline.toLowerCase().includes(_)||e.value.toLowerCase().includes(_)):o,E=(0,n.useCallback)(e=>{let t=I[e];t&&(f(t.value),v(!1))},[I,f]),T=(0,p.useRowNavigation)(I.length,E),M=j?.efforts??(0,m.effortOptionsFor)(e),A=M.length>0,D=Math.max(0,M.indexOf(c));return(0,t.jsxs)(a.Popover,{open:k,onOpenChange:e=>{v(e),e?T.setActive(Math.max(0,o.findIndex(e=>e.value===d))):C("")},children:[(0,t.jsx)(a.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",className:"assistant-model-pill flex min-w-0 items-center gap-1.5 whitespace-nowrap rounded-full border border-[#F0EEE9] bg-[#F9F9F5] px-2 py-1 text-xs font-medium text-[#6D6A67] transition-colors hover:bg-[#F5F4ED] dark:border-border/50 dark:bg-muted/60 dark:text-muted-foreground dark:hover:bg-muted",title:"Model and effort",children:[(0,t.jsx)(r.AgentMarkSquircle,{agent:e,className:"h-4 w-4"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:j?.label??"Model"}),A&&(0,t.jsxs)("span",{className:"assistant-model-pill-sub shrink-0 text-[#8E8B89] dark:text-muted-foreground/70",children:[h[c]??c,N&&u?" · Fast":""]}),(0,t.jsx)(s.ChevronDown,{className:"assistant-model-pill-sub h-3 w-3 shrink-0 text-[#8E8B89] dark:text-muted-foreground/70"})]})}),(0,t.jsxs)(a.PopoverContent,{container:null,align:"start",side:"top",className:w?"w-72 p-0":"w-64 p-1",children:[w&&(0,t.jsx)(p.DropdownSearchRow,{value:S,onValueChange:e=>{C(e),T.setActive(0)},placeholder:"Search models",autoFocus:!0,onKeyDown:T.onKeyDown}),(0,t.jsxs)("div",{className:w?"max-h-[50vh] overflow-y-auto p-1":"max-h-[50vh] overflow-y-auto",children:[0===I.length&&(0,t.jsx)("p",{className:p.DROPDOWN_EMPTY_CLASS,children:"No model matches"}),I.map((e,n)=>(0,t.jsxs)("button",{type:"button","data-slot":"dropdown-row",...w?T.rowProps(n):{},onClick:()=>E(n),className:w?`${p.DROPDOWN_ROW_CLASS} text-left`:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-accent",children:["vendor"in e&&e.vendor?(0,t.jsx)(x,{vendor:e.vendor}):null,(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-sm",children:e.label}),(0,t.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:e.tagline})]}),e.value===d?(0,t.jsx)(i.Check,{className:"h-4 w-4 shrink-0"}):w?(0,t.jsx)(p.EnterHint,{}):null]},e.value))]}),A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mx-1 my-1.5 h-px bg-border"}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-2.5 pb-1.5 pt-0.5",children:[(0,t.jsx)("p",{className:"text-[11px] font-medium text-muted-foreground",children:"Effort"}),(0,t.jsx)("p",{className:"text-[11px] text-foreground/80",children:h[c]??c})]}),(0,t.jsx)(g,{index:D,count:M.length,onIndex:e=>b(M[e])})]}),N&&(0,t.jsxs)(t.Fragment,{children:[!A&&(0,t.jsx)("div",{className:"mx-1 my-1.5 h-px bg-border"}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-2.5 pb-2 pt-0.5",children:[(0,t.jsx)("p",{className:"text-[11px] font-medium text-muted-foreground",children:"Fast"}),(0,t.jsx)(l.Switch,{checked:!!u,onCheckedChange:e=>y?.(e),"aria-label":"Fast"})]})]})]})]})}],739201)},859397,e=>{"use strict";var t=e.i(271645),n=e.i(24816),i=e.i(640248),s=e.i(920755),a=e.i(579423);e.s(["useAssistantSlashItems",0,function(e,l){let r=function(e){let[n,i]=(0,t.useState)([]);return(0,t.useEffect)(()=>
1{if(!e)return;let t=!1;return(async()=>{let e=(0,s.createClient)(),{data:n}=await e.from("skills").select("id, name, description, icon_color").eq("is_template",!1).order("last_run_at",{ascending:!1,nullsFirst:!1}).limit(100);t||i(n??[])})(),()=>{t=!0}},[e]),n}(l);return(0,t.useMemo)(()=>{let t=[],s=new Map,l=(e,n)=>{t.push(e),s.set(e.id,n)};for(let e of r){let t={kind:"skill",id:`skill:${e.id}`,name:e.name,token:(0,a.skillToken)(e.name),description:e.description};l({id:`skill-${e.id}`,label:e.name,description:e.description||"Workspace skill",itemType:"skill",body:"",icon:i.ClaudeIcon,chipToken:t.token,chipMark:e.name.trim().charAt(0).toUpperCase()||"✦",chipColor:e.icon_color},t)}for(let t of e.commands){let e=(0,a.toCommandChip)(t,"cli_command");l({id:`cli-cmd-${t.name}`,label:t.name,description:t.description||"Claude Code command",itemType:"cli-command",body:"",icon:n.Slash,chipToken:e.token},e)}for(let t of e.skills){let e=(0,a.toCommandChip)(t,"cli_skill");l({id:`cli-skill-${t.name}`,label:t.name,description:t.description||"Claude Code skill",itemType:"cli-skill",body:"",icon:i.ClaudeIcon,chipToken:e.token},e)}return{items:t,chipById:s}},[r,e])}])},843190,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(878894),s=e.i(494913);async function a(){try{let e=await fetch("/api/chrome-extension/health");if(!e.ok)return null;return await e.json()}catch{return null}}e.s(["ExtensionHealthWarning",0,function({context:e,className:l}){let[r,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!0),[u,p]=(0,n.useState)(!1),[m,h]=(0,n.useState)(!1),f=(0,n.useCallback)(async()=>{o(await a()),c(!1)},[]);async function x(){p(!0);try{let e=await fetch("/api/chrome-extension/health",{method:"POST"});e.ok&&o(await e.json())}catch{}finally{p(!1)}}if((0,n.useEffect)(()=>{f();let e=setInterval(f,6e4);return()=>clearInterval(e)},[f]),d)return(0,t.jsx)("div",{className:`h-[3.25rem] rounded-md bg-muted/50 animate-pulse ${l??""}`});if(!r||r.live)return null;let g=r.lastCheckInAt?(0,s.formatDistanceToNow)(new Date(r.lastCheckInAt),{addSuffix:!0}):"never";return(0,t.jsx)("div",{className:`rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200 ${l??""}`,children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(i.AlertTriangle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsx)("p",{className:"font-medium",children:r.subscribed?`Your Chrome extension has not checked in since ${g}`:"Your Chrome extension is not connected"}),(0,t.jsx)("p",{className:"leading-relaxed",children:e??"Steps that run on your own LinkedIn or X session will queue and wait instead of firing."}),r.queuedActions>0&&(0,t.jsxs)("p",{className:"leading-relaxed",children:[r.queuedActions," action",1===r.queuedActions?" is":"s are"," already waiting on it."]}),r.otherExecutors.length>0&&(0,t.jsx)("p",{className:"leading-relaxed",children:"Your native app is online, so LinkedIn actions can still run through it."}),r.message&&(0,t.jsx)("p",{className:"leading-relaxed",children:r.message}),m&&(0,t.jsxs)("div",{className:"space-y-1.5 pt-1",children:[r.likelyCauses.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"Likely causes"}),(0,t.jsx)("ul",{className:"list-disc space-y-0.5 pl-4",children:r.likelyCauses.map(e=>(0,t.jsx)("li",{children:e},e))})]}),r.nextSteps.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"What to check"}),(0,t.jsx)("ul",{className:"list-disc space-y-0.5 pl-4",children:r.nextSteps.map(e=>(0,t.jsx)("li",{children:e},e))})]}),r.deviceKey&&(0,t.jsxs)("p",{className:"opacity-80",children:["Registered browser id ",r.deviceKey,". It changes per Chrome profile, so a different id than the browser you are in means the subscription belongs to another profile or machine."]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 pt-0.5",children:[(0,t.jsx)("button",{type:"button",onClick:x,disabled:u,className:"font-medium underline underline-offset-2 disabled:opacity-60",children:u?"Waking and waiting...":"Wake it now"}),(0,t.jsx)("button",{type:"button",onClick:()=>h(e=>!e),className:"font-medium underline underline-offset-2",children:m?"Hide details":"Why?"})]})]})]})})},"fetchExtensionHealth",0,a])},881577,334990,801299,e=>{"use strict";
1var t=e.i(843476),n=e.i(271645),i=e.i(65373),s=e.i(533377),a=e.i(448719),l=e.i(911356);let r={nodeWidth:280,nodeHeight:104,hGap:64,vGap:80,originX:250,originY:80};function o(e){return"condition"===e?132:"ai_step"===e?156:104}function d(e,t="vertical"){let n="horizontal"===t,i=new Map(e.map(e=>[e.id,e])),s=e.map(e=>{let t=o(String(e.step_type));return{id:e.id,position:e.position,parentId:e.parent_step_id??null,branchKey:e.branch_key??null,width:n?t:280,height:n?280:t}}),c=(0,l.layoutStepRows)(s,{...r,hGap:n?r.vGap:r.hGap,vGap:n?r.hGap:r.vGap,originX:n?r.originY:r.originX,originY:n?r.originX:r.originY,branchKeysOf:e=>{let t=i.get(e.id);return t?"condition"===t.step_type?["met","not_met"]:"ai_step"===t.step_type?(0,a.aiBranchChoices)(t.config):[]:[]}}).positions;return n?new Map([...c].map(([e,t])=>[e,{x:t.y,y:t.x}])):c}function c(e,t,n="vertical"){return"horizontal"===n?{x:e.x+280+56,y:e.y+o(t)/2-18}:{x:e.x+140-18,y:e.y+o(t)+48}}function u(e){return"action"===e.type||"condition"===e.type||"ai"===e.type}function p(e,t="vertical"){let n=e.filter(e=>u(e));if(0===n.length)return e;let i=d(n.map((e,t)=>({id:e.id,position:t,step_type:e.data.stepType,config:e.data.config,parent_step_id:e.data.parentStepId,branch_key:e.data.branchKey})),t);return e.map(n=>{if(u(n)){let e=i.get(n.id);return e?{...n,position:e}:n}if("add"===n.type&&n.id.startsWith("add-")){let s=n.id.slice(4),a=i.get(s),l=e.find(e=>e.id===s);return a&&l?{...n,position:c(a,l.data.stepType,t)}:n}return n})}function m(e,t,n){let i=function(e,t,n){let i=e.filter(e=>"add"!==e.type),s=t.filter(e=>!e.target.startsWith("add-")),a=new Set(s.map(e=>e.source)),l=[...i].reverse().find(e=>u(e)&&!e.data.parentStepId&&!a.has(e.id));if(!l)return{nodes:i,edges:s};let r=`add-${l.id}`;return{nodes:[...i,{id:r,type:"add",position:c(l.position,l.data.stepType,n),draggable:!1,selectable:!1,data:{}}],edges:[...s,{id:`e-${l.id}-add`,source:l.id,target:r,type:"default"}]}}(e,t,n);return{nodes:p(i.nodes,n),edges:i.edges}}function h(){return`step_${Date.now()}_${Math.random().toString(36).slice(2,8)}`}function f(e){let t={nodes:structuredClone(e.nodes),edges:structuredClone(e.edges)},n=e.history.slice(0,e.historyIndex+1);return n.push(t),{...e,history:n,historyIndex:n.length-1,isDirty:!0}}function x(e){return"horizontal"===e.sequenceSettings.canvas_orientation?"horizontal":"vertical"}e.s(["SEQUENCE_CANVAS",0,r,"addMarkerPosition",0,c,"layoutSequenceSteps",0,d,"sequenceNodeHeight",0,o],334990);let g={nodes:[],edges:[],selectedNodeId:null,focusNodeId:null,isDirty:!1,history:[{nodes:[],edges:[]}],historyIndex:0,sequenceId:null,baseStepState:null,serverSignature:null,loadSeq:0,sequenceName:"Untitled Sequence",sequenceSettings:{},sequenceOwnerId:null,sequenceKind:"contact_outreach"};function b(e,t){switch(t.type){case"SET_NODES":return{...f(e),nodes:t.nodes};case"SYNC_NODES":return{...e,nodes:t.nodes};case"SET_EDGES":return{...f(e),edges:t.edges};case"ADD_NODE":{let n=s.STEP_TYPE_CONFIG[t.stepType],i="condition"===t.stepType?"condition":"ai_step"===t.stepType?"ai":"action",a=h(),l=e.nodes.filter(e=>u(e)).length,r={id:a,type:i,position:t.position,data:{stepType:t.stepType,executionMode:n.defaultMode,delayMinutes:1440*("delay"===t.stepType),config:{},parentStepId:null,branchKey:null,label:"ai_step"===t.stepType?"":n.label,stepNumber:l+1}},o=f(e),d=t.connectAfter?[...o.edges,{id:`e-${t.connectAfter}-${a}`,source:t.connectAfter,target:a,type:"default"}]:o.edges;return{...o,...m([...o.nodes,r],d,x(e)),focusNodeId:t.focus?a:o.focusNodeId}}case"ADD_STEPS":{if(0===t.specs.length)return e;let n=f(e),i=[...n.nodes],a=[...n.edges],l=i.filter(e=>u(e)).length,r=t.afterId?i.find(e=>e.id===t.afterId)??null:null,o=r?.position??{x:250,y:200},d=new Map,c=0,p=t.afterId,g=new Map;for(let e of t.specs){let n=s.STEP_TYPE_CONFIG[e.stepType];if(!n)continue;let r=e.branchKey?.trim()||null,u=h(),m=r?(d.get(r)??0)+1:++c;r&&d.set(r,m);let f=r?[...d.keys()].indexOf(r):-1,x=r?o.x+(f%2==0?-220:220)*(Math.floor(f/2)+1):o.x;l+=1,i.push({id:u,type:"condition"===e.stepType?"condition":"ai_step"===e.stepType?"ai":"action",position:{x,y:o.y+180*m},data:{stepType:e.stepType,executionMode:n.defaultMode,delayMinutes:1440*("delay"===e.stepType),config:e.config??{},parentStepId:r?g.get(r)??t.afterId:p,branchKey:r&&!g.has(r)?r:null,label:e.label?.trim()||("ai_step"===e.stepType?"":n.label),stepNumber:l}});let b=r?g.get(r)??t.afterId:p;b&&a.push({id:`e-${b}-${u}`,source:b,target:u,type:"default"}),r?g.set(r,u):p=u}return{...n,...m(i,a,x(e))}}case"UPDATE_NODE_DATA":{let n=f(e);return{...n,nodes:n.nodes.map(e=>e.id===t.id?{...e,data:{...e.data,...t.data}}:e)}}case"DELETE_NODE":{let n=f(e),i=n.nodes.filter(e=>e.id!==t.id),s=0,a=i.map(e=>u(e)?(s++,{...e,data:{...e.data,stepNumber:s}}):e);return{...n,...m(a,n.edges.filter(e=>e.source!==t.id&&e.target!==t.id),x(e)),selectedNodeId:e.selectedNodeId===t.id?null:e.selectedNodeId}}case"ATTACH_NODE":{if(!e.nodes.find(e=>e.id===t.id))return e;let n=f(e),i=n.nodes.map(e=>e.id===t.id?{...e,data:{...e.data,parentStepId:t.parentStepId,branchKey:t.branchKey}}:e),s=x(e),a=(()=>
1{if(!t.afterId)return i;let e=i.find(e=>e.id===t.id);if(!e)return i;let n=i.filter(e=>e.id!==t.id),s=n.findIndex(e=>e.id===t.afterId);return -1===s?i:(n.splice(s+1,0,e),n)})();return{...n,...m(a,n.edges,s)}}case"SELECT_NODE":return{...e,selectedNodeId:t.id,nodes:e.nodes.map(e=>!!e.selected==(e.id===t.id)?e:{...e,selected:e.id===t.id})};case"CLEAR_FOCUS_NODE":return null===e.focusNodeId?e:{...e,focusNodeId:null};case"ADD_EDGE":{if(e.edges.some(e=>e.source===t.edge.source&&e.target===t.edge.target))return e;let n=f(e);return{...n,edges:[...n.edges,t.edge]}}case"MOVE_NODE":{let n=e.nodes.filter(e=>u(e)&&!e.data.parentStepId),i=e.nodes.filter(e=>u(e)&&e.data.parentStepId),s=e.nodes.filter(e=>!u(e)),a=n.findIndex(e=>e.id===t.id);if(-1===a||t.toIndex===a)return e;let l=Math.max(0,Math.min(t.toIndex,n.length-1)),r=[...n],[o]=r.splice(a,1);r.splice(l,0,o);let d=r.map((e,t)=>({...e,data:{...e.data,stepNumber:t+1}})),c=[];for(let e=0;e<d.length-1;e++){let t=d[e],n=d[e+1];if("condition"===t.type){let e=i.find(e=>e.data.parentStepId===t.id&&"met"===e.data.branchKey),s=i.find(e=>e.data.parentStepId===t.id&&"not_met"===e.data.branchKey);c.push({id:`e-${t.id}-met-${e?.id??n.id}`,source:t.id,sourceHandle:"met",target:e?.id??n.id,type:"default",label:"Yes"}),s&&c.push({id:`e-${t.id}-notmet-${s.id}`,source:t.id,sourceHandle:"not_met",target:s.id,type:"default",label:"No"})}else c.push({id:`e-${t.id}-${n.id}`,source:t.id,target:n.id,type:"default"})}return{...f(e),...m([...s,...d,...i],c,x(e))}}case"SET_ORIENTATION":{if(x(e)===t.orientation)return e;let n=f(e);return{...n,sequenceSettings:{...n.sequenceSettings,canvas_orientation:t.orientation},nodes:p(n.nodes,t.orientation),isDirty:!0}}case"TIDY_LAYOUT":{let t=p(e.nodes,x(e));if(!t.some((t,n)=>{let i=e.nodes[n];return i.position.x!==t.position.x||i.position.y!==t.position.y}))return e;return{...f(e),nodes:t}}case"LOAD":return{...e,nodes:t.nodes,edges:t.edges,sequenceId:t.sequenceId,sequenceName:t.name,sequenceSettings:t.settings??{},sequenceOwnerId:t.ownerId??null,sequenceKind:t.kind??"contact_outreach",baseStepState:t.baseStepState??null,serverSignature:t.signature??null,loadSeq:e.loadSeq+1,selectedNodeId:null,isDirty:!1,history:[{nodes:structuredClone(t.nodes),edges:structuredClone(t.edges)}],historyIndex:0};case"MARK_SAVED":return{...e,isDirty:!1,baseStepState:t.baseStepState??e.baseStepState,serverSignature:t.signature??e.serverSignature};case"SET_NAME":return{...e,sequenceName:t.name,isDirty:!0};case"SET_SETTINGS":return{...e,sequenceSettings:{...e.sequenceSettings,...t.settings},isDirty:!0};case"SET_OWNER":return{...e,sequenceOwnerId:t.ownerId,isDirty:!0};case"UNDO":{if(e.historyIndex<=0)return e;let t=e.historyIndex-1,n=e.history[t];return{...e,nodes:structuredClone(n.nodes),edges:structuredClone(n.edges),historyIndex:t,isDirty:!0}}case"REDO":{if(e.historyIndex>=e.history.length-1)return e;let t=e.historyIndex+1,n=e.history[t];return{...e,nodes:structuredClone(n.nodes),edges:structuredClone(n.edges),historyIndex:t,isDirty:!0}}default:return e}}let y=(0,n.createContext)(null);function k(){let e=(0,n.useContext)(y);if(!e)throw Error("useSequenceBuilder must be used within SequenceBuilderProvider");return e}e.s(["SequenceBuilderProvider",0,function({children:e}){let[s,a]=(0,n.useReducer)(b,g),l=(0,n.useCallback)((e,t)=>{a({type:"ADD_NODE",stepType:e,position:t??{x:250,y:(s.nodes.length+1)*150}})},[s.nodes.length]),d=(0,n.useCallback)(e=>{let t="horizontal"===x(s),n=s.nodes.filter(e=>u(e)),i=n.length>0?n.reduce((e,n)=>(t?e.position.x>n.position.x:e.position.y>n.position.y)?e:n):null,l=i?t?{x:i.position.x+r.nodeWidth+r.vGap,y:i.position.y+o(i.data.stepType)/2-o(e)/2}:{x:i.position.x,y:i.position.y+180}:{x:r.originX,y:200};a({type:"ADD_NODE",stepType:e,position:l,connectAfter:i?.id??null,focus:!0})},[s]),c=(0,n.useCallback)((e,t)=>a({type:"ADD_STEPS",specs:e,afterId:t}),[]),p=(0,n.useCallback)(()=>a({type:"CLEAR_FOCUS_NODE"}),[]),m=(0,n.useCallback)((e,t)=>a({type:"UPDATE_NODE_DATA",id:e,data:t}),[]),h=(0,n.useCallback)(e=>a({type:"DELETE_NODE",id:e}),[]),f=(0,n.useCallback)((e,t)=>a({type:"MOVE_NODE",id:e,toIndex:t}),[]),k=(0,n.useCallback)(()=>a({type:"TIDY_LAYOUT"}),[]),[v,j]=function(){let[e,t]=(0,i.usePersistedTab)("sequence-builder
1-view-mode","canvas");return["list"===e?"list":"canvas",t]}(),[N,w]=(0,n.useState)(null),[S,C]=(0,n.useState)(0),_=x(s),I=(0,n.useCallback)(e=>a({type:"SET_ORIENTATION",orientation:e}),[]),E=(0,n.useCallback)(e=>{let t=s.nodes.filter(e=>u(e)&&!e.data.parentStepId).findIndex(t=>t.id===e);t>0&&a({type:"MOVE_NODE",id:e,toIndex:t-1})},[s.nodes]),T=(0,n.useCallback)(e=>{let t=s.nodes.filter(e=>u(e)&&!e.data.parentStepId),n=t.findIndex(t=>t.id===e);n>=0&&n<t.length-1&&a({type:"MOVE_NODE",id:e,toIndex:n+1})},[s.nodes]),M=(0,n.useCallback)(e=>a({type:"SELECT_NODE",id:e}),[]),A=(0,n.useMemo)(()=>s.nodes.find(e=>e.id===s.selectedNodeId)??null,[s.nodes,s.selectedNodeId]),D=s.historyIndex>0,L=s.historyIndex<s.history.length-1,$=(0,n.useMemo)(()=>({state:s,dispatch:a,addNode:l,appendStep:d,addSteps:c,clearFocusNode:p,updateNodeData:m,deleteNode:h,selectNode:M,moveNodeToPosition:f,tidyLayout:k,orientation:_,setOrientation:I,viewMode:v,setViewMode:j,sidePanel:N,setSidePanel:w,previewIndex:S,setPreviewIndex:C,moveNodeUp:E,moveNodeDown:T,selectedNode:A,canUndo:D,canRedo:L}),[s,a,l,d,c,p,m,h,M,f,k,_,I,v,j,N,w,S,C,E,T,A,D,L]);return(0,t.jsx)(y.Provider,{value:$,children:e})},"isStepNode",0,u,"tidyNodePositions",0,p,"toBaseStepState",0,function(e){return{count:e.length,max_updated_at:e.reduce((e,t)=>t.updated_at&&(!e||t.updated_at>e)?t.updated_at:e,null)}},"useSequenceBuilder",0,k],881577);var v=e.i(30590);e.s(["useFlowDirection",0,function(){let{orientation:e}=k(),t="horizontal"===e;return{horizontal:t,targetPosition:t?v.Position.Left:v.Position.Top,targetClass:t?"!-left-[5px]":"!-top-[5px]",sourcePosition:t?v.Position.Right:v.Position.Bottom,sourceClass:t?"!-right-[5px]":"!-bottom-[5px]",armStyle:e=>t?{top:`${100*e}%`}:{left:`${100*e}%`},armPosition:t?v.Position.Right:v.Position.Bottom,armClass:t?"!-right-[5px]":"!-top-[5px]"}}],801299)},728066,38982,972881,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(154548),s=e.i(801299),a=e.i(533377),l=e.i(341544),r=e.i(881577),o=e.i(311199),d=e.i(647163),c=e.i(503116),u=e.i(87316),p=e.i(240250);e.s(["FlaskConical",()=>p.default],38982);var p=p;let m=(0,n.memo)(function({id:e,data:n}){let{selectNode:m}=(0,r.useSequenceBuilder)(),h=(0,s.useFlowDirection)(),f=(0,l.useStepLabel)();if(!a.STEP_TYPE_CONFIG[n.stepType])return null;let x="automatic"===n.executionMode,g=n.config?.template_name,b=n.config?.subject,y=n.config?.body,k=n.config?.message,v=n.config?.connection_note,j=b||g||y||k||v,N=y||k||v,w=function(e){if(!e)return;let[t,n]=e.split(":"),i=Number.parseInt(t??"",10),s=Number.parseInt(n??"",10);return Number.isFinite(i)&&Number.isFinite(s)?`${i%12==0?12:i%12}:${s.toString().padStart(2,"0")} ${i>=12?"PM":"AM"}`:e}(n.config?.send_at_time),S=n.config?.variants,C=S&&S.length>=2;return(0,t.jsxs)("div",{className:(0,d.cn)("relative w-[280px] rounded-[20px] cursor-pointer","transition-all duration-200 ease-out","border border-card-border bg-[var(--muted)]","hover:border-foreground
1/15"),onClick:()=>m(e),children:[(0,t.jsx)(i.Handle,{type:"target",position:h.targetPosition,className:(0,d.cn)("!bg-foreground/40 !w-2.5 !h-2.5 !border-2 !border-card",h.targetClass)}),n.stepNumber&&(0,t.jsx)("span",{className:"absolute top-2.5 right-2.5 flex h-5 w-5 items-center justify-center rounded-[6px] bg-card border border-card-border text-[10px] font-bold text-muted-foreground tabular-nums z-10",children:n.stepNumber}),(0,t.jsxs)("div",{className:"p-3.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(o.StepIcon,{stepType:n.stepType,size:"md"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 pr-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("p",{className:"text-[13px] font-semibold truncate leading-tight",children:f(n.stepType,n.label)}),C&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 rounded-[6px] bg-[#EAD8E5] border border-[#C9B0C7] px-1.5 h-5 text-[10px] font-semibold text-[#5A3D5C] shrink-0",children:[(0,t.jsx)(p.default,{className:"size-2.5"}),S.length]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5 flex-wrap",children:[(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:x?"Automatic":"Manual"}),n.dayNumber&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground/70",children:[(0,t.jsx)(u.Calendar,{className:"h-2.5 w-2.5"}),n.dayNumberMax&&n.dayNumberMax!==n.dayNumber?`Day ${n.dayNumber}\u2013${n.dayNumberMax}`:`Day ${n.dayNumber}`]}),n.delayMinutes>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-muted-foreground/60",children:[(0,t.jsx)(c.Clock,{className:"h-2.5 w-2.5"}),(0,a.formatDelay)(n.delayMinutes)]})]})]})]}),j&&(0,t.jsxs)("div",{className:"mt-3 rounded-lg bg-card px-3 py-2 space-y-1",children:[b&&(0,t.jsx)("p",{className:"text-[11px] font-medium text-foreground/80 truncate",children:b}),N&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground line-clamp-2 leading-relaxed",children:N})]}),w&&(0,t.jsxs)("p",{className:"mt-1.5 text-[10px] text-muted-foreground/60",children:["Send at ",w]})]}),(0,t.jsx)(i.Handle,{type:"source",position:h.sourcePosition,className:(0,d.cn)("!bg-foreground
1/40 !w-2.5 !h-2.5 !border-2 !border-card",h.sourceClass)})]})});e.s(["ActionNode",0,m],728066);var h=e.i(30590);let f=Object.fromEntries(e.i(473297).SEQUENCE_CONDITIONS.map(e=>[e.value,e.nodeLabel])),x=(0,n.memo)(function({id:e,data:n}){let{selectNode:a}=(0,r.useSequenceBuilder)(),l=(0,s.useFlowDirection)(),u=n.config?.condition_type,p=n.config?.label?.trim()||(u?f[u]??u:"Condition"),m=n.config?.wait_for_minutes;return(0,t.jsxs)("div",{className:(0,d.cn)("relative w-[280px] cursor-pointer"),onClick:()=>a(e),children:[(0,t.jsx)(i.Handle,{type:"target",position:l.targetPosition,className:(0,d.cn)("!bg-foreground/40 !w-2.5 !h-2.5 !border-2 !border-card",l.targetClass)}),l.horizontal&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Handle,{type:"source",position:l.armPosition,id:"met",className:(0,d.cn)("!w-2.5 !h-2.5 !border-2 !border-card",l.armClass),style:{...l.armStyle(.35),background:"#11A389"}}),(0,t.jsx)(i.Handle,{type:"source",position:l.armPosition,id:"not_met",className:(0,d.cn)("!w-2.5 !h-2.5 !border-2 !border-card",l.armClass),style:{...l.armStyle(.65),background:"var(--destructive)"}})]}),(0,t.jsx)("div",{className:(0,d.cn)("rounded-[20px] transition-all duration-200 ease-out","border border-card-border bg-[var(--muted)]","hover:border-foreground
1/15"),children:(0,t.jsx)("div",{className:"p-3.5",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(o.StepIcon,{stepType:"condition",size:"md"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-[13px] font-semibold truncate leading-tight",children:p}),"number"==typeof m&&m>0&&(0,t.jsxs)("div",{className:"flex items-center gap-0.5 mt-0.5",children:[(0,t.jsx)(c.Clock,{className:"h-2.5 w-2.5 text-muted-foreground/60"}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["Wait ",Math.round(m/1440),"d"]})]})]}),n.stepNumber&&(0,t.jsx)("span",{className:"absolute top-2.5 right-2.5 flex h-5 w-5 items-center justify-center rounded-[6px] bg-card border border-card-border text-[10px] font-bold text-muted-foreground tabular-nums z-10",children:n.stepNumber})]})})}),(0,t.jsxs)("div",{className:"relative mt-1",children:[!l.horizontal&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Handle,{type:"source",position:h.Position.Bottom,id:"met",className:"!w-2.5 !h-2.5 !border-2 !border-card !left-[30%] !-top-[5px]",style:{background:"#11A389"}}),(0,t.jsx)(i.Handle,{type:"source",position:h.Position.Bottom,id:"not_met",className:"!w-2.5 !h-2.5 !border-2 !border-card !left-[70%] !-top-[5px]",style:{background:"var(--destructive)"}})]}),(0,t.jsxs)("div",{className:"flex pt-2.5",children:[(0,t.jsx)("div",{className:"flex-1 flex justify-center",children:(0,t.jsx)("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full",style:{color:"#11A389",backgroundColor:"#11A38912"},children:"Yes"})}),(0,t.jsx)("div",{className:"flex-1 flex justify-center",children:(0,t.jsx)("span",{className:"text-[10px] text-destructive font-semibold bg-destructive/8 px-2 py-0.5 rounded-full",children:"No"})})]})]})]})});e.s(["ConditionNode",0,x],972881)},407289,e=>{"use strict";var t=e.i(843476),n=e.i(23750),i=e.i(10708),s=e.i(447170),a=e.i(271645);function l(e){return 0===e?{amount:0,unit:"minutes"}:e%1440==0?{amount:e/1440,unit:"days"}:e%60==0?{amount:e/60,unit:"hours"}:{amount:e,unit:"minutes"}}e.s(["DelayInput",0,function({value:e,onChange:r,label:o="Delay before step"}){let d=l(e),[c,u]=(0,a.useState)(d.amount),[p,m]=(0,a.useState)(d.unit);function h(e,t){u(e),m(t),r(function(e,t){switch(t){case"days":return 1440*e;case"hours":return 60*e;default:return e}}(e,t))}return(0,a.useEffect)(()=>{let t=l(e);u(t.amount),m(t.unit)},[e]),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(i.Label,{className:"text-xs",children:o}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(n.Input,{type:"number",variant:"on-white",min:0,value:c,onChange:e=>{let t=e.target.value;if(""===t)return h(0,p);let n=parseInt(t);isNaN(n)||h(n,p)},className:"text-sm w-20"}),(0,t.jsx)(s.SearchableSelect,{value:p,onValueChange:e=>h(c,e),options:[{value:"minutes",label:"Minutes"},{value:"hours",label:"Hours"},{value:"days",label:"Days"}],variant:"on-white",className:"flex-1"})]})]})}])},108799,e=>{"use strict";var t=e.i(843476),n=e.i(204753),i=e.i(915085),s=e.i(206003),a=e.i(188024),a=a,l=e.i(771649),r=e.i(370956),o=e.i(448876),d=e.i(956094),d=d,c=e.i(692365),c=c,u=e.i(82735),p=e.i(158524),m=e.i(37727),h=e.i(271645),f=e.i(23750),x=e.i(59377);function g(){return(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:["Type ",(0,t.jsx)("kbd",{className:"px-1 py-0.5 rounded bg-card border border-card-border text-[9px] font-mono",children:"/"})," to insert blocks, variables, templates, components, or snippets."," ","Type ",(0,t.jsx)("kbd",{className:"px-1 py-0.5 rounded bg-card border border-card-border text-[9px] font-mono",children:"|"})," inside a variable for fallbacks."]})}function b({value:e}){let n=e??"",i=n.trim(),s=i?i.split(/\s+/).length:0;return(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/70 text-right tabular-nums",children:[n.length," ",1===n.length?"character":"characters"," · ",s," ",1===s?"word":"words"]})}let y="inline-flex h-6 items-center justify-center squircle px-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",k="inline-flex h-7 w-7 items-center justify-center squircle text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",v=[{kind:"bold",label:"Bold",Icon:n.Bold},{kind:"italic",label:"Italic",Icon:i.Italic},{kind:"underline",label:"Underline",Icon:s.Underline},{kind:"clear",label:"Clear formatting",Icon:a.default}],j=[{kind:"bullet",label:"Bulleted list",Icon:r.List},{kind:"number",label:"Numbered list",Icon:o.ListOrdered},{kind:"outdent",label:"Outdent",Icon:c.default},{kind:"indent",label:"Indent",Icon:d.default}],N=[{kind:"body",label:"Body"},{kind:"h1",label:"H1"},{kind:"h2",label:"H2"},{kind:"h3",label:"H3"}];function w({onLink:e,selectedText:n}){let[i,s]=(0,h.useState)(!1),[a,l]=(0,h.useState)(""),r=i?n?.()??"":"";function o(){let t=a.trim();t&&(e(/^(https?:\/\/|mailto:)/i.test(t)?t:`https://${t}`),l(""),s(!1))}return(0,t.jsxs)(x.Popover,{open:i,onOpenChange:s,children:[(0,t.jsx)(x.PopoverTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",title:"Link","aria-label":"Link",className:y,children:(0,t.jsx)(p.Link2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.PopoverContent,{align:"start",side:"top",sideOffset:6,className:"w-72 p-2",children:(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:r?(0,t.jsxs)(t.Fragment,{children:["Link “",r.length>32?`${r.slice(0,32)}…`:r,"”"]}):"Insert a link"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(f.Input,{autoFocus:!0,value:a,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),o())},placeholder:"example.com",className:"h-7 text-xs"}),(0,t.jsx)("button",{type:"button",onClick:o,className:"inline-flex h-7 shrink-0 items-center squircle bg-primary px-2.5 text-[11px] font-medium text-primary-foreground transition-opacity hover:opacity-90",children:"Add"})]})]})})]})}e.s(["CharWordCount",0,b,"ComposerAttachments",0,function({attachments:e,onRemove:n}){return 0===e.length?null:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 squircle bg-card border border-card-border px-2 py-1 text-[11px] text-muted-foreground",children:[(0,t.jsx)(u.Paperclip,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"max-w-[14rem] truncate text-foreground",children:e.name}),e.size?(0,t.jsx)("span",{className:"tabular-nums",children:function(e){if(!e)return"";let t=["B","KB","MB"],n=e,i=0;for(;n>=1024&&i<t.length-1;)n/=1024,i++;return`${n<10&&i>0?n.toFixed(1):Math.round(n)} ${t[i]}`}(e.size)}):null,(0,t.jsx)("button",{type:"button",onClick:()=>n(e.url),title:`Remove ${e.name}`,"aria-label":`Remove ${e.name}`,className:"inline-flex h-4 w-4 items-center justify-center squircle transition-colors hover:bg-accent hover:text-foreground",children:(0,t.jsx)(m.X,{className:"h-2.5 w-2.5"})})]},e.url))})},"ComposerToolbar",0,function({value:e,onInsertVariable:n,onFormat:i,onBlock:s,onAttach:a,onLink:r,selectedText:o,busy:d}){let c=(0,h.useRef)(null),p=i&&s;return n||p||a||r||void 0!==e?(0,t.jsxs)("div",{className:"flex items-center gap-0.5 px-1.5 pb-2",children:[n&&(0,t.jsx)("button",{type:"button",onClick:n,title:"Insert a block, variable, template, component or snippet","aria-label":"Insert a block, variable, template, component or snippet",className:`${y} font-mono text-[11px] leading-none`,children:"{}"}),p&&(0,t.jsxs)(x.Popover,{children:[(0,t.jsx)(x.PopoverTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",title:"Style","aria-label":"Style",className:y,children:(0,t.jsx)(l.Type,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.PopoverContent,{align:"start",side:"top",sideOffset:6,className:"w-auto p-1",onOpenAutoFocus:e=>e.preventDefault(),children:(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("div",{className:"flex items-center gap-0.5",children:v.map(({kind:e,label:n,Icon:s})=>(0,t.jsx)("button",{type:"button",title:n,"aria-label":n,onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),className:k,children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})},e))}),(0,t.jsx)("div",{className:"flex items-center gap-0.5",children:j.map(({kind:e,label:n,Icon:i})=>(0,t.jsx)("button",{type:"button",title:n,"aria-label":n,onMouseDown:e=>e.preventDefault(),onClick:()=>s(e),className:k,children:(0,t.jsx)(i,{className:"h-3.5 w-3.5"})},e))}),(0,t.jsx)("div",{className:"flex items-center gap-0.5",children:N.map(({kind:e,label:n})=>(0,t.jsx)("button",{type:"button",title:`${n} text`,onMouseDown:e=>e.preventDefault(),onClick:()=>s(e),className:"inline-flex h-7 items-center justify-center squircle px-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:n},e))})]})})]}),r&&(0,t.jsx)(w,{onLink:r,selectedText:o}),a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.click(),title:"Attach a file — or drop one on the field","aria-label":"Attach a file",className:y,children:(0,t.jsx)(u.Paperclip,{className:`h-3.5 w-3.5 ${d?"animate-pulse":""}`})}),(0,t.jsx)("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:e=>{let t=Array.from(e.target.files??[]);t.length&&a(t),e.target.value=""}})]}),void 0!==e&&(0,t.jsx)("span",{className:"ml-auto pr-1",children:(0,t.jsx)(b,{value:e})})]}):null},"FieldMetaRow",0,function({note:e}){return(0,t.jsxs)("div",{className:"space-y-0.5",children:[e&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:e}),(0,t.jsx)(g,{})]})}],108799)},32739,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(771649),s=e.i(936046),a=e.i(255149),l=e.i(590911),r=e.i(370956),o=e.i(448876),d=e.i(656272),
1c=e.i(865960),u=e.i(758472),p=e.i(299023),m=e.i(607486),h=e.i(263488),f=e.i(546090),x=e.i(955716),g=e.i(662031),b=e.i(751975),y=e.i(248256),k=e.i(319882),k=k,v=e.i(678728),j=e.i(184762),N=e.i(23750),w=e.i(234216),S=e.i(26984),C=e.i(965638),_=e.i(879045),I=e.i(773993);let E={subject_line:"Subject Line",value_prop:"Value Prop",cta:"CTA",intro:"Intro",signature:"Signature",pain_point:"Pain Point",social_proof:"Social Proof",question:"Question",closer:"Closer",block:"Block",pitch_opener:"Pitch · Opener",pitch_value_prop:"Pitch · Value Prop",pitch_close:"Pitch · Close"},T=[{kind:"block",key:"blk-paragraph",label:"Text",description:"Plain paragraph",icon:i.Type,insertText:"",aliases:["p","text"]},{kind:"block",key:"blk-heading1",label:"Heading 1",description:"Large heading",icon:s.Heading1,insertText:"# ",aliases:["h1"]},{kind:"block",key:"blk-heading2",label:"Heading 2",description:"Medium heading",icon:a.Heading2,insertText:"## ",aliases:["h2"]},{kind:"block",key:"blk-heading3",label:"Heading 3",description:"Small heading",icon:l.Heading3,insertText:"### ",aliases:["h3"]},{kind:"block",key:"blk-bullet",label:"Bullet List",description:"Unordered list",icon:r.List,insertText:"• ",aliases:["ul","bullets"]},{kind:"block",key:"blk-numbered",label:"Numbered List",description:"Ordered list",icon:o.ListOrdered,insertText:"1. ",aliases:["ol","numbers"]},{kind:"block",key:"blk-task",label:"Task List",description:"Checklist",icon:d.CheckSquare,insertText:"☐ ",aliases:["todo","checklist"]},{kind:"block",key:"blk-quote",label:"Quote",description:"Block quote",icon:c.Quote,insertText:"> ",aliases:["quote","bq"]},{kind:"block",key:"blk-code",label:"Code Block",description:"Monospace code",icon:u.Code,insertText:"```\n",aliases:["code","pre"]},{kind:"block",key:"blk-divider",label:"Divider",description:"Horizontal line",icon:p.Minus,insertText:"---\n",aliases:["hr","line"]}],M={contact:{label:"Contact",icon:I.PeopleIcon},company:{label:"Company",icon:m.Building2},owner:{label:"Sender",icon:I.PeopleIcon},sequence:{label:"Sequence",icon:g.Share2},conditional:{label:"If / Fallback",icon:x.GitBranch}};e.s(["VariableInput",0,function({value:e,onChange:s,placeholder:a,rows:l=6,multiline:r=!0,onTemplateSelected:o,onComponentSelected:d,onSnippetSelected:c,hideHint:u,inputClassName:p,menuRef:m}
1){let[x,g]=(0,n.useState)(!1),[I,A]=(0,n.useState)(""),[D,L]=(0,n.useState)(0),[$,P]=(0,n.useState)(!1),[O,R]=(0,n.useState)(null),q=(0,n.useRef)(null),F=(0,n.useRef)(null),[B,z]=(0,n.useState)({top:0,left:0}),{templates:H,snippets:W,components:U,userId:V}=(0,_.useEmailTemplatesAndSnippets)(),K=(0,C.searchVariables)(I),G=(0,n.useMemo)(()=>$?K.filter(e=>"conditional"!==e.category):K,[K,$]),Y=(0,n.useMemo)(()=>H.filter(e=>e.user_id===V),[H,V]),X=(0,n.useMemo)(()=>H.filter(e=>e.user_id!==V),[H,V]),Q=(0,n.useMemo)(()=>W.filter(e=>e.user_id===V),[W,V]),J=(0,n.useMemo)(()=>W.filter(e=>e.user_id!==V),[W,V]),Z=(0,n.useMemo)(()=>{let e=[],t=new Map;for(let e of G){let n=t.get(e.category)??[];n.push(e),t.set(e.category,n)}for(let n of["contact","company","owner","sequence","conditional"]){let i=t.get(n);if(!i||0===i.length)continue;let s=M[n];e.push({id:`vars-${n}`,label:s.label,tabLabel:s.label,icon:s.icon,defaultIcon:b.Tag,items:i.map(e=>({id:`var-${e.key}`,label:e.label,aliases:e.aliases,meta:e.insertText??`{{${e.key}}}`,data:{kind:"variable",data:e}}))})}return $||(e.push({id:"placeholder",label:"Placeholder",tabLabel:"Placeholder",icon:k.default,defaultIcon:k.default,items:[{id:"general-placeholder",label:"General placeholder",description:"Required fill-in - blocks send until filled",icon:k.default,aliases:["placeholder","insert","fill","required","blank"],data:{kind:"placeholder"}}]}),T.length>0&&e.push({id:"blocks",label:"Insert block",tabLabel:"Blocks",icon:i.Type,defaultIcon:i.Type,items:T.map(e=>({id:e.key,label:e.label,description:e.description,icon:e.icon,aliases:e.aliases,data:{kind:"block",data:e}}))}),U.length>0&&e.push({id:"components",label:"Components",tabLabel:"Components",icon:y.Globe,defaultIcon:y.Globe,items:U.map(e=>({id:`cmp-${e.id}`,label:e.name,description:E[e.type],aliases:[e.body.toLowerCase().slice(0,20)],data:{kind:"component",data:e}}))}),Y.length>0&&e.push({id:"my-templates",label:"My Templates",tabLabel:"My Templates",icon:h.Mail,defaultIcon:h.Mail,items:Y.map(e=>({id:`mt-${e.id}`,label:e.name,description:e.subject||void 0,aliases:[e.subject?.toLowerCase()??""],data:{kind:"template",data:e}})),maxItems:10}),X.length>0&&e.push({id:"shared-templates",label:"Shared Templates",tabLabel:"Shared",icon:h.Mail,defaultIcon:h.Mail,items:X.map(e=>({id:`st-${e.id}`,label:e.name,description:e.subject||void 0,aliases:[e.subject?.toLowerCase()??""],data:{kind:"template",data:e}})),maxItems:10}),Q.length>0&&e.push({id:"my-snippets",label:"My Snippets",tabLabel:"My Snippets",icon:f.TextQuote,defaultIcon:f.TextQuote,items:Q.map(e=>({id:`ms-${e.id}`,label:e.name,description:e.body.slice(0,60)+(e.body.length>60?"…":""),aliases:[e.body.toLowerCase().slice(0,30)],data:{kind:"snippet",data:e}})),maxItems:10}),J.length>0&&e.push({id:"shared-snippets",label:"Shared Snippets",tabLabel:"Shared",icon:f.TextQuote,defaultIcon:f.TextQuote,items:J.map(e=>({id:`ss-${e.id}`,label:e.name,description:e.body.slice(0,60)+(e.body.length>60?"…":""),aliases:[e.body.toLowerCase().slice(0,30)],data:{kind:"snippet",data:e}})),maxItems:10})),e},[G,$,U,Y,X,Q,J]),ee=(0,n.useCallback)(t=>{let n=q.current;if(!n)return;let i=e.slice(0,D),a=e.slice(D),l=null!=O&&O<=i.length?i.slice(0,O):i;s(l+t+a),g(!1),A(""),R(null),requestAnimationFrame(()=>{n.focus();let e=l.length+t.length;n.setSelectionRange(e,e)})},[e,D,s,O]),et=(0,n.useCallback)(t=>{let n=q.current;if(!n)return;let i=e.slice(0,D);s(i+t+e.slice(D)),g(!1),A(""),P(!1),requestAnimationFrame(()=>{n.focus();let e=i.length+t.length;n.setSelectionRange(e,e)})},[e,D,s]),en=(0,n.useCallback)(()=>{let t=q.current;if(!t)return;let n=e.slice(0,D),i=e.slice(D),a=null!=O&&O<=n.length?n.slice(0,O):n;s(a+(0,v.makePlaceholderToken)(v.DEFAULT_PLACEHOLDER_LABEL)+i),g(!1),A(""),requestAnimationFrame(()=>{t.focus();let e=a.length+3;t.setSelectionRange(e,e+v.DEFAULT_PLACEHOLDER_LABEL.length)})},[e,D,s,O]),ei=(0,n.useCallback)(t=>{let n=t.data;if("placeholder"===n.kind)en();else if("variable"===n.kind)$?et(n.data.key):n.data.insertText?ee(n.data.insertText):ee(`{{${n.data.key}}}`);else if("template"===n.kind)ee(n.data.body),o&&o({subject:n.data.subject,body:n.data.body,template_id:n.data.id,template_name:n.data.name});else if("snippet"===n.kind)ee(n.data.body),c?.(n.data);else if("block"===n.kind)ee(n.data.insertText);else if("component"===n.kind){let t=q.current;if(t){let n=e.slice(0,D),i=e.slice(D),a=null!=O&&O<=n.length?n.slice(0,O):n;s(a+i),g(!1),A(""),requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(a.length,a.length)})}d?.(n.data)}},[ee,et,en,$,o,d,c,e,D,s,O]),es=(0,n.useCallback)(e=>{let t=e.target.value;s(t);let n=q.current,i=n?.selectionStart??e.target.selectionStart??0,a=0===i&&t.length>0?t.length:i;L(a),requestAnimationFrame(()=>{let e=n?.selectionStart;null!=e&&e!==a&&e<=t.length&&L(e)});let l=t.slice(0,a),r=t.slice(a),o=l.match(/\{\{(\w+(?:\|\w+)*)\|(\w*)$/);if(o&&r.startsWith("}}")){P(!0),A(o[2]),R(null),g(!0);return}P(!1);let d=l.lastIndexOf("/");if(d>=0&&(0===d||" "===l[d-1]||"\n"===l[d-1])){let e=l.slice(d+1);if(e.length<=30&&!e.includes(" ")){A(e),R(d),g(!0);return}}let c=l.split(/[\s,]+/),u=c[c.length-1]?.toLowerCase()??"";if(u.length>=3){let e=C.MERGE_VARIABLES.find(e=>e.aliases.includes(u)||e.label.toLowerCase()===u);if(e&&!l.endsWith(`{{${e.key}}}`)){A(u),R(null),g(!0);return}}x&&d<0&&!$&&(g(!1),A(""),R(null))},[s,x,$]),ea=(0,n.useCallback)(()=>{let t=q.current;t&&(t.focus(),L(t.selectionStart??e.length)),P(!1),R(null),A(""),g(!0)},[e.length]),el=(0,n.useCallback)(t=>{let n=q.current;if(!n)return;let i=n.selectionStart??0,a=n.selectionEnd??i,l=e.slice(i,a),r=(e,t,i)=>{s(e),L(i),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(t,i)})};if("clear"===t){if(!l)return;let t=l.replace(/\*\*|__|\*/g,"");r(e.slice(0,i)+t+e.slice(a),i,i+t.length);return}let o="bold"===t?"**":"underline"===t?"__":"*";if(("italic"!==t||"*"!==e.slice(i-2,i-1)&&"*"!==e.slice(a+1,a+2))&&e.slice(i-o.length,i)===o&&e.slice(a,a+o.length)===o)return void r(e.slice(0,i-o.length)+l+e.slice(a+o.length),i-o.length,a-o.length);if(l.length>2*o.length&&l.startsWith(o)&&l.endsWith(o)){let t=l.slice(o.length,-o.length);r(e.slice(0,i)+t+e.slice(a),i,i+t.length);return}r(e.slice(0,i)+o+l+o+e.slice(a),i+o.length,i+o.length+l.length)},[e,s]),er=(0,n.useCallback)(()=>{let t=q.current;return t?e.slice(t.selectionStart??0,t.selectionEnd??0):""},[e]),eo=(0,n.useCallback)(t=>{let n=q.current;if(!n||!t)return;let i=n.selectionStart??e.length,a=n.selectionEnd??i,l=e.slice(i,a),r=`[${l||t}](${t})`;s(e.slice(0,i)+r+e.slice(a));let o=i+r.length;L(o),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(o,o)})},[e,s]),ed=(0,n.useCallback)(t=>{let n=q.current,i=n?.selectionStart??e.length,a=e.slice(0,i),l=e.slice(i),r=a&&!a.endsWith("\n")?"\n\n":"",o=l&&!l.startsWith("\n")?"\n\n":"",d=`${r}${t}${o}`;s(a+d+l);let c=a.length+d.length;L(c),requestAnimationFrame(()=>{n?.focus(),n?.setSelectionRange(c,c)})},[e,s]),ec=(0,n.useCallback)(t=>{let n=q.current;if(!n)return;let i=n.selectionStart??0,a=n.selectionEnd??i,l=e.lastIndexOf("\n",i-1)+1,r=e.indexOf("\n",a),o=-1===r?e.length:r,d=e.slice(l,o).split("\n").map(e=>{let t=e.match(/^([ \t]*)((?:[\u2022\-*]|[\u2610\u2611])\s+|\d+\.\s+|#{1,3}\s+)?(.*)$/);return{indent:t?.[1]??"",marker:t?.[2]??"",text:t?.[3]??e}}),c=d.every(e=>{let t;return t=e.marker,/^(?:[\u2022\-*]|[\u2610\u2611])\s+$/.test(t)}),u=d.every(e=>{let t;return t=e.marker,/^\d+\.\s+$/.test(t)}),p=d.map(({indent:e,marker:n,text:i},s)=>{switch(t){case"bullet":return c?e+i:`${e}\u2022 ${i}`;case"number":return u?e+i:`${e}${s+1}. ${i}`;case"indent":return`  ${e}${n}${i}`;case"outdent":return e.replace(/^(?: {1,2}|\t)/,"")+n+i;case"body":return e+(/^(?:[\u2022\-*]|[\u2610\u2611])\s+$/.test(n)||/^\d+\.\s+$/.test(n)?n:"")+i;default:{let n="#".repeat(Number(t.slice(1)));return`${e}${n} ${i}`}}}).join("\n");s(e.slice(0,l)+p+e.slice(o)),L(l+p.length),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(l,l+p.length)})},[e,s]);(0,n.useEffect)(()=>
1{if(m)return m.current={open:ea,format:el,block:ec,insert:ed,link:eo,selectedText:er},()=>{m.current=null}},[m,ea,el,ec,ed,eo,er]),(0,n.useEffect)(()=>{if(!x)return;let e=q.current;if(!e)return;F.current=e;let t=e.getBoundingClientRect();z({top:t.top,left:t.left})},[x]);let eu=r?j.Textarea:N.Input;return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(eu,{ref:q,value:e,onChange:es,onKeyDown:t=>{if("Backspace"!==t.key&&"Delete"!==t.key)return;let n=t.currentTarget;if(n.selectionStart!==n.selectionEnd)return;let i=n.selectionStart??0,a=(0,w.tokenSpans)(e).find(e=>"Backspace"===t.key?i>e.start&&i<=e.end:i>=e.start&&i<e.end);a&&(t.preventDefault(),s(e.slice(0,a.start)+e.slice(a.end)),L(a.start),g(!1),requestAnimationFrame(()=>{n.focus(),n.setSelectionRange(a.start,a.start)}))},onClick:t=>{let n=t.target,i=n.selectionStart??0;if(L(i),n.selectionStart!==n.selectionEnd)return;let s=(0,w.tokenAt)(e,i);s&&(n.setSelectionRange(s.start,s.end),L(s.end),R(s.start),P(!1),A(""),g(!0))},placeholder:a,rows:r?l:void 0,className:`text-base md:text-sm resize-none ${p??""}`}),(0,t.jsx)(w.VariableChipsOverlay,{inputRef:q,value:e,multiline:r})]}),!u&&(0,t.jsxs)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:["Type ",(0,t.jsx)("kbd",{className:"px-1 py-0.5 rounded bg-muted text-[9px] font-mono",children:"/"})," to insert blocks, variables, templates, components, or snippets."," ","Type ",(0,t.jsx)("kbd",{className:"px-1 py-0.5 rounded bg-muted text-[9px] font-mono",children:"|"})," inside a variable for fallbacks"]}),x&&Z.length>0&&(0,t.jsx)(S.UnifiedSlashMenu,{position:B,anchorRef:F,query:I,sections:Z,onSelect:ei,onClose:()=>{g(!1),P(!1),R(null)},searchPlaceholder:$?"Pick a fallback variable…":"Search blocks, variables, templates…"})]})}],32739)},316927,e=>{"use strict";var t=e.i(843476),n=e.i(190833);e.s(["CleanUpIcon",0,function({className:e,sweeping:i}){return(0,t.jsx)(n.Paintbrush,{className:`${e??""} ${i?"dictate-brush-sweep":"dictate-brush-rest"}`,"aria-hidden":!0})}])},967416,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(643531),s=e.i(664659),a=e.i(941388),l=e.i(37727),r=e.i(59377),o=e.i(127491),d=e.i(647163);e.s(["MultiSelectChips",0,function({value:e,onChange:c,options:u,placeholder:p="Add…",customLabel:m="Add custom",className:h}){let[f,x]=(0,n.useState)(!1),[g,b]=(0,n.useState)(""),y=(0,n.useRef)(null);function k(t){let n=t.trim();n&&c(e.includes(n)?e.filter(e=>e!==n):[...e,n])}function v(){let t=g.trim();!t||e.includes(t)||(c([...e,t]),b(""))}(0,n.useEffect)(()=>{f&&requestAnimationFrame(()=>y.current?.focus())},[f]);let j=(0,n.useMemo)(()=>{let t=g.trim().toLowerCase(),n=u.filter(e=>!t||e.toLowerCase().includes(t)),i=new Set(e);return[...n.filter(e=>i.has(e)),...n.filter(e=>!i.has(e))]},[u,g,e]),N=g.trim().length>0&&!u.some(e=>e.toLowerCase()===g.trim().toLowerCase())&&!e.some(e=>e.toLowerCase()===g.trim().toLowerCase()),w=+!!N+j.length,S=(0,o.useRowNavigation)(w,e=>{if(N&&0===e)return void v();let t=j[e-!!N];t&&k(t)});return(0,t.jsxs)("div",{className:(0,d.cn)("flex flex-wrap items-center gap-1.5",h),children:[e.map(n=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs",children:[n,(0,t.jsx)("button",{type:"button",onClick:()=>{c(e.filter(e=>e!==n))},className:"text-muted-foreground hover:text-foreground rounded-full -mr-0.5 p-0.5",title:`Remove ${n}`,"aria-label":`Remove ${n}`,children:(0,t.jsx)(l.X,{className:"h-2.5 w-2.5"})})]},n)),(0,t.jsxs)(r.Popover,{open:f,onOpenChange:x,children:[(0,t.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-xs text-muted-foreground hover:border-foreground
1/40 hover:text-foreground transition-colors",children:[(0,t.jsx)(a.Plus,{className:"h-3 w-3"}),p,(0,t.jsx)(s.ChevronDown,{className:"h-3 w-3 opacity-60"})]})}),(0,t.jsxs)(r.PopoverContent,{align:"start",className:"w-72 p-0 overflow-hidden",children:[(0,t.jsx)(o.DropdownSearchRow,{inputRef:y,value:g,onValueChange:e=>{b(e),S.setActive(0)},onKeyDown:S.onKeyDown,placeholder:"Search or add custom…",addAction:N?{label:`${m}: ${g.trim()}`,onClick:v}:void 0}),(0,t.jsxs)("div",{className:"max-h-[280px] overflow-y-auto p-1",children:[N&&(0,t.jsxs)("button",{type:"button","data-slot":"dropdown-row",...S.rowProps(0),onClick:v,className:o.DROPDOWN_ROW_CLASS,children:[(0,t.jsx)(a.Plus,{className:"size-3.5 text-muted-foreground shrink-0"}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-start",children:[m,": ",(0,t.jsx)("span",{className:"font-medium",children:g.trim()})]}),(0,t.jsx)(o.EnterHint,{})]}),0===w?(0,t.jsx)("p",{className:o.DROPDOWN_EMPTY_CLASS,children:"No matches."}):j.map((n,s)=>{let a=e.includes(n);return(0,t.jsxs)("button",{type:"button","data-slot":"dropdown-row",...S.rowProps(s+ +!!N),onClick:()=>k(n),className:o.DROPDOWN_ROW_CLASS,children:[(0,t.jsx)("span",{className:(0,d.cn)("min-w-0 flex-1 truncate text-start",a&&"font-medium"),children:n}),a&&(0,t.jsx)(i.Check,{className:"size-3.5 shrink-0"}),(0,t.jsx)(o.EnterHint,{className:a?"ms-0":void 0})]},n)})]})]})]})]})}])},234216,e=>{"use strict";let t;var n=e.i(843476),i=e.i(271645),s=e.i(965638);let a=/\{\{=[^{}]*\}\}|\{\{#if\s+\w+\}\}|\{\{else\}\}|\{\{\/if\}\}|\{\{\w+(?:\.\w+)+\}\}|\{\{\w+(?:\|\w+)*\}\}/g,l=new Map;function r(e,n){if(!n)return 0;let i=`${n}\u0000${e}`,s=l.get(i);if(void 0!==s)return s;if(void 0===t&&(t="u"<typeof document?null:document.createElement("canvas").getContext("2d")),!t)return 0;t.font=n;let a=t.measureText(e).width;return l.size>5e3&&l.clear(),l.set(i,a),a}function o(e){return e.replace(/^(?:\d+|normal|bold)\s+/,"").replace(/^/,"600 ")}let d=new Map(s.MERGE_VARIABLES.map(e=>[e.key,e.label])),c={url:"URL",id:"ID",linkedin:"LinkedIn"};function u(e,t){let n=t?.[e]??d.get(e);return n?n:(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).split("_").filter(Boolean).map(e=>c[e]??e[0].toUpperCase()+e.slice(1)).join(" ")}let p={trigger:"Trigger",contact:"Person",company:"Company",deal:"Deal",owner:"Owner",assignee:"Assignee",submission:"Form",form:"Form",ai:"Answer"},m=["font-family","font-size","font-weight","font-style","font-variant","font-feature-settings","letter-spacing","word-spacing","line-height","text-transform","text-indent","text-align","text-rendering","padding-top","padding-right","padding-bottom","padding-left","tab-size","direction"];function h({kind:e,token:t,font:i,labels:s}){let a=function(e,t,n,i){let s=r(t,n);for(let a of function(e,t,n){if("todo"===e)return[t.slice(3,-2).trim()].filter(Boolean);if("logic"===e)return"{{else}}"===t?["Else"]:"{{/if}}"===t?["End"]:[`If ${u(t.slice(5,-2).trim(),n)}`];let i=t.slice(2,-2);if(!i.includes("|")){let e=u(i,n),t=function(e,t){let n,i=e.indexOf(".");if(i<0)return null;let s=p[e.slice(0,i)];return!s||t.toLowerCase().startsWith(s.toLowerCase())?null:`${s} ${(n=t.split(" ")[0]??"").slice(1)!==n.slice(1).toLowerCase()?t:t[0].toLowerCase()+t.slice(1)}`}(i,e);return t?[t,e]:[e]}let s=i.split("|").map(e=>u(e,n));return[s.join(" or "),s.join(" / "),s[0]]}(e,t,i))if(!n||r(a,o(n))<=s)return a;return t}(e,t,i,s),l=a===t?void 0:function(e,t,n){let i;if(!n||e.length<2)return;let s=r(t,n)-r(e,o(n));if(s<=.25)return;let a=s/e.length,l=Math.min(.35*r(t,n)/e.length,((i=/(\d*\.?\d+)px/.exec(n))?parseFloat(i[1]):0)*.06);return`${Math.min(a,l).toFixed(3)}px`}(a,t,i);return(0,n.jsx)("span",{className:"tpl-chip-label",style:l?{letterSpacing:l,textIndent:l}:void 0,children:a})}e.s(["VariableChipsOverlay",0,function({inputRef:e,value:t,multiline:s=!0,labels:l}){let r=(0,i.useRef)(null),o=(0,i.useRef)(null),d=(0,i.useMemo)(()=>(function(e){let t=[],n=0;for(let s of e.matchAll(a)){var i;let a=s.index??0;a>n&&t.push({kind:"text",text:e.slice(n,a)}),t.push({kind:(i=s[0]).startsWith("{{=")?"todo":i.startsWith("{{#if")||"{{else}}"===i||"{{/if}}"===i?"logic":"variable",text:s[0]}),n=a+s[0].length}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t})(t),[t]),[c,u]=(0,i.useState)(""),p=(0,i.useCallback)(()=>{let t=e.current,n=r.current,i=o.current;if(!t||!n||!i)return;let s=getComputedStyle(t);for(let e of m)n.style.setProperty(e,s.getPropertyValue(e));let a=s.font||`${s.fontWeight} ${s.fontSize} ${s.fontFamily}`;u(e=>e===a?e:a),n.style.top=s.borderTopWidth,n.style.left=s.borderLeftWidth,n.style.width=`${t.clientWidth}px`,n.style.height=`${t.clientHeight}px`,i.style.transform=`translate(${-t.scrollLeft}px, ${-t.scrollTop}px)`,n.style.visibility="visible"},[e]);return(0,i.useLayoutEffect)(p),(0,i.useEffect)(()=>{let t=e.current;if(!t)return;let n=t.style.color,i=t.style.caretColor;t.style.color="transparent",t.style.caretColor="var(--foreground)",t.dataset.chipsMirrored="true";let s=new ResizeObserver(p);return s.observe(t),t.addEventListener("scroll",p),window.addEventListener("resize",p),()=>{s.disconnect(),t.removeEventListener("scroll",p),window.removeEventListener("resize",p),t.style.color=n,t.style.caretColor=i,delete t.dataset.chipsMirrored}}
1,[e,p]),(0,n.jsx)("div",{ref:r,"aria-hidden":!0,className:"pointer-events-none absolute overflow-hidden text-foreground",style:s?{boxSizing:"border-box",visibility:"hidden"}:{boxSizing:"border-box",visibility:"hidden",display:"flex",alignItems:"center"},children:(0,n.jsxs)("div",{ref:o,style:{whiteSpace:s?"pre-wrap":"pre",overflowWrap:s?"break-word":void 0,flexShrink:s?void 0:0},children:[d.map((e,t)=>"text"===e.kind?(0,n.jsx)("span",{children:e.text},t):(0,n.jsxs)("span",{className:`tpl-chip${"todo"===e.kind?" tpl-chip-todo":""}${"logic"===e.kind?" tpl-chip-logic":""}`,children:[(0,n.jsx)("span",{className:"tpl-chip-token",children:e.text}),(0,n.jsx)(h,{kind:e.kind,token:e.text,font:c,labels:l})]},t)),"​"]})})},"tokenAt",0,function(e,t){for(let n of e.matchAll(a)){let e=n.index??0,i=e+n[0].length;if(t>=e&&t<=i)return{text:n[0],start:e,end:i}}return null},"tokenSpans",0,function(e){return[...e.matchAll(a)].map(e=>({text:e[0],start:e.index??0,end:(e.index??0)+e[0].length}))}])},308408,e=>{"use strict";var t=e.i(920755),n=e.i(900529);function i(e){return"string"==typeof e&&e.trim()?e:null}async function s(e,a=60){let l,r=e.trim();if(r.length<2)return[];let o=(l=(0,t.createClient)(),[{type:"contact",label:"Person",run:(e,t)=>l.from("contacts").select("id, name, email, image_url, job_title").or(`name.ilike.${e},email.ilike.${e}`).limit(t),map:e=>{let t=i(e.name);return t?{id:String(e.id),name:t,href:`/people/${e.id}`,subtitle:i(e.job_title)??i(e.email),imageUrl:i(e.image_url)}:null}},{type:"company",label:"Company",run:(e,t)=>l.from("companies").select("id, name, domain, logo_url").or(`name.ilike.${e},domain.ilike.${e}`).limit(t),map:e=>{let t=i(e.name);return t?{id:String(e.id),name:t,href:`/companies/${e.id}`,subtitle:i(e.domain),imageUrl:i(e.logo_url),domain:i(e.domain)}:null}},{type:"deal",label:"Deal",run:(e,t)=>l.from("deals").select("id, name, stage").ilike("name",e).limit(t),map:e=>{let t=i(e.name);return t?{id:String(e.id),name:t,href:`/deals/${e.id}`,subtitle:i(e.stage)}:null}},{type:"document",label:"Contract",run:(e,t)=>l.from("documents").select("id, title, status").ilike("title",e).limit(t),map:e=>{let t=i(e.title);return t?{id:String(e.id),name:t,href:`/contracts/${e.id}`,subtitle:i(e.status)}:null}},{type:"doc",label:"Doc",run:(e,t)=>l.from("docs").select("id, title").is("deleted_at",null).ilike("title",e).limit(t),map:e=>{let t=i(e.title);return t?{id:String(e.id),name:t,href:`/docs/${e.id}`}:null}},{type:"ticket",label:"Ticket",run:(e,t)=>l.from("support_tickets").select("id, subject, ticket_number, stage").ilike("subject",e).limit(t),map:e=>{let t=i(e.subject);return t?{id:String(e.id),name:t,href:`/tickets/${e.id}`,subtitle:null!=e.ticket_number?`#${String(e.ticket_number)}`:i(e.stage)}:null}},{type:"task",label:"Task",run:(e,t)=>l.from("record_tasks").select("id, title, task_type").ilike("title",e).limit(t),map:e=>{let t=i(e.title);return t?{id:String(e.id),name:t,href:"/tasks",subtitle:i(e.task_type)}:null}},{type:"product",label:"Product",run:(e,t)=>l.from("products").select("id, name, sku").ilike("name",e).limit(t),map:e=>{let t=i(e.name);return t?{id:String(e.id),name:t,href:"/products",subtitle:i(e.sku)}:null}},{type:"sequence",label:"Sequence",run:(e,t)=>l.from("sequences").select("id, name, status").ilike("name",e).limit(t),map:e=>{let t=i(e.name);return t?{id:String(e.id),name:t,href:`/sequences/${e.id}`,subtitle:i(e.status)}:null}},{type:"job",label:"Job",run:(e,t)=>l.from("job_board_jobs").select("id, title, company_name").ilike("title",e).limit(t),map:e=>{let t=i(e.title);return t?{id:String(e.id),name:t,href:`/jobs/${e.id}`,subtitle:i(e.company_name)}:null}}]),d=await Promise.all(o.map(e=>(0,n.twoPassIlike)(r,e.run,e=>String(e.id),25).catch(()=>[]))),c=[];return d.forEach((e,t)=>{let n=o[t];for(let{row:t,prefix:i}of e){let e=n.map(t);if(!e)continue;let s=e.name.replace(/\s+/g," ").trim();c.push({name:s,prefix:i,entity:{id:`${n.type}:${e.id}`,platform:"member",kind:"record",recordType:n.type,name:s,token:`@${s}`,href:e.href,imageUrl:e.imageUrl??null,domain:e.domain??null,subtitle:e.subtitle?`${n.label} \xb7 ${e.subtitle}`:n.label}})}}),c.sort((e,t)=>
1(0,n.compareHits)(e,t,r)),c.slice(0,a).map(e=>e.entity)}e.s(["searchRecordMentions",0,s,"toMessageMention",0,function(e){return{userId:e.id,name:e.name,token:e.token,..."app"===e.kind?{kind:"app"}:{},..."record"===e.kind?{kind:"record",recordType:e.recordType??null,href:e.href??null,domain:e.domain??null}:{},...e.imageUrl?{imageUrl:e.imageUrl}:{}}}])},537150,e=>{"use strict";e.s(["STEP_ROW_FIELDS",0,["id","position","step_type","delay_minutes","execution_mode","parent_step_id","branch_key","node_x","node_y","config"],"WORKFLOW_ROW_FIELDS",0,["id","position","node_type","action_type","parent_node_id","branch_key","node_x","node_y","config"],"rowsSignature",0,function(e,t){return e.map(e=>t.map(t=>JSON.stringify(e[t]??null)).join("|")).sort().join("\n")}])},911356,e=>{"use strict";var t=e.i(306519);e.s(["layoutStepRows",0,function(e,n){let{branchKeysOf:i,...s}=n;return(0,t.layoutFlow)(function(e,t){let n=[...e].sort((e,t)=>e.position-t.position),i=new Map(n.map(e=>[e.id,e])),s=new Set,a=e=>e.branchKey??"";function l(e){s.add(e.id);let i=t(e),r=[...i,...n.filter(t=>t.parentId===e.id).map(a).filter(e=>!i.includes(e))].map(t=>{let i;return(i=e.id,n.filter(e=>e.parentId===i&&a(e)===t)).filter(e=>!s.has(e.id)).map(l)});return{id:e.id,width:e.width,height:e.height,branches:r}}let r=n.filter(e=>!e.parentId||!i.has(e.parentId)).filter(e=>!s.has(e.id)).map(l);for(let e of n)s.has(e.id)||r.push(l(e));return r}(e,i),s)}])},448719,e=>{"use strict";e.s(["AI_ELSE_HANDLE",0,"__else","aiBranchChoices",0,function(e){let t=String(e?.branch_on??"").trim();if(!t)return[];let n=(Array.isArray(e?.outputs)?e.outputs:[]).find(e=>String(e?.key??"").trim()===t),i=new Set,s=[];for(let e of n?.choices??[]){let t=String(e??"").trim();!t||i.has(t.toLowerCase())||(i.add(t.toLowerCase()),s.push(t))}return s}])},924103,e=>{"use strict";let t=new Set(["condition","delay"]);function n(e){return!t.has(e)}function i(e,t){if("condition"===e.step_type)return["met","not_met"];let n=[];for(let i of t){if(i.parent_step_id!==e.id)continue;let t=i.branch_key?.trim();!t||n.includes(t)||n.push(t)}return n}function s(e){let t=[...e].sort((e,t)=>e.position-t.position),s=new Map,a=new Set,l=(e,n)=>t.filter(t=>t.parent_step_id===e&&t.branch_key===n);function r(e,o){let d=o;for(let o of e)if(!a.has(o.id))for(let e of(a.add(o.id),n(o.step_type)&&s.set(o.id,++d),i(o,t)))r(l(o.id,e),d)}return r(t.filter(e=>!e.parent_step_id),0),r(t.filter(e=>!a.has(e.id)),0),s}e.s(["buildStepNodes",0,function(e,t){let n=[...e].sort((e,t)=>e.position-t.position),a=s(n),l=new Set,r=(e,t)=>n.filter(n=>n.parent_step_id===e&&n.branch_key===t);function o(e){let s=[];for(let d of e){if(l.has(d.id))continue;l.add(d.id);let e=i(d,n).map(e=>({branch:e,children:o(r(d.id,e))})).filter(e=>e.children.length>0);if("condition"===d.step_type||e.length>0){s.push({kind:"fork",id:d.id,step:d,label:t(d),branches:e});continue}s.push({kind:"step",id:d.id,step:d,number:a.get(d.id)})}return s}return[...o(n.filter(e=>!e.parent_step_id)),...o(n.filter(e=>!l.has(e.id)))]},"hasParallelBranches",0,function e(t){return t.some(t=>"fork"===t.kind&&(t.branches.length>1||t.branches.some(t=>e(t.children))))},"isTouchpoint",0,n,"numberTouchpoints",0,s])},341544,e=>{"use strict";var t=e.i(271645),n=e.i(567136),i=e.i(533377);e.s(["useStepLabel",0,function(){let e=(0,n.useAskAgentLabel)();return(0,t.useCallback)((t,n)=>n?.trim()||("ai_step"===t?e:i.STEP_TYPE_CONFIG[t]?.label??t),[e])}])},433084,e=>{"use strict";let t=(0,e.i(475254).default)("file-play",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]]);e.s(["default",0,t])},240250,e=>{"use strict";let t=(0,e.i(475254).default)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);e.s(["default",0,t])},959388,e=>{"use strict";let t=(0,e.i(475254).default)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);e.s(["default",0,t])},785101,24800,e=>{"use strict";var t=e.i(475254);let n=(0,t.default)("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);e.s(["default",0,n],785101);let i=(0,t.default)("move-vertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]);e.s(["default",0,i],24800)},692365,e=>{"use strict";let t=(0,e.i(475254).default)("list-indent-decrease",[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]]);e.s(["default",0,t])},956094,e=>{"use strict";let t=(0,e.i(475254).default)("list-indent-increase",[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]]);e.s(["default",0,t])},730700,e=>{"use strict";let t=(0,e.i(475254).default)("move-horizontal",[["path",{d:"m18 8 4 4-4 4",key:"1ak13k"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}]]);e.s(["default",0,t])},642068,e=>{"use strict";var t=e.i(730700);e.s(["MoveHorizontal",()=>t.default])},349191,e=>{"use strict";let t=(0,e.i(475254).default)("redo-2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);e.s(["default",0,t])},147845,e=>{"use strict";var t=e.i(349191);e.s(["Redo2",()=>t.default])},188024,e=>{"use strict";let t=(0,e.i(475254).default)("remove-formatting",[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]]);e.s(["default",0,t])},946198,e=>{"use strict";let t=(0,e.i(475254).default)("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);e.s(["default",0,t])},520354,e=>{"use strict";var t=e.i(946198);e.s(["ZoomOut",()=>t.default])},473297,e=>{"use strict";let t=[{value:"email_opened",label:"Email was opened",nodeLabel:"Email Opened?",group:"Email"},{value:"email_replied",label:"Email was replied to",nodeLabel:"Email Replied?",group:"Email"},{value:"email_bounced",label:"Email bounced",nodeLabel:"Email Bounced?",group:"Email"},{value:"linkedin_connected",label:"Already connected on LinkedIn",nodeLabel:"Connected on LinkedIn?",group:"LinkedIn"},{value:"linkedin_accepted",label:"LinkedIn connection accepted",nodeLabel:"Connection Accepted?",group:"LinkedIn"},{value:"linkedin_replied",label:"LinkedIn message replied",nodeLabel:"LinkedIn Replied?",group:"LinkedIn"},{value:"x_replied",label:"X DM replied",nodeLabel:"X Replied?",group:"X"},{value:"whatsapp_read",label:"WhatsApp message read",nodeLabel:"WhatsApp Read?",group:"WhatsApp"},{value:"whatsapp_replied",label:"WhatsApp message replied",nodeLabel:"WhatsApp Replied?",group:"WhatsApp"},{value:"contact_status_changed",label:"Contact status equals",nodeLabel:"Contact Status?",group:"Status"}
1,{value:"company_status_changed",label:"Company status equals",nodeLabel:"Company Status?",group:"Status"},{value:"ai_result",label:"AI step answered",nodeLabel:"AI Said?",group:"AI"}];t.map(e=>e.value),e.s(["RECIPIENT_COLORS",0,["#3B82F6","#11A389","#D7782C","#C62F4C","#8B5CF6","#EC4899","#06B6D4","#E5A853"],"SEQUENCE_CONDITIONS",0,t])}]);

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.