PageSourceSearch

https://whatsthebigdata.com/_next/static/chunks/pages/ai-letter-generator-6169229b0eb9ca9c.js

js whatsthebigdata.com collected 2026-10-02 14:51:10 UTC 16,158 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1543],{21248:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai-letter-generator",function(){return s(12888)}])},29979:function(e,t,s){"use strict";s.d(t,{B:function(){return n}});var a=s(85893),r=s(50607),i=s(67294);let{signIn:o}=s(33299),{useRouter:l}=s(11163),n=e=>{let{onClose:t}=e,[s,n]=(0,i.useState)(!1),d=l(),c=()=>{n(!0);let e=d.asPath;o("google",{callbackUrl:e})};return(0,a.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:(0,a.jsxs)(r.E.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},style:{backgroundColor:"white",padding:"2rem",borderRadius:"0.5rem",maxWidth:"400px",width:"90%",textAlign:"center"},children:[(0,a.jsx)("h2",{style:{marginBottom:"1rem"},children:"Sign in to use this tool for free"}),(0,a.jsx)("p",{style:{marginBottom:"1rem"},children:"Unlock the power of AI Tools"}),(0,a.jsx)(r.E.button,{whileHover:{scale:1.05},whileTap:{scale:.95},disabled:s,onClick:c,style:{width:"100%",padding:"0.5rem 1rem",backgroundColor:"#4F46E5",color:"white",border:"none",borderRadius:"0.25rem",cursor:"pointer",marginBottom:"1rem"},children:s?(0,a.jsxs)("div",{className:"flex gap-3 items-center justify-center",children:["Signing in",(0,a.jsx)("div",{className:"w-6 h-6 border-t-2 border-white rounded-full animate-spin"})]}):"Sign in with Google"})]})})}},71095:function(e,t,s){"use strict";s.d(t,{Bw:function(){return h},Ph:function(){return c},Ql:function(){return g},i4:function(){return u},ki:function(){return p}});var a=s(85893),r=s(67294),i=s(79009),o=s(3424),l=s(2112),n=s(34001),d=s(98694);let c=i.fC;i.ZA;let p=i.B4,u=r.forwardRef(function(e,t){let{className:s,children:r,...l}=e;return(0,a.jsxs)(i.xz,{ref:t,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",s),...l,style:{border:"1px solid #d1d5db"},children:[r,(0,a.jsx)(i.JO,{asChild:!0,children:(0,a.jsx)(o.Z,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=i.xz.displayName;let m=r.forwardRef(function(e,t){let{className:s,...r}=e;return(0,a.jsx)(i.u_,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...r,children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})});m.displayName=i.u_.displayName;let f=r.forwardRef(function(e,t){let{className:s,...r}=e;return(0,a.jsx)(i.$G,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...r,children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})});f.displayName=i.$G.displayName;let h=r.forwardRef(function(e,t){let{className:s,children:r,position:o="popper",...l}=e;return(0,a.jsx)(i.h_,{children:(0,a.jsxs)(i.VY,{ref:t,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:o,...l,children:[(0,a.jsx)(m,{}),(0,a.jsx)(i.l_,{className:(0,d.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,a.jsx)(f,{})]})})});h.displayName=i.VY.displayName;let x=r.forwardRef(function(e,t){let{className:s,...r}=e;return(0,a.jsx)(i.__,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...r})});x.displayName=i.__.displayName;let g=r.forwardRef(function(e,t){let{className:s,children:r,...o}=e;return(0,a.jsxs)(i.ck,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...o,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(i.wU,{children:(0,a.jsx)(n.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(i.eT,{children:r})]})});g.displayName=i.ck.displayName;let y=r.forwardRef(function(e,t){let{className:s,...r}=e;return(0,a.jsx)(i.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",s),...r})});y.displayName=i.Z0.displayName},14055:function(e,t,s){"use strict";s.d(t,{g:function(){return o}});var a=s(85893),r=s(67294),i=s(98694);let o=r.forwardRef(function(e,t){let{className:s,...r}=e;return(0,a.jsx)("textarea",{className:(0,i.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t,...r})});o.displayName="Textarea"},12888:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return y}});var a=s(85893),r=s(36657),i=s(9008),o=s.n(i),l=s(67294),n=s(50607),d=s(89583),c=s(33299),p=s(14055),u=s(71095),m=s(37370),f=s(78936);s(29979);var h=s(11163),x=s(87066);let g={title:"AI Letter Generator",introContent:{title:"AI Letter Generator",description:"Create customized letters for any purpose with a simple prompt",mainDescription:"The AI Letter Generator helps you craft professionally written letters for any situation or purpose. Simply describe what you need, and our AI will generate a well-structured letter that you can use as-is or customize further."},faqs:[{question:"What is an AI Letter Generator?",answer:"An AI Letter Generator is a tool that creates customized letters based on your specific needs and instructions. Simply describe what kind of letter you want, and the AI will craft a professionally written letter that matches your requirements."},{question:"How does the Letter Generator work?",answer:"The Letter Generator uses advanced AI to interpret your instructions and create an appropriate letter. You provide a prompt describing the type of letter, recipient, purpose, key points, and any style preferences, and the AI transforms that into a complete letter."},{question:"What types of letters can I create?",answer:"You can create virtually any type of letter, including formal business letters, cover letters, recommendation letters, complaint letters, thank you notes, personal letters, invitation letters, condolence letters, apology letters, and more."},{question:"How detailed should my prompt be?",answer:"The more specific your prompt, the better the results. Try to include information about the type of letter, recipient, main purpose, key points to cover, your relationship to the recipient (if relevant), and preferred tone or style."}],howToUseSteps:[{title:"Step 1: Craft Your Prompt",description:"Write a detailed description of the letter you need. The more specific you are, the better the result. Include information about the type of letter, recipient, purpose, key points, and preferred tone."},{title:"Step 2: Configure Advanced Options (Optional)",description:"Click 'Show Advanced Options' to select different AI models for letter generation. Each model has slightly different writing styles and capabilities."},{title:"Step 3: Generate the Letter",description:"Click 'Generate Letter' and wait a moment while our AI analyzes your prompt and creates a customized letter that meets your requirements."},{title:"Step 4: Review and Edit",description:"Read through the generated letter to ensure it meets your needs. You may want to personalize specific details or adju
1st the tone to perfectly match your situation."},{title:"Step 5: Use Your Letter",description:"Copy the letter to your clipboard or download it as a text file. You can then paste it into your preferred word processor or email client, format it as needed, and send it."}],proTips:["Be as specific as possible about your letter's purpose and audience","Include any key phrases or points that must be covered in the letter","Mention any relationship context between you and the recipient if relevant","Specify formality level: highly formal, semi-formal, casual, etc.","For business letters, include company names and relevant position titles","For complaint letters, provide specific dates, order numbers, or other details"]};function y(){let{data:e,status:t}=(0,c.useSession)(),[s,i]=(0,l.useState)(!1),[y,b]=(0,l.useState)(!1),[w,j]=(0,l.useState)(""),[v,N]=(0,l.useState)(""),[C,k]=(0,l.useState)("gpt-4o"),[S,T]=(0,l.useState)(!1),[z,A]=(0,l.useState)(null),[E,I]=(0,l.useState)(!0),[L,_]=(0,l.useState)(null),G=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=async()=>{G.current&&G.current.focus(),I(!0);try{let e=await x.Z.get("https://pmdw9gqd5at4.whatsthebigdata.com/wp-json/ai-tools/v2/tools/ai-letter-generator");console.log("Tool data:",e.data),A(e.data),_(null)}catch(e){console.error("Error fetching tool data:",e),_("Failed to load tool data"),A(g)}finally{I(!1)}};e()},[]);let R=(null==z?void 0:z.introContent)||g.introContent,q=(null==z?void 0:z.faqs)||g.faqs,P=(null==z?void 0:z.howToUseSteps)||g.howToUseSteps,Z=(null==z?void 0:z.proTips)||g.proTips,Y=(0,h.useRouter)(),B=(null==R?void 0:R.title)||"AI Letter Generator";(0,l.useEffect)(()=>{"unauthenticated"===t&&i(!0)},[t]);let O=async e=>{e.preventDefault(),b(!0);try{let e=await x.Z.post("/api/generate-letter",{prompt:v,model:C});j(e.data.text)}catch(e){console.error("Error generating letter:",e),alert("Failed to generate letter. Please try again.")}b(!1)},Q=()=>{w&&(navigator.clipboard.writeText(w),alert("Letter copied to clipboard!"))},U=()=>{if(w){let e=document.createElement("a"),t=new Blob([w],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="letter.txt",document.body.appendChild(e),e.click()}},F=()=>{j("")};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o(),{children:[(0,a.jsx)("title",{children:B}),(0,a.jsx)("link",{rel:"canonical",href:`https://whatsthebigdata.com${Y.asPath.split("?")[0]}`}),(0,a.jsx)("meta",{name:"description",content:(null==R?void 0:R.description)||"Create customized letters for any purpose with a simple prompt"})]}),(0,a.jsxs)(r.Z,{children:[(0,a.jsxs)("div",{className:"max-w-5xl mx-auto ",children:[(0,a.jsxs)("div",{className:"bg-white p-6 rounded-xl shadow-lg mb-8",children:[(0,a.jsx)("div",{className:"mb-8 border-b-2 border-indigo-100",children:(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("h1",{className:"display-3 mg-bottom-0",children:B}),(0,a.jsx)("p",{className:"paragraph-large mg-top-16px",children:(null==R?void 0:R.description)||"Create professional letters with a simple prompt"})]})}),(0,a.jsxs)("form",{onSubmit:O,className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"font-semibold text-indigo-700",children:"Tell me what kind of letter you need"}),(0,a.jsx)(p.g,{placeholder:"Describe the letter you need (Example: Write a formal complaint letter to my internet service provider about frequent outages over the past month. Include specific dates if possible and request compensation for the service interruption. The provider's name is FastConnect.)",className:"mt-1",rows:8,value:v,onChange:e=>N(e.target.value),ref:G,required:!0}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-2",children:"For best results, include details about: the type of letter (business, personal, formal, etc.), who it's addressed to, the main purpose, key points to cover, and your preferred tone."})]}),S&&(0,a.jsx)("div",{className:"space-y-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"font-semibold text-indigo-700",children:"Choose AI Model:"}),(0,a.jsxs)(u.Ph,{onValueChange:k,value:C,children:[(0,a.jsx)(u.i4,{className:"mt-1 max-w-xs text-indigo-600",children:(0,a.jsx)(u.ki,{placeholder:"Select model"})}),(0,a.jsxs)(u.Bw,{className:"bg-white text-indigo-600",children:[(0,a.jsxs)(u.Ql,{value:"gpt-4o",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/chatgpt-icon.png",className:"size-5 mr-2",alt:" "})," ChatGPT-4o"]}),(0,a.jsxs)(u.Ql,{value:"gpt-4o-mini",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/chatgpt-icon.png",className:"size-5 mr-2",alt:" "})," ChatGPT-4o Mini"]}),(0,a.jsxs)(u.Ql,{value:"claude-3-opus",className:"flex gap-10  ",children:[" ",(0,a.jsx)("img",{src:"/images/models/claude-ai-icon.png",alt:" ",className:"size-5 mr-2"})," Claude 3 Opus"]}),(0,a.jsxs)(u.Ql,{value:"claude-3-sonnet",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/claude-ai-icon.png",alt:" ",className:"size-5 mr-2"})," Claude 3.5 Sonnet"]}),(0,a.jsxs)(u.Ql,{value:"llama-3",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/meta-icon.png",alt:" ",className:"size-5 mr-2"})," Llama 3"]}),(0,a.jsxs)(u.Ql,{value:"llama-3-pro",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/meta-icon.png",alt:" ",className:"size-5 mr-2"})," Llama 3.1 (Pro)"]}),(0,a.jsxs)(u.Ql,{value:"perplexity-ai",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/perplexity-ai-icon.png",alt:" ",className:"size-5 mr-2"})," Perplexity AI"]}),(0,a.jsxs)(u.Ql,{value:"mistral-large",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/mistral-ai-icon.png",alt:" ",className:"size-5 mr-2"}),"Mistral Large"]}),(0,a.jsxs)(u.Ql,{value:"gemini-1.5-pro",className:"flex gap-2 justify-start items-start",children:[" ",(0,a.jsx)("img",{src:"/images/models/google-gemini-icon.png",alt:" ",className:"size-5 mr-2"}),"Gemini 1.5 Pro"]})]})]})]})}),(0,a.jsx)("div",{className:"flex justify-between flew-wrap md:flex-row flex-col gap-4",children:(0,a.jsx)("button",{type:"button",onClick:()=>T(!S),className:"text-indigo-600 font-medium",children:S?"Hide Advanced Options":"Show Advanced Options"})}),(0,a.jsx)(n.E.button,{whileHover:{scale:1.02},whileTap:{scale:.98},type:"submit",className:"w-full bg-gradient-to-r from-indigo-600 to-purple-600 text-white py-3 rounded-lg font-semibold",disabled:y,children:y?"Crafting Your Letter...":"Generate Letter"})]})]}),w&&(0,a.jsx)(n.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},children:(0,a.jsxs)("div",{className:"bg-white p-6 rounded-xl shadow-lg",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)("p",{className:"text-2xl font-bold text-indigo-800 border-b-2 border-indigo-100 pb-2",children:"Your Generated Letter"}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)(n.E.button,{whileHover:{scale:1.1},onClick:Q,title:"Copy to clipboard",children:(0,a.jsx)(d.esY,{className:"text-indigo-600"})}),(0,a.jsx)(n.E.button,{whileHover:{scale:1.1},onClick:U,title:"Download as text file",children:(0,a.jsx)(d.aBF,{className:"text-green-600"})}),(0,a.jsx)(n.E.button,{whileHover:{scale:1.1},onClick:F,title:"Clear letter",children:(0,a.jsx)(d.Xm5,{className:"text-red-600"})})]})]}),(0,a.jsx)("div",{className:"whitespace-pre-wrap font-serif text-gray-800 prose max-w-none",children:w})]})},"content")]}),E?(0,a.jsx)("div",{className:"flex justify-center p-10",children:(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500"})}):(0,a.jsx)(f.Z,{title:B,introContent:R,faqs:q,howToUseSteps:P,proTips:Z}),(0,a.jsx)(m.Z,{})]})]})}}},function(e){e.O(0,[5445,3996,5675,2498,8764,7066,607,6501,1789,3034,6657,6947,9774,2888,179],function(){return e(e.s=21248)}),_N_E=e.O()}]);

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.