PageSourceSearch

https://www.getezly.com/_next/static/chunks/2clvx8ibo_s-s.js

js getezly.com collected 2026-10-02 00:51:15 UTC 27,980 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,675206,e=>{"use strict";var t=e.i(154317),s=e.i(97025),a=e.i(925516),r=e.i(644727),l=e.i(487931),n=e.i(516266),i=e.i(908902),o=e.i(431299),c=e.i(413437),d=e.i(278633),x=e.i(265625),p=e.i(904936),u=e.i(61797),h=e.i(672799),m=e.i(386952),g=e.i(44509),f=e.i(374800),v=e.i(176618),b=e.i(167881),j=e.i(319036),y=e.i(728231),w=e.i(456904),N=e.i(647163),S=e.i(645792),k=e.i(937638),C=e.i(973584);let P=["short","standard","detailed"];var T=e.i(572853);let D=["Proposals that open with something specific about the client get twice as many replies.","Dropping the client’s company name into your opener can lift response rates by 40%.","Shorter proposals win on Upwork. Aim for under 400 words.","Leading with a question about the job beats listing features every time.","One relevant portfolio link in your proposal can triple your conversion rate."],O=[{value:"short",label:"Short",range:"150–250 words"},{value:"standard",label:"Standard",range:"300–450 words"},{value:"detailed",label:"Detailed",range:"500–700 words"}];function A({label:e,tooltipText:s,trailing:a,children:r}){let l=(0,N.cn)("font-medium bg-canvas-base text-xs text-canvas-text pt-0.5 pb-[3px] px-2 rounded-full w-fit shadow-raised","transition-colors duration-200 group-focus-within/field:text-canvas-text-contrast/75 select-none"),n=s?(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:(0,N.cn)(l,"cursor-default"),children:e})}),(0,t.jsx)(y.TooltipContent,{side:"top",sideOffset:4,children:s})]}):(0,t.jsx)("div",{className:l,children:e});return(0,t.jsxs)("fieldset",{className:"group/field w-full flex flex-col gap-2 cursor-text border-0 p-0 m-0",onMouseDown:e=>{let t=e.target;"TEXTAREA"===t.tagName||t.closest('button, a, [role="button"]')||(e.preventDefault(),e.currentTarget.querySelector("textarea")?.focus())},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[n,a]}),r]})}function z({className:e,style:s,...a}){return(0,t.jsx)("textarea",{...a,onWheel:e=>e.stopPropagation(),className:(0,N.cn)("w-full resize-none border-0 bg-transparent px-0 py-1 text-base outline-none","placeholder:text-canvas-text text-canvas-text-contrast","focus-visible:ring-0 focus-visible:border-transparent focus-visible:shadow-none","disabled:cursor-not-allowed disabled:opacity-50",e),style:{overflowY:"auto",resize:"none",...s}})}function L(){return(0,t.jsx)("div",{className:"h-px w-full mx-0 bg-canvas-line"})}function M({children:e,htmlFor:s}){return(0,t.jsx)("label",{htmlFor:s,className:"text-[10px] font-semibold uppercase tracking-[0.08em] text-canvas-solid select-none",children:e})}function U({plan:e,usageStats:s,isAdmin:a,onUpgradeClick:r}){if(!s?.proposals)return(0,t.jsx)("span",{className:"text-xs text-canvas-solid",children:"Loading usage…"});let{used:l,limit:n,remaining:i}=s.proposals,o=(0,d.isUnlimited)(n),c=s.proposalsToday?.limit??999,x=s.proposalsToday?.remaining??999,p=c>0&&c<900;if(o)return(0,t.jsx)("span",{className:"text-xs text-canvas-text",children:0===l?a?"Admin · unlimited proposals":`Unlimited proposals on ${"founding"===e?"Founding":"Professional"}`:`${l} generated this month \xb7 Unlimited`});if(i<=0)return(0,t.jsxs)("span",{className:"text-xs font-medium text-alert-text",children:["Out of proposals this month ·"," ",(0,t.jsx)("button",{type:"button",onClick:r,className:"underline underline-offset-2 text-info-text hover:text-info-solid cursor-pointer transition-colors",children:"upgrade"})]});if(p&&x<=0)return(0,t.jsxs)("span",{className:"text-xs font-medium text-warning-text",children:["You've used ",c,"/",c," ",1===c?"proposal":"proposals"," today · ",i," ","left this month ·"," ",(0,t.jsx)("button",{type:"button",onClick:r,className:"underline underline-offset-2 text-info-text hover:text-info-solid cursor-pointer transition-colors",children:"upgrade"})]});let u=i<=3,h=p?` \xb7 max ${c}/day`:"";return(0,t.jsxs)("span",{className:(0,N.cn)("text-xs tabular-nums",u?"font-medium text-warning-text":"text-canvas-text"),children:[i," ",1===i?"proposal":"proposals"," left this month",h]})}function B({onBack:e}){let R,E,Q,$,I,_,G,F,{data:Y}=(0,i.useSession)(),q=(0,o.isRegisteredSessionUser)(Y?.user),{data:X}=(0,c.useSubscription)(q),K=X?.plan??null,W=(0,u.useApiErrorToast)(),[J,H]=(0,r.useState)(!1),{data:V}=(0,g.useUsageStats)(q),Z=(0,s.useQueryClient)(),ee=(0,r.useCallback)(()=>Z.invalidateQueries({queryKey:p.usageKeys.all}),[Z]),et=(0,k.useSaveProposal)(),[es,ea]=(R=(0,C.createParser)({parse:e=>
1null==e?"":String(e),serialize:e=>null==e?"":String(e)}),(0,C.useQueryState)("job",R.withDefault("").withOptions({shallow:!0,throttleMs:400,history:"replace"}))),[er,el]=(E=(0,C.createParser)({parse:e=>null==e?"":String(e),serialize:e=>null==e?"":String(e)}),(0,C.useQueryState)("persona",E.withDefault("").withOptions({shallow:!0}))),[en,ei]=(Q=(0,C.createParser)({parse:e=>{let t=String(e).toLowerCase();return P.includes(t)?t:"standard"},serialize:e=>"standard"===e?"":e}),(0,C.useQueryState)("length",Q.withDefault("standard").withOptions({shallow:!0}))),[eo,ec]=($=(0,C.createParser)({parse:e=>{let t=String(e).toLowerCase();return"0"!==t&&"false"!==t&&"no"!==t},serialize:e=>e?"":"0"}),(0,C.useQueryState)("web",$.withDefault(!0).withOptions({shallow:!0}))),[ed,ex]=(I=(0,C.createParser)({parse:e=>null==e?"":String(e),serialize:e=>null==e?"":String(e)}),(0,C.useQueryState)("angle",I.withDefault("").withOptions({shallow:!0,throttleMs:400,history:"replace"}))),[ep,eu]=(_=(0,C.createParser)({parse:e=>null==e?"":String(e),serialize:e=>null==e?"":String(e)}),(0,C.useQueryState)("work",_.withDefault("").withOptions({shallow:!0,throttleMs:400,history:"replace"}))),[eh,em]=(G=(0,C.createParser)({parse:e=>null==e?"":String(e),serialize:e=>null==e?"":String(e)}),(0,C.useQueryState)("notes",G.withDefault("").withOptions({shallow:!0,throttleMs:400,history:"replace"}))),{data:eg=[]}=(0,m.usePersonas)(q),ef=eh||[ed,ep].filter(Boolean).join("\n\n"),ev=(0,r.useCallback)(e=>{ea(e)},[ea]),eb=(0,r.useCallback)(e=>{ei(e)},[ei]),ej=(0,r.useCallback)(e=>{ec(e)},[ec]),ey=(0,r.useCallback)(e=>{em(e)},[em]),ew=(0,r.useCallback)(e=>{el(e)},[el]),eN=(0,r.useMemo)(()=>{if(0===eg.length)return null;if(er){let e=er?eg?eg.find(e=>(0,h.slugify)(e.name)===er):void 0:null;if(e&&!e.capacityDisabled)return e}return eg.find(e=>e.isSystem)??eg.find(e=>!e.capacityDisabled)??null},[eg,er]),eS=(0,r.useCallback)(e=>{if(!e)return void ew("");let t=eg.find(t=>t.id===e);if(t&&!t.capacityDisabled){if(t.isSystem)return void ew("");ew((0,h.slugify)(t.name))}},[eg,ew]),[ek,eC]=(0,r.useState)("form"),[eP,eT]=(0,r.useState)(""),[eD,eO]=(0,r.useState)(!1),[eA,ez]=(0,r.useState)(!1),[eL,eM]=(0,r.useState)(0),[eU]=(0,r.useState)(()=>(0,v.getRandomBrailleVariant)()),eB=(0,r.useRef)(null),eR=(0,a.useTranslations)("proposal.signInRequired");(0,r.useEffect)(()=>{if("generating"!==ek)return;let e=setInterval(()=>eM(e=>(e+1)%D.length),4e3);return()=>clearInterval(e)},[ek]);let eE=(0,r.useCallback)(()=>{if(V?.proposals&&!(0,d.isUnlimited)(V.proposals.limit)&&V.proposals.remaining<=0)return{allowed:!1,reason:"monthly"};let e=V?.proposalsToday;return e&&e.limit>0&&e.limit<900&&e.remaining<=0?{allowed:!1,reason:"daily"}:{allowed:!0,reason:""}},[V]),eQ=async()=>{if(es.trim().length<20)return void n.toast.error("Add a bit more to the job description first");if(!eE().allowed)return void H(!0);eO(!0),eT(""),eC("generating"),eM(0);let e=new AbortController;eB.current=e;try{let t="";if(eN){let e=[];eN.professionalRoleAndExperience&&e.push(`Professional background: ${eN.professionalRoleAndExperience}`),eN.communicationStyle&&e.push(`Communication style: ${eN.communicationStyle}`),eN.alwaysMention&&e.push(`Always mention: ${eN.alwaysMention}`),eN.neverDoThis&&e.push(`Never do: ${eN.neverDoThis}`),t=e.join("\n")}let s=ef.trim(),a=await fetch("/api/proposals/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jobDescription:es.trim(),personaContext:t,ragContext:"",length:en,additionalContext:s||void 0,webSearch:eo}),signal:e.signal});if(!a.ok){429===a.status&&ee();let e=await a.json().catch(()=>({message:"Generation failed"})),t={status:a.status,message:e.message??e.error??`HTTP ${a.status}`},s=Error(Array.isArray(t.message)?t.message.join(". "):t.message);throw s.__apiError=t,s}let r=a.headers.get("X-Proposal-Title"),l=r?(()=>{try{return decodeURIComponent(r).trim()}catch{return""}})():"",n=a.body?.getReader();if(!n)throw Error("No response body");let i=new TextDecoder,o="";for(;;){let{done:e,value:t}=await n.read();if(e)break;o+=i.decode(t,{stream:!0}),eT(o)}if(eC("result"),q){ee();
1let e=o?o.split(/\s+/).filter(Boolean).length:0,t={title:l||es.trim().slice(0,80)||"Untitled Proposal",content:o,jobDescription:es.trim(),length:en,personaId:eN?.id,metadata:{wordCount:e,webSearchUsed:eo,yourAngle:void 0,relevantWork:void 0,clientNotes:s||void 0}};et.mutate(t)}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return;console.error("[Proposal]",e),W(e.__apiError??(e instanceof Error?e:Error("Something went wrong. Try again."))),eC("form")}finally{eO(!1),eB.current=null}},e$=async()=>{try{await navigator.clipboard.writeText(eP),ez(!0),n.toast.success("Copied. Paste it into Upwork."),setTimeout(()=>ez(!1),2e3)}catch{n.toast.error("Failed to copy. Try selecting the text manually.")}},eI=()=>{eB.current?.abort(),eC("form"),eT(""),eO(!1)},e_=!eD&&es.trim().length>=20,eG=eE(),eF=!eG.allowed,eY=eG.allowed?"":"daily"===eG.reason?`You've used ${V?.proposalsToday?.limit??1}/${V?.proposalsToday?.limit??1} proposal${(V?.proposalsToday?.limit??1)===1?"":"s"} today. Upgrade for more.`:"You're out of proposals this month. Upgrade for more.";if("form"===ek&&!q)return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[e&&(0,t.jsx)(b.Button,{variant:"ghost",color:"neutral",size:"sm",onClick:e,leadingIcon:(0,t.jsx)(l.PiArrowLeft,{}),className:"self-start -ml-3",children:"Back to proposals"}),(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-md flex-col items-center gap-4 roun
1ded-2xl border border-canvas-line bg-canvas-base p-6 text-center sm:p-8",children:[(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-primary-bg text-primary-solid",children:(0,t.jsx)(l.PiLightning,{size:22})}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-canvas-text-contrast",children:eR("title")}),(0,t.jsx)("p",{className:"text-sm text-canvas-text",children:eR("body")}),(0,t.jsxs)(w.Link,{href:"/sign-in",className:(0,N.cn)("mt-2 inline-flex items-center gap-2 rounded-full px-6 py-2 text-sm","font-chillax font-semibold text-primary-on-primary select-none","bg-primary-solid hover:bg-primary-solid-hover active:scale-[0.98]","transition-all duration-300 ease-out"),children:[eR("cta"),(0,t.jsx)(l.PiArrowRight,{})]})]})]});if("generating"===ek)return(0,t.jsxs)("div",{className:"flex flex-col gap-0 overflow-hidden rounded-2xl border border-canvas-line bg-canvas-base",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 sm:px-6 sm:py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-canvas-bg-active text-canvas-text-contrast",children:(0,t.jsx)(v.BrailleSpinner,{variant:eU,className:"text-sm"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-canvas-text-contrast",children:"Writing your proposal…"}),(0,t.jsx)("p",{className:"text-xs text-canvas-solid",children:"Usually under 30 seconds"})]})]}),(0,t.jsx)(b.Button,{variant:"ghost",color:"neutral",size:"sm",iconOnly:!0,onClick:eI,"aria-label":"Cancel generation",tooltip:"Cancel generation",children:(0,t.jsx)(l.PiX,{})})]}),(0,t.jsx)(L,{}),(0,t.jsx)("div",{className:"max-h-[55vh] min-h-[220px] overflow-y-auto px-4 py-5 sm:px-6 sm:py-6",children:(0,t.jsx)(T.ProposalOutput,{text:eP,isStreaming:!0})}),(0,t.jsx)(L,{}),(0,t.jsxs)("div",{className:"flex items-start gap-2 px-4 py-3 sm:px-6",children:[(0,t.jsx)(l.PiSparkle,{className:"mt-0.5 shrink-0 text-canvas-solid",size:12}),(0,t.jsx)("p",{className:"text-xs leading-relaxed text-canvas-text",children:D[eL]})]})]});if("result"===ek){let e=eP?eP.split(/\s+/).filter(Boolean).length:0,s=Math.max(1,Math.round(e/200));return(0,t.jsxs)("div",{className:"flex flex-col gap-0 overflow-hidden rounded-2xl border border-canvas-line bg-canvas-base",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 px-4 py-3 sm:px-6 sm:py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-success-bg text-success-solid",children:(0,t.jsx)(l.PiCheck,{size:14})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-canvas-text-contrast",children:"Ready to send"}),(0,t.jsxs)("p",{className:"text-xs text-canvas-solid",children:[e," words · ~",s," min read"]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(b.Button,{variant:"ghost",color:"neutral",size:"sm",onClick:eI,leadingIcon:(0,t.jsx)(l.PiArrowLeft,{}),children:"Edit input"}),(0,t.jsx)(b.Button,{variant:"ghost",color:"neutral",size:"sm",onClick:eQ,leadingIcon:(0,t.jsx)(l.PiArrowsClockwise,{}),children:"Redo"}),(0,t.jsx)(b.Button,{color:"neutral",variant:"solid",size:"sm",onClick:e$,leadingIcon:eA?(0,t.jsx)(l.PiCheck,{}):(0,t.jsx)(l.PiCopy,{}),children:eA?"Copied!":"Copy proposal"})]})]}),(0,t.jsx)(L,{}),(0,t.jsx)("div",{className:"max-h-[60vh] overflow-y-auto px-4 py-5 sm:px-6 sm:py-6",children:(0,t.jsx)(T.ProposalOutput,{text:eP,isStreaming:!1})}),(0,t.jsx)(L,{}),(0,t.jsx)("div",{className:"flex items-center justify-end px-4 py-3 sm:px-6",children:(0,t.jsx)(b.Button,{variant:"ghost",color:"neutral",size:"sm",onClick:()=>{eI(),ev(""),ex(""),eu(""),ey("")},trailingIcon:(0,t.jsx)(l.PiArrowRight,{}),children:"Start fresh"})})]})}return(0,t.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,t.jsx)(f.UpgradeDialog,{open:J,onOpenChange:H}),e&&(0,t.jsx)(b.Button,{variant:"ghost",color:"neutral",size:"sm",onClick:e,leadingIcon:(0,t.jsx)(l.PiArrowLeft,{}),className:"self-start -ml-3",children:"Back to proposals"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h1",{className:"font-chillax text-2xl font-semibold tracking-tight text-canvas-text-contrast",children:"Paste a job posting"}),(0,t.jsx)("p",{className:"text-sm text-canvas-text",children:"Get a reply-ready proposal in your voice. Usually under 30 seconds."})]}),(0,t.jsxs)("div",{className:"flex flex-col overflow-hidden rounded-2xl border border-canvas-line bg-canvas-in
1put",children:[(0,t.jsx)("div",{className:"px-4 pt-4 pb-3 sm:px-5",children:(0,t.jsx)(A,{label:"Job posting",tooltipText:"Paste the full posting: details, scope, budget, anything the client wrote. More detail means a better proposal.",trailing:es.length>0?(0,t.jsxs)("span",{className:"text-[11px] text-canvas-solid select-none tabular-nums",children:[es.length.toLocaleString()," chars"]}):null,children:(0,t.jsx)(z,{placeholder:"Paste the job description, scope, budget, or anything the client wrote.",value:es,onChange:e=>{ev(e.target.value)},maxLength:S.LONG_TEXT_MAX,className:"min-h-[200px] lg:min-h-[260px]",required:!0,"aria-required":"true"})})}),(0,t.jsx)(L,{}),(0,t.jsx)("div",{className:"px-4 py-3 sm:px-5",children:(0,t.jsx)(A,{label:"Anything else?",tooltipText:"Your angle, portfolio links, past work, prior chat with the client, budget notes. Anything that makes the proposal sound like YOU wrote it. Optional.",children:(0,t.jsx)(z,{placeholder:"Your angle, past work, portfolio links. Anything that makes it sound like you. Optional.",value:ef,onChange:e=>{ey(e.target.value)},maxLength:S.LONG_TEXT_MAX,className:"min-h-[72px] max-h-[140px]"})})}),(0,t.jsx)(L,{}),(0,t.jsxs)("fieldset",{className:"border-0 p-0 m-0 px-4 py-4 sm:px-5 bg-canvas-bg",children:[(0,t.jsx)("legend",{className:"sr-only",children:"Proposal settings"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-start gap-x-6 gap-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 items-start",children:[(0,t.jsx)(M,{children:"Persona"}),(0,t.jsx)(x.PersonaSelector,{value:eN?.id,onChange:eS,personas:eg,contentSide:"bottom",contentAlign:"start"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(M,{children:"Length"}),(0,t.jsx)("fieldset",{"aria-label":"Proposal length",className:"inline-flex h-8 self-start items-center rounded-full border border-canvas-line bg-canvas-bg-active p-0.5",children:O.map(e=>{let s=en===e.value;return(0,t.jsx)("button",{type:"button","aria-pressed":s,"aria-label":`${e.label} (${e.range})`,onClick:()=>{s||eb(e.value)},className:(0,N.cn)("font-chillax font-semibold rounded-full px-3.5 text-xs h-full min-w-0","transition-all duration-200 cursor-pointer outline-none","focus-visible:ring-2 focus-visible:ring-canvas-text-contrast focus-visible:ring-offset-1",s?"bg-canvas-base text-canvas-text-contrast shadow-raised":"text-canvas-text hover:text-canvas-text-contrast"),children:e.label},e.value)})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(M,{children:"Research"}),(0,t.jsxs)("label",{htmlFor:"proposal-web-search",className:"flex h-8 items-center gap-2 rounded-full border border-canvas-line pl-3 pr-2 cursor-pointer select-none self-start hover:bg-canvas-on-canvas/40 transition-colors duration-150",children:[(0,t.jsx)(l.PiGlobe,{className:"text-canvas-text shrink-0",size:14}),(0,t.jsx)("span",{className:"text-xs font-medium text-canvas-text-contrast font-chillax",children:"Look up the client"}),(0,t.jsx)(j.Switch,{id:"proposal-web-search",checked:eo,onCheckedChange:e=>{ej(e)},"aria-label":"Web research"})]})]})]})]}),(0,t.jsx)(L,{}),(0,t.jsxs)("div",{className:"flex flex-col-reverse gap-3 bg-canvas-bg px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[(0,t.jsx)(U,{plan:K,usageStats:V,isAdmin:Y?.user?.role==="admin",onUpgradeClick:()=>H(!0)}),(F=(0,t.jsx)(b.Button,{color:"neutral",variant:"solid",size:"xl",onClick:eQ,disabled:!e_,isLoading:eD,trailingIcon:eD?void 0:(0,t.jsx)(l.PiArrowRight,{}),className:(0,N.cn)("w-full sm:w-auto sm:min-w-[200px]",eF&&e_&&"opacity-60"),children:"Generate Proposal"}),eF&&e_?(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:F}),(0,t.jsx)(y.TooltipContent,{side:"top",sideOffset:6,children:eY})]}):F)]})]})]})}var R=e.i(872183),E=e.i(524946),Q=e.i(984630),$=e.i(319794),I=e.i(665745),_=e.i(456005),G=e.i(909164),F=e.i(312904),Y=e.i(992911);async function q(){return(await (0,Y.apiFetch)("/api/proposals")).proposals.map(e=>({...e,createdAt:new Date(e.createdAt),updatedAt:new Date(e.updatedAt)}))}var X=e.i(483314),K=e.i(671428);function W({proposal:e,searchQuery:s,onDelete:a,isActive:n}){var i;let o,c,d,x,p=(0,w.useRouter)(),[u,h]=(0,r.useState)(!1),m=e.content?e.content.slice(0,280):e.jobDescription?e.jobDescription.slice(0,280):"";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{onClick:()=>p.push(`/proposals/${e.id}`),className:(0,N.cn)("group relative flex flex-col cursor-pointer select-none rounded-xl border overflow-hidden transition-colors duration-150",n?"border-primary-border bg-primary-bg/50":"border-canvas-line hover:border-canvas-border hover:bg-canvas-on-canvas/50"),children:[(0,t.jsxs)("div",{className:"relative h-[150px] overflow-hidden px-8 pt-5",children:[(0,t.jsx)("p",{className:"text-base font-medium leading-[1.55] text-canvas-text-contrast line-clamp-6 whitespace-pre-wrap [mask-image:linear-gradient(to_bottom,black_45%,transparent_95%)] [-webkit-mask-image:linear-gradient(to_bottom,black_45%,transparent_95%)]",children:m}),(0,t.jsx)(b.Button,{variant:"surface",color:"neutral",size:"xs",iconOnly:!0,leadingIcon:(0,t.jsx)(l.PiTrash,{}),"aria-label":"Delete proposal",tooltip:"Delete",onClick:e=>{e.stopPropagation(),h(!0)},className:(0,N.cn)("absolute top-3 right-3 bg-canvas-base/80 backdrop-blur-sm","opacity-0 group-hover:opacity-100 transition-opacity duration-150","hover:text-alert-solid hover:bg-alert-bg hover:border-alert-line")})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 px-8 py-4 border-t border-canvas-line/50",children:[(0,t.jsx)("span",{className:"text-base font-semibold text-canvas-text-contrast truncate leading-tight",children:function(e,s){if(!s)return e;let a=s.toLowerCase(),r=e.toLowerCase().indexOf(a);return -1===r?e:(0,t.jsxs)(t.Fragment,{children:[e.substring(0,r),(0,t.jsx)("mark",{className:"bg-yellow-200 dark:bg-yellow-800/50 rounded px-0.5",children:e.substring(r,r+a.length)}),e.substring(r+a.length)]})}(e.title,s)}),(0,t.jsxs)("span",{className:"text-xs text-canvas-solid",children:["Last edited ",(i=new Date(e.updatedAt??e.createdAt),c=Math.floor((o=new Date().getTime()-i.getTime())/6e4),d=Math.floor(o/36e5),x=Math.floor(o/864e5),c<1?"Just now":c<60?`${c}m ago`:d<24?`${d}h ago`:x<7?`${x}d ago`:i.toLocaleDateString("en-US",{month:"short",day:"numeric"}))]})]})]}),(0,t.jsx)(X.GeneralDialog,{open:u,onOpenChange:h,title:"Delete Proposal",description:"Are you sure you want to delete this proposal? This action cannot be undone.",primary:{label:"Delete",onClick:()=>{a(e.id),h(!1)},variant:"destructive"},secondary:{label:"Cancel",onClick:()=>h(!1),variant:"outline"}})]})}function J(){return(0,t.jsxs)("div",{className:"flex flex-col rounded-xl border border-canvas-line overflow-hidden",children:[(0,t.jsx)(K.Skeleton,{className:"h-[150px] rounded-none"}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 px-8 py-4 border-t border-canvas-line/50",children:[(0,t.jsx)(K.Skeleton,{className:"h-4 w-3/4 rounded"}),(0,t.jsx)(K.Skeleton,{className:"h-3 w-1/3 rounded"})]})]})}function H({onGenerateNew:e}){let s,a,{data:c,isPending:d}=(0,i.useSession)(),x=!(0,o.isRegisteredSessionUser)(c?.user),{isMobile:p}=(0,Q.useSidebar)(),{data:u=[],isLoading:h}=function(e=!0){let t=(0,_.useWorkspaceScope)();return(0,I.useQuery)({queryKey:F.proposalKeys.list(t),queryFn:q,enabled:e&&"pending"!==t,staleTime:3e5,gcTime:6e5,retry:!1,retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,...(0,G.onQueryError)("Failed to fetch proposals","/proposals")})}(!x),m=(0,k.useDeleteProposal)(),[g,f]=(s=(0,C.createParser)({parse:e=>
1null==e?"":String(e),serialize:e=>null==e?"":String(e)}),(0,C.useQueryState)("search",s.withDefault("").withOptions({shallow:!0}))),[v,j]=(a=(0,C.createParser)({parse:e=>{let t=String(e).toLowerCase();return"1"===t||"true"===t||"yes"===t},serialize:e=>e?"1":""}),(0,C.useQueryState)("older",a.withDefault(!1).withOptions({shallow:!0}))),y=e=>{m.mutate(e,{onSuccess:()=>n.toast.success("Proposal deleted"),onError:()=>n.toast.error("Failed to delete proposal")})},{recentGroups:w,olderGroups:S,totalCount:P,olderCount:T}=(0,r.useMemo)(()=>{let e=g.toLowerCase().trim(),t=u.filter(t=>!e||t.title.toLowerCase().includes(e)||t.jobDescription.toLowerCase().includes(e)),s=(0,$.groupByPeriod)(t),{recent:a,older:r,olderCount:l}=(0,$.partitionPeriodGroups)(s);return{recentGroups:a,olderGroups:r,totalCount:t.length,olderCount:l}},[u,g]),D=Object.keys(w).length>0,O=Object.keys(S).length>0,A=D||O,z=g.trim().length>0;return(0,t.jsxs)("div",{className:"flex flex-col h-full px-4 sm:px-6 lg:px-8",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 pt-10 pb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(R.ShowIf,{condition:p,children:(0,t.jsx)(E.SidebarTrigger,{className:"p-1!"})}),(0,t.jsx)("h1",{className:"font-chillax text-2xl font-semibold text-canvas-text-contrast",children:"Proposals"}),P>0&&(0,t.jsx)("span",{className:"text-xs text-canvas-solid font-medium bg-canvas-bg-active px-2 py-0.5 rounded-full",children:P})]}),(0,t.jsx)(b.Button,{color:"neutral",variant:"solid",onClick:e,leadingIcon:(0,t.jsx)(l.PiPlus,{}),children:"New Proposal"})]}),(0,t.jsx)("div",{className:"pb-4 pt-2",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(l.PiMagnifyingGlass,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-canvas-solid"}),(0,t.jsx)("input",{placeholder:"Search your proposals...",value:g,onChange:e=>f(e.target.value),className:(0,N.cn)("h-10 w-full rounded-xl border border-canvas-line bg-canvas-input pl-9 pr-4 py-1 text-base outline-none","text-canvas-text-contrast placeholder:text-canvas-text","hover:border-canvas-border-hover","focus-visible:border-canvas-border-hover focus-visible:ring-1 focus-visible:ring-canvas-text-contrast","transition-[color,box-shadow] duration-150",g&&"border-canvas-border-hover")})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto pb-8",children:h||d?(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[...Array(6)].map((e,s)=>(0,t.jsx)(J,{},s))}):x?(0,t.jsx)(Z,{icon:(0,t.jsx)(l.PiScroll,{size:40,className:"text-canvas-solid/40"}),title:"Log in to see your proposals",subtitle:"Your proposals will be saved when you log in"}):A?(0,t.jsxs)("div",{className:"space-y-6",children:[Object.entries(w).map(([e,s])=>(0,t.jsx)(V,{period:e,items:s,searchQuery:g,onDelete:y},e)),O&&(z||v)&&(0,t.jsx)(t.Fragment,{children:Object.entries(S).map(([e,s])=>(0,t.jsx)(V,{period:e,items:s,searchQuery:g,onDelete:y},e))}),O&&!z&&!v&&(0,t.jsx)("div",{className:"flex justify-center pt-2",children:(0,t.jsxs)("button",{type:"button",onClick:()=>{j(!0)},className:(0,N.cn)("flex items-center gap-2 rounded-xl border border-canvas-line px-5 py-2.5","text-sm font-medium text-canvas-text","hover:bg-canvas-bg-hover hover:border-canvas-border","transition-colors duration-150 cursor-pointer"),children:[(0,t.jsxs)("span",{children:["Show ",T," older proposal",1===T?"":"s"]}),(0,t.jsx)(l.PiCaretDown,{size:13})]})})]}):g?(0,t.jsx)(Z,{icon:(0,t.jsx)(l.PiMagnifyingGlass,{className:"h-10 w-10 text-canvas-solid/40"}),title:"No proposals found",subtitle:"Try a different search term"}):(0,t.jsx)(Z,{icon:(0,t.jsx)(l.PiScroll,{size:48,className:"text-canvas-solid/50"}),title:"No proposals yet",subtitle:"Your generated proposals will appear here."})})]})}function V({period:e,items:s,searchQuery:a,onDelete:r}){return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-xs font-semibold uppercase tracking-wider text-canvas-solid select-none",children:e}),a&&(0,t.jsxs)("span",{className:"text-xs text-canvas-solid select-none",children:[s.length," ",1===s.length?"proposal":"proposals"]})]}),(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.map(e=>(0,t.jsx)(W,{proposal:e,searchQuery:a,onDelete:r},e.id))})]})}function Z({icon:e,title:s,subtitle:a,action:r}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[(0,t.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl border border-canvas-line bg-canvas-bg-subtle",children:e}),(0,t.jsx)("p",{className:"mt-5 text-base font-semibold text-canvas-text-contrast",children:s}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-canvas-text max-w-sm",children:a}),r]})}let ee=["list","new"];e.s(["default",0,function(){let e,[s,a]=(e=(0,C.createParser)({parse:e=>{let t=String(e).toLowerCase();return ee.includes(t)?t:"list"},serialize:e=>"list"===e?"":e}),(0,C.useQueryState)("view",e.withDefault("list").withOptions({shallow:!0})));return(0,t.jsx)("div",{className:"flex flex-col h-full w-full overflow-y-auto",children:"new"===s?(0,t.jsx)("div",{className:"max-w-4xl mx-auto w-full px-4 py-8 sm:px-6 lg:px-8 lg:py-10 flex-1",children:(0,t.jsx)(B,{onBack:()=>a("list")})}):(0,t.jsx)("div",{className:"max-w-4xl mx-auto w-full flex-1",children:(0,t.jsx)(H,{onGenerateNew:()=>a("new")})})})}],675206)}]);

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.