{"version":3,"file":"WorkflowlineCode.Uvm8Fbrw.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/jUdKyDIKcG9jz0onyKUG/cASgDQZ9hMIRjVLpbVNh/WorkflowlineCode.js"],"sourcesContent":["// Workflowline · code tabs. The same workflow in TypeScript, Python and Go; the active tab types itself\n// in when the section is first seen, with a copy button and a three-step quickstart beside it.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{PAL,F,useFonts,useViewport,useSeen,SectionHead,reducedMotion}from\"https://framerusercontent.com/modules/qg4T1HcqQ4yzDT0m1vJU/0G42LJUcWojpbDuVeq8V/WorkflowlineKit.js\";const SRC={TypeScript:{file:\"workflows/onboarding.ts\",code:`import { orrindel } from \"@orrindel/sdk\"\n\nexport const onboarding = orrindel.workflow(\n  { id: \"onboarding\", trigger: \"user.signed_up\" },\n  async ({ event, step }) => {\n    const plan = await step.run(\"pick-plan\", () =>\n      llm.classify(event.company, [\"solo\", \"team\", \"enterprise\"]))\n\n    await step.run(\"send-welcome\", () => mail.send(event.email, welcome(plan)))\n    await step.sleep(\"give-it-a-day\", \"1d\")\n\n    const active = await step.waitForEvent(\"first-run\", {\n      event: \"workflow.first_run\", match: \"data.userId\", timeout: \"6d\" })\n\n    if (!active) await step.run(\"nudge\", () => mail.send(event.email, nudge()))\n  }\n)`},Python:{file:\"workflows/onboarding.py\",code:`from orrindel import workflow, Step\n\n@workflow(id=\"onboarding\", trigger=\"user.signed_up\")\nasync def onboarding(event, step: Step):\n    plan = await step.run(\"pick-plan\",\n        lambda: llm.classify(event.company, [\"solo\", \"team\", \"enterprise\"]))\n\n    await step.run(\"send-welcome\", lambda: mail.send(event.email, welcome(plan)))\n    await step.sleep(\"give-it-a-day\", \"1d\")\n\n    active = await step.wait_for_event(\"first-run\",\n        event=\"workflow.first_run\", match=\"data.user_id\", timeout=\"6d\")\n\n    if not active:\n        await step.run(\"nudge\", lambda: mail.send(event.email, nudge()))`},Go:{file:\"workflows/onboarding.go\",code:`package workflows\n\nvar Onboarding = orrindel.Workflow(\"onboarding\", \"user.signed_up\",\n  func(ctx orrindel.Ctx, ev SignedUp) error {\n    plan, err := orrindel.Run(ctx, \"pick-plan\", func() (string, error) {\n      return llm.Classify(ev.Company, \"solo\", \"team\", \"enterprise\")\n    })\n    if err != nil { return err }\n\n    orrindel.Run(ctx, \"send-welcome\", func() (any, error) { return mail.Send(ev.Email, Welcome(plan)) })\n    orrindel.Sleep(ctx, \"give-it-a-day\", 24*time.Hour)\n\n    active, _ := orrindel.WaitForEvent(ctx, \"first-run\", \"workflow.first_run\", 6*24*time.Hour)\n    if active == nil { orrindel.Run(ctx, \"nudge\", func() (any, error) { return mail.Send(ev.Email, Nudge()) }) }\n    return nil\n  })`}};const KW=/\\b(import|from|export|const|await|async|if|not|def|return|package|var|func|nil|err|lambda)\\b/g;function paint(line){const out=[];let last=0;const re=/(\"[^\"]*\")|(\\b(?:import|from|export|const|await|async|if|not|def|return|package|var|func|nil|lambda)\\b)|(@\\w+)|(\\/\\/.*|#.*)/g;let m;let k=0;while(m=re.exec(line)){if(m.index>last)out.push(/*#__PURE__*/_jsx(\"span\",{style:{color:PAL.soft},children:line.slice(last,m.index)},k++));const c=m[1]?PAL.str:m[2]?PAL.hold:m[3]?PAL.signal:PAL.dim;out.push(/*#__PURE__*/_jsx(\"span\",{style:{color:c},children:m[0]},k++));last=m.index+m[0].length;}if(last<line.length)out.push(/*#__PURE__*/_jsx(\"span\",{style:{color:PAL.soft},children:line.slice(last)},k++));return out;}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1440\n * @framerIntrinsicHeight 880\n */export default function WorkflowlineCode(props){const{eyebrow=\"09 \\xb7 Your language\",title=\"Write it in the language you already ship.\",body=\"Workflows live in your repo, deploy with your app and run on your cloud or ours. TypeScript, Python and Go SDKs share one runtime and one dashboard.\"}=props;useFonts();const isStatic=useIsStaticRenderer();const root=React.useRef(null);const{W}=useViewport(root);const seen=useSeen(root,isStatic);const[tab,setTab]=React.useState(\"TypeScript\");const[chars,setChars]=React.useState(isStatic?9999:0);const[copied,setCopied]=React.useState(false);const src=SRC[tab];React.useEffect(()=>{if(!seen||isStatic)return;if(reducedMotion()){setChars(9999);return;}setChars(0);let raf=0;const t0=performance.now();const f=now=>{const n=Math.floor((now-t0)/1e3*900);setChars(n);if(n<src.code.length)raf=requestAnimationFrame(f);};raf=requestAnimationFrame(f);return()=>cancelAnimationFrame(raf);},[seen,tab]);const phone=W<760,pad=phone?16:W<1100?32:64;const split=W>=1100;const lines=src.code.split(\"\\n\");let budget=chars;const copy=()=>{try{navigator.clipboard.writeText(src.code);}catch(e){}setCopied(true);setTimeout(()=>setCopied(false),1400);};const steps=[[\"Install the SDK\",\"npm i @orrindel/sdk\",\"or pip install orrindel \\xb7 go get orrindel.dev/sdk\"],[\"Run the dev server\",\"npx orrindel dev\",\"Local dashboard on :8288, with replay and traces\"],[\"Deploy with your app\",\"git push\",\"Workflows register on boot. No separate workers.\"]];return /*#__PURE__*/_jsxs(\"section\",{ref:root,style:{...props.style,position:\"relative\",width:\"100%\",background:PAL.ink,color:PAL.paper,fontFamily:F.body,padding:`${phone?88:136}px ${pad}px`,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`.wlc-tab{transition:color .2s,border-color .2s}.wlc-tab:hover{color:${PAL.paper}!important}.wlc-tab:focus-visible,.wlc-copy:focus-visible{outline:2px solid ${PAL.signal};outline-offset:-2px}`}),/*#__PURE__*/_jsx(SectionHead,{eyebrow:eyebrow,title:title,body:body,W:W}),/*#__PURE__*/_jsxs(\"div\",{style:{marginTop:phone?36:56,display:\"grid\",gridTemplateColumns:split?\"minmax(0, 8fr) minmax(0, 4fr)\":\"minmax(0, 1fr)\",gap:split?24:16},children:[/*#__PURE__*/_jsxs(\"div\",{style:{background:PAL.panel,border:`1px solid ${PAL.rule2}`,fontFamily:F.mono,fontSize:phone?10.5:12.5,minWidth:0},children:[/*#__PURE__*/_jsxs(\"div\",{role:\"tablist\",\"aria-label\":\"SDK language\",style:{display:\"flex\",alignItems:\"stretch\",borderBottom:`1px solid ${PAL.rule}`},children:[Object.keys(SRC).map(k=>/*#__PURE__*/_jsx(\"button\",{role:\"tab\",\"aria-selected\":tab===k,className:\"wlc-tab\",onClick:()=>setTab(k),style:{fontFamily:F.mono,fontSize:12,padding:\"12px 16px\",background:\"transparent\",border:0,borderBottom:`2px solid ${tab===k?PAL.signal:\"transparent\"}`,color:tab===k?PAL.paper:PAL.steel,cursor:\"pointer\"},children:k},k)),/*#__PURE__*/_jsx(\"span\",{style:{marginLeft:\"auto\",display:phone?\"none\":\"flex\",alignItems:\"center\",color:PAL.dim,paddingRight:12},children:src.file}),/*#__PURE__*/_jsx(\"button\",{className:\"wlc-copy\",onClick:copy,style:{fontFamily:F.mono,fontSize:11,textTransform:\"uppercase\",letterSpacing:\"0.05em\",padding:\"0 14px\",background:\"transparent\",border:0,borderLeft:`1px solid ${PAL.rule}`,color:copied?PAL.signal:PAL.steel,cursor:\"pointer\",marginLeft:phone?\"auto\":0},children:copied?\"copied\":\"copy\"})]}),/*#__PURE__*/_jsx(\"div\",{role:\"tabpanel\",style:{padding:\"16px 0\",height:phone?380:440,overflow:\"auto\"},children:lines.map((l,i)=>{const vis=l.slice(0,Math.max(0,budget));budget-=l.length+1;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"grid\",gridTemplateColumns:\"40px 1fr\",lineHeight:phone?\"18px\":\"22px\",whiteSpace:\"pre\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{textAlign:\"right\",paddingRight:14,color:PAL.dim},children:i+1}),/*#__PURE__*/_jsxs(\"span\",{children:[paint(vis),budget<0&&budget>-l.length-2&&vis.length<l.length?/*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",width:7,height:14,background:PAL.signal,verticalAlign:-2}}):null]})]},tab+i);})})]}),/*#__PURE__*/_jsx(\"ol\",{style:{listStyle:\"none\",margin:0,padding:0,display:\"grid\",gap:1,background:PAL.rule,border:`1px solid ${PAL.rule}`,alignContent:\"start\"},children:steps.map(([h,cmd,note],i)=>/*#__PURE__*/_jsxs(\"li\",{style:{background:PAL.ink,padding:phone?18:24},children:[/*#__PURE__*/_jsxs(\"div\",{style:{fontFamily:F.mono,fontSize:11,color:PAL.steel,letterSpacing:\"0.06em\"},children:[\"STEP 0\",i+1]}),/*#__PURE__*/_jsx(\"div\",{style:{marginTop:10,fontSize:19,fontWeight:500,letterSpacing:\"-0.02em\"},children:h}),/*#__PURE__*/_jsxs(\"div\",{style:{marginTop:12,fontFamily:F.mono,fontSize:12.5,padding:\"10px 12px\",background:PAL.panel,border:`1px solid ${PAL.rule}`,color:PAL.paper},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:PAL.dim},children:\"$ \"}),cmd]}),/*#__PURE__*/_jsx(\"div\",{style:{marginTop:10,fontSize:13.5,color:PAL.soft,lineHeight:1.5},children:note})]},h))})]})]});}addPropertyControls(WorkflowlineCode,{eyebrow:{type:ControlType.String,title:\"Eyebrow\",defaultValue:\"09 \\xb7 Your language\"},title:{type:ControlType.String,title:\"Title\",displayTextArea:true,defaultValue:\"Write it in the language you already ship.\"},body:{type:ControlType.String,title:\"Body\",displayTextArea:true,defaultValue:\"Workflows live in your repo, deploy with your app and run on your cloud or ours. TypeScript, Python and Go SDKs share one runtime and one dashboard.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WorkflowlineCode\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"880\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1440\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WorkflowlineCode.map"],"mappings":"yT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