PageSourceSearch

https://forzi.ai/assets/SOPBuilder-DDUr4rY6.js

js forzi.ai collected 2026-10-05 13:42:55 UTC 7,635 bytes, 1 lines download raw bytes

1import{j as e,X as G,r as a,a8 as X,F as z,t as W,I as Y,B as h,aj as K,ak as Q,al as U,E as $}from"./index-DZhdmuyI.js";import{L as O}from"./label-C6XqPx8a.js";import{S as J,a as Z,b as ee,c as te,d as se}from"./select-COhqPPBA.js";import{D as re}from"./DownloadMenu-BXOLbMbe.js";import{u as oe,T as ae}from"./useToolGeneration-dsnBr_92.js";import{S}from"./StagedLoader-Bte4jdjT.js";import{u as ie}from"./useAdvisorPage-DPU0Erv3.js";import{t as r}from"./dashboardLogic-CCcGOZz6.js";import{S as ne}from"./sparkles-CRJ17_4h.js";import{m as le}from"./proxy-DP3iu0GK.js";import{C as ce}from"./circle-stop-ZmxUzgsG.js";import{R as de}from"./refresh-ccw-DWqFkqNV.js";import{C as pe}from"./copy-C-7SmP1P.js";import"./index-CVuUG8eZ.js";import"./Combination-Yd-JwnBm.js";import"./chevron-down-Dq4WIX59.js";import"./check-BgyEZRFo.js";import"./chevron-up-CWg5GbLj.js";import"./sheet-B2zf51Z7.js";import"./index-TKMigujh.js";import"./history-7rYpmc7h.js";import"./clock-CupRnpKb.js";import"./formatDistanceToNow-C5NMARHg.js";import"./en-US-CXXYYhpC.js";import"./chevron-right-BaQF1Fk3.js";import"./FileSaver.min-DSNESW1V.js";import"./pdfExport-yyIaYM_m.js";import"./adaptiveEngine-CYHBfJuA.js";import"./uocmf-BWQwOS3y.js";import"./dropdown-menu-BllvjZMJ.js";import"./index-CzajfOBO.js";import"./circle-2c8ewn5p.js";import"./download-ChtTWRPk.js";import"./presentation-CDxwoNci.js";import"./KpiLogCard-itvlxXLG.js";import"./chart-line-BeilTpnL.js";import"./arrow-left-BeReTZeS.js";import"./aiStream-BPW-kbUn.js";import"./index-B2uHzqzI.js";import"./diagnosticConfig-BRdahMvW.js";import"./africanCountries-DI5EvdyG.js";function m({label:i,value:c,onChange:d,options:g,placeholder:u="Not specified",className:f=""}){return e.jsxs("div",{className:`space-y-1.5 ${f}`,children:[e.jsx(O,{className:"text-xs text-muted-foreground",children:i}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(J,{value:c,onValueChange:d,children:[e.jsx(Z,{className:"bg-card border-border flex-1",children:e.jsx(ee,{placeholder:u})}),e.jsx(te,{children:g.map(n=>e.jsx(se,{value:n,children:n},n))})]}),c&&e.jsx("button",{type:"button",onClick:()=>d(""),className:"shrink-0 h-9 w-9 flex items-center justify-center rounded-md border border-border text-muted-foreground hover:text-foreground hover:border-primary/40 transition-colors","aria-label":`Clear ${i}`,children:e.jsx(G,{className:"h-3.5 w-3.5"})})]})]})}const j=["Calculating operational readiness…","Determining which sections this process actually needs…","Adapting instructions to the executor role…","Sequencing steps, risks, and quality checkpoints…","Running self-review against ambiguity and consistency…"],me=["Founder / Owner","Executive / Senior Leader","Manager","Team Lead","Individual Contributor"],ue=["Sales & Revenue","Marketing","Operations & Fulfillment","Finance & Admin","HR & People","Customer Service","Compliance & Risk","Production / Quality","IT & Systems","Other"],xe=["Low — nice to have consistent","Medium — matters but recoverable if it slips","High — directly impacts revenue or customers","Critical — failure has serious business/compliance consequences"],he=["Multiple times daily","Daily","Weekly","Monthly","Ad hoc / as needed"],ge=["CEO / President","COO","CFO","CTO","CMO","CHRO","VP Sales","VP Marketing","VP Operations","VP Finance","VP Product","VP Customer Success","VP Engineering","VP People / HR","Director of Sales","Director of Marketing","Director of Operations","Director of Finance","Director of Customer Success","Director of HR","Head of Sales","Head of Marketing","Head of Operations","Head of Growth","Senior Manager","Manager","Team Lead","Supervisor","Individual Contributor","Other"],ot=()=>{const[i,c]=a.useState(""),[d,g]=a.useState(""),[u,f]=a.useState(""),[n,N]=a.useState(""),[b,T]=a.useState(""),[x,w]=a.useState(""),[v,P]=a.useState(""),{business:C}=X(),s=C==null?void 0:C.business_type,y=x==="Other"?v.trim():x,{output:o,streaming:l,generate:k,stop:R,reset:E,loadHistoryOutput:D,downloadPDF:I,downloadDOCX:L,chainId:_}=oe({assetType:"sop_builder",title:y||"SOP Builder",advisorKey:"sop-advisor"}),p=ie("sop-advisor"),F=p.prompts.length>0?p.prompts.map(t=>
1r(Object.values(t)[0]||"",s)).filter(Boolean):[r("Client onboarding for a consulting firm",s),r("Weekly content publishing workflow",s),r("Lead follow-up and nurture sequence",s),r("New employee onboarding and training",s),r("Monthly financial review and reporting",s),r("Customer support ticket escalation",s)],M=me.map(t=>r(t,s)),H=ue.map(t=>r(t,s)),V=xe.map(t=>r(t,s)),A=he.map(t=>r(t,s)),B=ge.map(t=>r(t,s)),q=r("e.g. Client onboarding, Content publishing, Lead follow-up",s);return e.jsx(ae,{output:o,chainId:_,icon:z,title:p.title||"SOP Advisor",description:p.description||"Turns repeated work into documented systems to reduce leader or team dependency — applying Forzi's operational intelligence principles.",assetType:"sop_builder",onHistoryLoad:D,children:!o&&!l?e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mb-2 flex items-center gap-1",children:[e.jsx(ne,{className:"h-3 w-3 text-primary"})," Try a prompt to get started"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:F.map(t=>e.jsx("button",{onClick:()=>c(t),className:"text-xs px-3 py-1.5 rounded-full border border-border bg-card/50 text-muted-foreground hover:border-primary/40 hover:text-primary transition-colors",children:t},t))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(O,{children:"Describe the task or process"}),e.jsx(W,{placeholder:q,className:"bg-card border-border min-h-[100px]",value:i,onChange:t=>c(t.target.value)})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[e.jsx(m,{label:"Who will primarily execute this? (optional)",value:d,onChange:g,options:M}),e.jsx(m,{label:"Process category (optional)",value:u,onChange:f,options:H}),e.jsx(m,{label:"How critical is this process? (optional)",value:n,onChange:N,options:V}),e.jsx(m,{label:"How often does this run? (optional)",value:b,onChange:T,options:A})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{label:"Title this SOP is written for (optional)",value:x,onChange:w,options:B}),x==="Other"&&e.jsx(Y,{className:"bg-card border-border",placeholder:"e.g. Head of Customer Success",value:v,onChange:t=>P(t.target.value)})]}),e.jsx(h,{variant:"hero",size:"lg",className:"w-full",onClick:()=>k({process_name:i,primary_executor_role:d,process_category:u,criticality:n,frequency:b,role_title:y}),disabled:!i.trim(),children:p.generateLabel??"Design SOP"})]}):e.jsxs(le.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-card/50 p-6 min-h-[400px] relative overflow-hidden",children:[l&&!o&&e.jsx(S,{active:l,messages:j,className:"mt-20"}),o&&e.jsx(K,{content:o,streaming:l}),l&&o&&e.jsx("div",{className:"mt-4 border-t border-border pt-4",children:e.jsx(S,{active:!0,messages:j})})]}),e.jsx("div",{className:"flex gap-2",children:l?e.jsxs(h,{variant:"outline",className:"flex-1",onClick:R,children:[e.jsx(ce,{className:"h-4 w-4 mr-2"})," Stop"]}):e.jsxs(e.Fragment,{children:[e.jsxs(h,{variant:"outline",className:"flex-1",onClick:E,children:[e.jsx(de,{className:"h-4 w-4 mr-2"})," New SOP"]}),e.jsx(re,{onDownloadPDF:I,onDownloadDOCX:L,className:"flex-1",size:"default"}),e.jsxs(h,{variant:"hero",className:"flex-1",onClick:()=>{navigator.clipboard.writeText(Q(U(o))),$.success("Copied to clipboard")},children:[e.jsx(pe,{className:"h-4 w-4 mr-2"})," Copy SOP"]})]})})]})})};export{ot as default};

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.