PageSourceSearch

https://itsraw.ai/_next/static/chunks/pages/create-17c323eef87b40ef.js

js itsraw.ai collected 2026-10-05 12:05:06 UTC 36,188 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[860],{758:(e,t,s)=>{"use strict";var l;s.d(t,{Z0:()=>n});let r="0123456789ABCDEFGHJKMNPQRSTVWXYZ";!function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"}(l||(l={}));class a extends Error{constructor(e,t){super(`${t} (${e})`),this.name="ULIDError",this.code=e}}function n(e,t){let s=t||function(e){let t="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:null,s=t&&(t.crypto||t.msCrypto)||null;if("function"==typeof s?.getRandomValues)return()=>{let e=new Uint8Array(1);return s.getRandomValues(e),e[0]/256};if("function"==typeof s?.randomBytes)return()=>s.randomBytes(1).readUInt8()/256;throw new a(l.PRNGDetectFailure,"Failed to find a reliable PRNG")}();return function(e,t=10){if(isNaN(e))throw new a(l.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>0xffffffffffff)throw new a(l.EncodeTimeSizeExceeded,`Cannot encode a time larger than 28
11474976710655: ${e}`);if(e<0)throw new a(l.EncodeTimeNegative,`Time must be positive: ${e}`);if(!1===Number.isInteger(e))throw new a(l.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let s,n="";for(let l=t;l>0;l--)s=e%32,n=r.charAt(s)+n,e=(e-s)/32;return n}(!e||isNaN(e)?Date.now():e,10)+function(e,t){let s="";for(;e>0;e--)s=function(e){let t=Math.floor(32*e())%32;return r.charAt(t)}(t)+s;return s}(16,s)}},2188:(e,t,s)=>{"use strict";s.d(t,{w:()=>i});var l=s(3798),r=s(2916),a=s(7005),n=s(8456),o=s(1462);s(4052);let i=e=>{let{children:t}=e,{isSignedIn:s,isLoaded:i}=(0,r.d)(),d=(0,a.ho)();if((0,o.useEffect)(()=>{i&&!s&&d.redirectToSignIn()},[i,s,d]),i||s)return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.iB,{children:t}),(0,l.jsx)(n.Bl,{})]})}},3449:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/create",function(){return s(3865)}])},3865:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var l=s(3798),r=s(6426),a=s(8417),n=s(6530);s(9873);var o=s(1462),i=s(3130),d=s(4052),c=s(9214),m=s.n(c),u=s(3987),p=s(5695),x=s(7405),h=s(4004),g=s(758);function f(e){let{fetchData:t}=e,[s,r]=(0,o.useState)(!1),a=(0,o.useRef)(null),[n,c]=(0,o.useState)(null),[f,b]=(0,o.useState)(null),[j,v]=(0,o.useState)({}),{generate:y,addorUpdateprs:w,UpdateImage:N,DeleteImage:D}=(0,p.g)(),[F,E]=(0,o.useState)(()=>{{let e=localStorage.getItem("generatePrForm");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing saved form data",e)}}return{pressReleaseStyle:"",primarySpokesperson:"",campaignFocus:"",spokespersonName:"",designationTitle:"",priceRange:"",goLiveDate:"",duration:"",keyHighlights:"",preferredQuote:""}}),S=(0,u.useRouter)(),k={formal:"Standard corporate tone for official announcements.",fun:"Engaging, conversational tone for product launches."},C=i.Ikc({pressReleaseStyle:i.YjP().min(1,"Press Release Style is required."),campaignFocus:i.YjP().min(1,"Campaign focus is required."),primarySpokesperson:i.YjP().min(1,"Primary spokesperson is required."),preferredQuote:i.YjP().min(1,"Preferred quote is required."),goLiveDate:i.YjP().min(1,"Distribution date is required."),duration:i.YjP().min(1,"Duration is required."),spokespersonName:i.YjP().min(1,"Spokesperson name is required."),keyHighlights:i.YjP().min(1,"Key highlights are required.")}),P=e=>{let{name:t,value:s}=e.target;E(e=>({...e,[t]:s})),j[t]&&v(e=>({...e,[t]:null}))},R=["image/jpeg","image/png","image/webp"],I=e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];if(s){if(s.size>5242880){alert("File is too large. Maximum allowed size is ".concat(5,"MB.")),e.target.value="";return}if(!R.includes(s.type)){alert("Invalid file format. Please upload JPG, PNG, or WEBP."),e.target.value="";return}c(s),b(null)}},A=()=>{a.current&&a.current.click()};(0,o.useEffect)(()=>{try{localStorage.setItem("generatePrForm",JSON.stringify(F))}catch(e){}},[F]);let B=async e=>{var s,l,a;e.preventDefault();let o=C.safeParse(F);if(!o.success){let e={};o.error.issues.forEach(t=>{t.path[0]&&(e[t.path[0]]=t.message)}),v(e),h.Ay.error("Please fix the errors in the form.");return}v({});try{r(!0);let e={restaurantInfo:t,pressReleaseDetails:{primaryFocus:F.campaignFocus,goLiveDate:F.goLiveDate,duration:F.duration,keyHighlights:F.keyHighlights,priceRange:F.priceRange,bookingRequired:F.bookingRequired,primarySpokesperson:F.primarySpokesperson,spokespersonName:F.spokespersonName,spokespersonTitle:F.designationTitle,spokespersonQuote:F.preferredQuote,style:F.pressReleaseStyle}},l=await y(x.A.OTHER.GENERATE,e),a=(0,g.Z0)();if(l){let e=(null==(s=l.match(/^# (.*)$/m))?void 0:s[1])||"ItsRaw.AI Press Release",t=await w(x.A.OTHER.PRS,{id:a,title:e,content:l},a);if(console.log("res",t),n){let e=new FormData;e.append("image",n);let t=await N(x.A.OTHER.PRS,e,a);console.log("Image upload res",t)}else{let e=await D(x.A.OTHER.PRS,a);console.log("Image delete res",e)}}await new Promise(e=>setTimeout(e,5e3)),h.Ay.success("Press release generated and submitted successfully!"),S.push("/dashboard-dashboard")}catch(s){console.error(s);let e=(null==s||null==(l=s.response)?void 0:l.status)===413||(null==s?void 0:s.message)==="Network Error",t=e?"Image exceeds the 9 MB upload limit.":("string"==typeof(null==s||null==(a=s.response)?void 0:a.data)?s.response.data:null)||(null==s?void 0:s.message)||"An error occurred";e&&b("Image exceeds the 9 MB upload limit."),h.Ay.error(t)}finally{r(!1)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"min-h-screen hidden lg:flex flex-col items-center justify-center py-12",children:(0,l.jsxs)("form",{className:"flex flex-col gap-4 justify-center mx-auto max-w-5xl w-full",children:[(0,l.jsxs)("div",{className:"py-8 w-full px-4 flex flex-col gap-2 justify-between h-[180px] bg-[#FBDFDF] rounded-xl",children:[(0,l.jsx)("label",{className:"font-medium",children:"Upload Your Image"}),(0,l.jsx)("span",{className:"text-xs text-gray-500 font-normal block mt-0.5",children:"JPEG, PNG, WEBP (Max size: 5MB)"}),(0,l.jsxs)("div",{className:"bg-white flex justify-between w-full items-center px-2 cursor-pointer rounded-md font-medium transition-colors duration-200",onClick:A,children:[(0,l.jsxs)("div",{className:"rounded-md flex flex-col w-full p-2 cursor-pointer text-sm text-gray-500",children:[n?n.name:"Drag & drop or browse here",(0,l.jsx)("input",{type:"file",ref:a,className:"hidden",accept:"image/jpeg,image/png,image/webp",onChange:I})]}
1),(0,l.jsx)("div",{className:"h-[15px] w-[15px] relative",children:(0,l.jsx)(m(),{src:"/assets/dashboard/arrow.svg",alt:"arrow",fill:!0,className:"object-cover"})})]}),f&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:f})]}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"flex gap-4",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex gap-4 justify-between",children:[(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBDFDF] h-[180px] w-[250px] p-3 py-8 rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Press Release Style*"}),F.pressReleaseStyle&&k[F.pressReleaseStyle]&&(0,l.jsx)("p",{className:"text-xs text-gray-600 mt-2 ",children:k[F.pressReleaseStyle]}),(0,l.jsxs)("select",{name:"pressReleaseStyle",value:F.pressReleaseStyle,onChange:P,className:"border bg-white text-start border-gray-400 rounded-md flex flex-col items-center justify-center p-2 text-sm text-gray-500 ".concat(j.pressReleaseStyle?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"formal",children:"Formal"}),(0,l.jsx)("option",{value:"fun",children:"Fun"})]}),j.pressReleaseStyle&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.pressReleaseStyle})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBEDDF] p-3 py-8 h-[180px] w-[230px] rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Select primary focus*"}),(0,l.jsxs)("select",{name:"campaignFocus",value:F.campaignFocus,onChange:P,className:"border bg-white text-start border-gray-400 rounded-md flex flex-col items-center justify-center p-2 text-sm text-gray-500 ".concat(j.campaignFocus?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"new-chef",children:"New Chef Announcement"}),(0,l.jsx)("option",{value:"collaboration",children:"Collaboration / Guest Chef"}),(0,l.jsx)("option",{value:"new-offer",children:"New Offer / Deal (e.g., Happy Hour)"}),(0,l.jsx)("option",{value:"seasonal-campaign",children:"Seasonal Campaign"}),(0,l.jsx)("option",{value:"special-event",children:"Special Event"}),(0,l.jsx)("option",{value:"venue-redesign",children:"Venue Redesign"}),(0,l.jsx)("option",{value:"awards",children:"Awards / Recognitions"}),(0,l.jsx)("option",{value:"brand-partnership",children:"Brand Partnership"}),(0,l.jsx)("option",{value:"csr-initiative",children:"CSR Initiative"}),(0,l.jsx)("option",{value:"new-opening",children:"New Opening"}),(0,l.jsx)("option",{value:"other",children:"Other"})]}),j.campaignFocus&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.campaignFocus})]})})]}),(0,l.jsx)("div",{className:"flex gap-4",children:(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBEDDF] p-3 py-8 h-[180px] w-[500px] rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Primary Spokesperson*"}),(0,l.jsxs)("select",{name:"primarySpokesperson",value:F.primarySpokesperson,onChange:P,className:"border bg-white text-start border-gray-400 rounded-md flex flex-col items-center justify-center p-2 text-sm text-gray-500 ".concat(j.primarySpokesperson?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"owner",children:"Owner"}),(0,l.jsx)("option",{value:"general-manager",children:"General Manager"}),(0,l.jsx)("option",{value:"head-chef",children:"Head Chef"}),(0,l.jsx)("option",{value:"marketing-manager",children:"Marketing Manager"}),(0,l.jsx)("option",{value:"fb-director",children:"F&B Director"}),(0,l.jsx)("option",{value:"other",children:"Other"})]}),j.primarySpokesperson&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.primarySpokesperson})]})})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBDFDF] h-[250px] w-[500px] p-3 py-8 rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Preferred quote for Press*"}),(0,l.jsx)("textarea",{name:"preferredQuote",value:F.preferredQuote,onChange:P,placeholder:"Enter Preferred quote for Press",className:"border border-gray-300 bg-white rounded-md p-2 resize-none h-[120px] text-sm ".concat(j.preferredQuote?"border-red-500":"")}
1),j.preferredQuote&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.preferredQuote})]})})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"flex gap-4",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"w-[500px] flex gap-4",children:[(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBEDDF] p-3 py-8 w-[250px] h-[180px] rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Distribution Date*"}),(0,l.jsx)("input",{type:"date",name:"goLiveDate",value:F.goLiveDate,onChange:P,className:"border border-gray-300 bg-white rounded-md p-2 text-sm ".concat(j.goLiveDate?"border-red-500":"")}),j.goLiveDate&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.goLiveDate})]}),(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBDFDF] p-3 py-8 w-[250px] h-[180px] rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Duration*"}),(0,l.jsxs)("select",{name:"duration",value:F.duration,onChange:P,className:"border bg-white text-start border-gray-400 rounded-md flex flex-col items-center justify-center p-2 text-sm text-gray-500 ".concat(j.duration?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"one-day",children:"One-day only"}),(0,l.jsx)("option",{value:"week-long",children:"Week-long"}),(0,l.jsx)("option",{value:"month-long",children:"Month-long"}),(0,l.jsx)("option",{value:"ongoing",children:"Ongoing"}),(0,l.jsx)("option",{value:"seasonal",children:"Seasonal"})]}),j.duration&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.duration})]})]}),(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBDFDF] h-[180px] p-3 py-8 rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Name of spokesperson*"}),(0,l.jsx)("textarea",{name:"spokespersonName",value:F.spokespersonName,onChange:P,placeholder:"Enter the name of spokesperson",className:"border border-gray-300 resize-none bg-white rounded-md p-2 text-sm ".concat(j.spokespersonName?"border-red-500":"")}),j.spokespersonName&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.spokespersonName})]})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsxs)("div",{className:"col-span-1 bg-[#FBEDDF] w-[500px] h-[250px] p-3 py-8 rounded-2xl flex flex-col justify-between",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-1",children:"Key highlights / Selling points (Max 3)*"}),(0,l.jsx)("textarea",{name:"keyHighlights",value:F.keyHighlights,onChange:P,placeholder:"Enter upto 3 key highlights or selling points",className:"border border-gray-300 resize-none bg-white rounded-md p-2 h-[120px] text-sm ".concat(j.keyHighlights?"border-red-500":"")}),j.keyHighlights&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.keyHighlights})]})})]})]}),(0,l.jsx)("div",{className:"flex justify-center w-full",children:(0,l.jsx)("button",{className:"px-6 py-2 bg-[#EE3A3D] w-full text-white rounded hover:bg-red-500 cursor-pointer",onClick:B,children:"Generate"})})]})}),(0,l.jsx)(d.A,{isOpen:s}),(0,l.jsx)("div",{className:"min-h-screen lg:hidden block px-4 py-12",children:(0,l.jsxs)("form",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"bg-[#FBDFDF] p-4 rounded-xl flex flex-col gap-2",children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-2",children:"Upload Image"}),(0,l.jsxs)("div",{className:"bg-white p-3 rounded-md text-sm text-gray-500 cursor-pointer",onClick:A,children:[n?n.name:"Tap to upload image",(0,l.jsx)("input",{type:"file",ref:a,className:"hidden",onChange:I})]}),f&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:f})]}),(0,l.jsxs)("div",{className:"bg-[#FBDFDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Press Release Style*"}),F.pressReleaseStyle&&k[F.pressReleaseStyle]&&(0,l.jsx)("p",{className:"text-xs text-gray-600 my-2 ",children:k[F.pressReleaseStyle]}),(0,l.jsxs)("select",{name:"pressReleaseStyle",value:F.pressReleaseStyle,onChange:P,className:"w-full border bg-white border-gray-400 rounded-md p-2 text-sm ".concat(j.pressReleaseStyle?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"formal",children:"Formal"}),(0,l.jsx)("option",{value:"fun",children:"Fun"})]}),j.pressReleaseStyle&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.pressReleaseStyle})]}),(0,l.jsxs)("div",{className:"bg-[#FBEDDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Select the primary focus of the campaign or release*"}),(0,l.jsxs)("select",{name:"campaignFocus",value:F.campaignFocus,onChange:P,className:"w-full border bg-white border-gray-400 rounded-md p-2 text-sm ".concat(j.campaignFocus?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"new-chef",children:"New Chef Announcement"}),(0,l.jsx)("option",{value:"collaboration",children:"Collaboration / Guest Chef"}),(0,l.jsx)("option",{value:"new-offer",children:"New Offer / Deal"}),(0,l.jsx)("option",{value:"seasonal-campaign",children:"Seasonal Campaign"}),(0,l.jsx)("option",{value:"special-event",children:"Special Event"}),(0,l.jsx)("option",{value:"venue-redesign",children:"Venue Redesign"}),(0,l.jsx)("option",{value:"awards",children:"Awards"}
1),(0,l.jsx)("option",{value:"brand-partnership",children:"Brand Partnership"}),(0,l.jsx)("option",{value:"csr-initiative",children:"CSR Initiative"}),(0,l.jsx)("option",{value:"new-opening",children:"New Opening"}),(0,l.jsx)("option",{value:"other",children:"Other"})]}),j.campaignFocus&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.campaignFocus})]}),(0,l.jsxs)("div",{className:"bg-[#FBEDDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Distribution Date (when you are planning on sending to the media)*"}),(0,l.jsx)("input",{type:"date",name:"goLiveDate",value:F.goLiveDate,onChange:P,className:"w-full border bg-white border-gray-300 rounded-md p-2 text-sm ".concat(j.goLiveDate?"border-red-500":"")}),j.goLiveDate&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.goLiveDate})]}),(0,l.jsxs)("div",{className:"bg-[#FBDFDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Duration*"}),(0,l.jsxs)("select",{name:"duration",value:F.duration,onChange:P,className:"w-full border bg-white border-gray-400 rounded-md p-2 text-sm ".concat(j.duration?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"one-day",children:"One Day"}),(0,l.jsx)("option",{value:"week-long",children:"Week Long"}),(0,l.jsx)("option",{value:"month-long",children:"Month Long"}),(0,l.jsx)("option",{value:"ongoing",children:"Ongoing"}),(0,l.jsx)("option",{value:"seasonal",children:"Seasonal"})]}),j.duration&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.duration})]}),(0,l.jsxs)("div",{className:"bg-[#FBEDDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Primary Spokesperson*"}),(0,l.jsxs)("select",{name:"primarySpokesperson",value:F.primarySpokesperson,onChange:P,className:"w-full border bg-white border-gray-400 rounded-md p-2 text-sm ".concat(j.primarySpokesperson?"border-red-500":""),children:[(0,l.jsx)("option",{value:"",children:"Select"}),(0,l.jsx)("option",{value:"owner",children:"Owner"}),(0,l.jsx)("option",{value:"general-manager",children:"General Manager"}),(0,l.jsx)("option",{value:"head-chef",children:"Head Chef"}),(0,l.jsx)("option",{value:"marketing-manager",children:"Marketing Manager"}),(0,l.jsx)("option",{value:"fb-director",children:"F&B Director"}),(0,l.jsx)("option",{value:"other",children:"Other"})]}),j.primarySpokesperson&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.primarySpokesperson})]}),(0,l.jsxs)("div",{className:"bg-[#FBDFDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Name of spokesperson*"}),(0,l.jsx)("input",{type:"text",name:"spokespersonName",value:F.spokespersonName,onChange:P,placeholder:"Enter the name of spokesperson",className:"w-full border bg-white border-gray-300 rounded-md p-2 text-sm ".concat(j.spokespersonName?"border-red-500":"")}),j.spokespersonName&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.spokespersonName})]}),(0,l.jsxs)("div",{className:"bg-[#FBEDDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Key highlights / Selling points (Max 3 bullet points)*"}),(0,l.jsx)("textarea",{name:"keyHighlights",value:F.keyHighlights,onChange:P,rows:4,placeholder:"Enter upto 3 key highlights or selling points",className:"w-full border bg-white border-gray-300 rounded-md p-2 text-sm resize-none ".concat(j.keyHighlights?"border-red-500":"")}),j.keyHighlights&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.keyHighlights})]}),(0,l.jsxs)("div",{className:"bg-[#FBDFDF] p-4 rounded-xl",children:[(0,l.jsx)("label",{className:"text-sm font-medium mb-2 block",children:"Preferred quote for Press*"}),(0,l.jsx)("textarea",{name:"preferredQuote",value:F.preferredQuote,onChange:P,placeholder:"Enter Preferred quote for Press",rows:3,className:"w-full border bg-white border-gray-300 rounded-md p-2 text-sm resize-none ".concat(j.preferredQuote?"border-red-500":"")}
1),j.preferredQuote&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:j.preferredQuote})]}),(0,l.jsx)("button",{onClick:B,className:"mt-4 bg-[#EE3A3D] text-white py-3 rounded-lg font-medium",children:"Generate"})]})}),(0,l.jsx)(h.l$,{position:"bottom-right"})]})}var b=s(6513);let j=e=>{let{fetchData:t}=e,s=[{title:"Upload Your Image",type:"file",bgColor:"bg-[#FBDFDF]",height:"h-[120px]",fullWidth:!0},{title:"Press Release Style",type:"select",options:["Select","Formal","Fun"],bgColor:"bg-[#FBDFDF]",height:"h-[120px] md:h-[300px]",fullWidth:!0},{title:"Select the primary focus of the campaign or release*",type:"select",options:["New Chef Announcement","Collaboration / Guest Chef","New Offer / Deal","Seasonal Campaign","Special Event","Venue Redesign / Refurbishment","Awards / Recognitions","Brand Partnership","CSR Initiative / Sustainability Update","New Opening","Other"],bgColor:"bg-[#FBDFDF]",height:"h-[120px] md:h-[300px]"},{title:"Go-Live Date / Event / Offer Date*",type:"date",bgColor:"bg-[#FBEDDF]",height:"h-[120px] md:h-[300px]"},{title:"Duration (If Applicable)",type:"select",options:["Select","One-day only","Week-long","Month-long","Ongoing","Seasonal"],bgColor:"bg-[#FBEDDF]",height:"h-[120px] md:h-[180px]"},{title:"Primary Spokesperson (If Applicable)",type:"select",options:["Select","Owner","General Manager","Head Chef","Marketing Manager","F&B Director","Other"],bgColor:"bg-[#FBEDDF]",height:"h-[120px] md:h-[180px]"},{title:"Name of spokesperson",type:"text",placeholder:"Enter the name of spokesperson",bgColor:"bg-[#FBEDDF]",height:"h-[120px] md:h-[180px]"},{title:"Key highlights / Selling points (Max 3 bullet points)*",type:"text",placeholder:"Enter upto 3 key highlights or selling points",bgColor:"bg-[#FBDFDF]",height:"h-[120px] md:h-[180px]"},{title:"Designation Title of spokesperson",type:"text",placeholder:"Enter the title and designation of spokesperson",bgColor:"bg-[#FBEDDF]",height:"h-[120px] md:h-[180px]"},{title:"Preferred quote for Press (if any) ",type:"text",placeholder:"Enter a quote from the spokesperson Enter a quote from the spokesperson for the press release the press release",bgColor:"bg-[#FBDFDF]",height:"h-[120px] md:h-[180px]"}].reduce((e,t)=>(e[t.title]="file"===t.type?null:"",e),{}),[i,d]=(0,o.useState)("ai"),[c,m]=(0,o.useState)(!1),[u,p]=(0,o.useState)(s);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"h-auto md:h-[90vh] w-full bg-cover overflow-hidden",style:{backgroundImage:"url(/assets/dashboard/raw.png)"},children:[(0,l.jsx)(r.A,{}),(0,l.jsx)(n.A,{image:"/assets/dashboardcustom/vector-2.svg",activeForm:i,setActiveform:d,btn2:" bg-[#FFFFFF] hover:bg-zinc-100 !text-black"})]}),(0,l.jsx)("div",{className:"flex w-full items-center justify-center pt-12",children:(0,l.jsxs)("div",{className:"flex items-center gap-1 bg-zinc-100 p-1 rounded-lg",children:[(0,l.jsx)("button",{className:"px-4 md:px-6 py-2 rounded-md font-medium text-sm md:text-base transition-all duration-200 cursor-pointer\n                ".concat("ai"===i?"bg-[#EE3A3D] text-white shadow-sm":"bg-transparent text-zinc-600 hover:bg-zinc-200"),onClick:()=>d("ai"),children:"AI Generate"}),(0,l.jsx)("button",{className:"px-4 md:px-6 py-2 rounded-md font-medium text-sm md:text-base transition-all duration-200 cursor-pointer\n                ".concat("custom"===i?"bg-[#EE3A3D] text-white shadow-sm":"bg-transparent text-zinc-600 hover:bg-zinc-200"),onClick:()=>d("custom"),children:"Write Custom"})]})}),"ai"===i&&(0,l.jsxs)(l.Fragment,{children:["  ",(0,l.jsx)(f,{fetchData:t})]}),"custom"===i&&(0,l.jsx)(b.A,{}),(0,l.jsx)(a.A,{})]})};var v=s(2188);let y=()=>{let[e,t]=(0,o.useState)(null),{GETDATA:s}=(0,p.g)(),r=async()=>{t(await s(x.A.OTHER.RESTAURANT)),console.log("res")};return(0,o.useEffect)(()=>{r()},[]),(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(v.w,{children:(0,l.jsx)(j,{fetchData:e})})})}},4052:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var l=s(3798),r=s(1462),a=s(9214),n=s.n(a),o=s(5938);function i(e){let{isOpen:t}=e,[s,a]=(0,r.useState)(0),[i,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)(!1),u=(0,r.useRef)();return((0,r.useEffect)(()=>
1{if(!t)return;m(!0),a(0);let e=setInterval(()=>{a(t=>t>=100?(d(!0),clearInterval(e),100):t+1)},30);return()=>clearInterval(e)},[t]),(0,r.useEffect)(()=>{u&&(o.Ay.timeline(),o.Ay.to(u.current,{y:"-=10",duration:1,repeat:-1,opacity:1,yoyo:!0,ease:"power1.inOut"}))},[t]),c)?(0,l.jsxs)("div",{className:"fixed inset-0  h-screen w-full flex flex-col justify-center items-center z-[999999] bg-cover \n        transition-opacity duration-300 \n      ".concat(t?"opcity-100":"opacity-0 hidden"),style:{background:"url(/assets/dashboard/raw.png)"},children:[(0,l.jsx)("div",{className:"block absolute h-full w-full inset-0  ",children:(0,l.jsx)(n(),{src:"/assets/home/Vector.webp",alt:"section1",ref:u,width:1900,height:800,className:"object-contain trnasform  h-full w-full translate-y-40 md:translate-y-10"})}),(0,l.jsx)("div",{className:"bg-white relative z-20 rounded-2xl shadow-lg p-6 text-center",children:(0,l.jsxs)("div",{className:"relative w-20 h-20 mx-auto flex justify-center items-center",children:[(0,l.jsx)("div",{className:"absolute w-20 h-20 rounded-full border-4 border-[#eaa8a8] border-t-[#ff6347] animate-spin"}),(0,l.jsxs)("span",{className:"relative text-sm font-medium",children:[s,"%"]})]})}),(0,l.jsx)("p",{className:"mt-4 text-3xl font-bold  tracking-wide",style:{fontFamily:"Subscribe"},children:"LOADING"})]}):null}},6513:(e,t,s)=>{"use strict";s.d(t,{A:()=>x});var l=s(3798),r=s(1462),a=s(4052),n=s(9214),o=s.n(n),i=s(3987),d=s(5695),c=s(7405),m=s(758),u=s(4004),p=s(8690);let x=e=>{let{pr:t,onSave:s,fetchPrs:n}=e,x=!t,[h,g]=(0,r.useState)(!1),f=(0,i.useRouter)(),{addorUpdateprs:b,UpdateImage:j,DeleteImage:v}=(0,d.g)();(0,r.useEffect)(()=>{console.log("pr",t)},[t]);let[y,w]=(0,r.useState)(()=>x?localStorage.getItem("customPrTitle")||"":(null==t?void 0:t.title)||""),[N,D]=(0,r.useState)(()=>x?localStorage.getItem("customPrContent")||"":(null==t?void 0:t.content)||""),[F,E]=(0,r.useState)(null),[S,k]=(0,r.useState)((null==t?void 0:t.image_uri)||null),[C,P]=(0,r.useState)(null),[R,I]=(0,r.useState)(null),A=(0,r.useRef)(null);(0,r.useEffect)(()=>{t&&(w(t.title||""),D(t.content||""),k(t.image_uri||null),P(t.preview_image_uri||null))},[t]),(0,r.useEffect)(()=>{try{localStorage.setItem("customPrTitle",y)}catch(e){}},[y]),(0,r.useEffect)(()=>{try{localStorage.setItem("customPrContent",N)}catch(e){}},[N]);let B=["image/jpeg","image/png","image/webp"],T=async e=>{if(e&&e.preventDefault(),!y.trim()||!N.trim())return void u.Ay.error("Please fill in both title and content.");try{g(!0);let e=(null==t?void 0:t.id)||(0,m.Z0)(),l=await b(c.A.OTHER.PRS,{id:e,title:y,content:N},e);if(console.log("res",l),F){let t=new FormData;t.append("image",F);let s=await j(c.A.OTHER.PRS,t,e);console.log("Image upload res",s)}try{localStorage.removeItem("customPrTitle"),localStorage.removeItem("customPrContent")}catch(e){}await new Promise(e=>setTimeout(e,5e3)),u.Ay.success("Press release submitted successfully!"),s?s():f.push("/dashboard-dashboard")}catch(s){var l,r;console.error(s);let e=(null==s||null==(l=s.response)?void 0:l.status)===413||(null==s?void 0:s.message)==="Network Error",t=e?"Image exceeds the 9 MB upload limit.":("string"==typeof(null==s||null==(r=s.response)?void 0:r.data)?s.response.data:null)||(null==s?void 0:s.message)||"Error saving press release.";e&&I("Image exceeds the 9 MB upload limit."),u.Ay.error(t)}finally{g(!1)}},M=async()=>{console.log("Image delete res",await v(c.A.OTHER.PRS,t.id)),E(null),P(null),k(null),n()};return(0,l.jsxs)("div",{className:"py-6 w-full",children:[(0,l.jsx)(u.l$,{position:"bottom-right"}),(0,l.jsxs)("div",{className:"max-w-5xl mx-auto px-4 md:px-0 flex flex-col items-center gap-3 justify-between",children:[(0,l.jsxs)("div",{className:"md:py-8 p-4 w-full md:px-4 flex flex-col ".concat(x?"bg-[#FBDFDF]":"bg-white"," h-auto min-h-[120px] md:min-h-[180px] justify-between rounded-xl"),children:[(0,l.jsx)("label",{className:"font-medium",children:"Upload Your Image"}),(0,l.jsx)("span",{className:"text-xs text-gray-500 font-normal block mt-0.5",children:"JPEG, PNG, WEBP (Max size: 5MB)"}),!x&&C&&(0,l.jsxs)("div",{className:"relative w-full h-full",children:[(0,l.jsx)("div",{className:"absolute -top-10 right-4 translate-x-[50%] h-[25px] flex items-center justify-center w-[25px] bg-black  rounded z-10 cursor-pointer",children:(0,l.jsx)(p.A,{className:"text-white",onClick:()=>M()})}),(0,l.jsx)("div",{className:"relative w-full h-48 mb-2 rounded-lg overflow-hidden border border-gray-200",children:(0,l.jsx)(o(),{src:C||S,alt:"Preview",fill:!0,className:"object-contain bg-white"})})]}),(0,l.jsxs)("div",{className:"bg-white flex ".concat(x?"":" border border-gray-300 ","  w-full items-center px-2 cursor-pointer text-white rounded-md font-medium transition-colors duration-200"),onClick:()=>{A.current&&A.current.click()},children:[(0,l.jsxs)("div",{className:"rounded-md flex flex-col  w-full p-2 cursor-pointer text-sm text-gray-500",children:[F?F.name:S?"Change existing image":"Click arrow to browse",(0,l.jsx)("input",{type:"file",ref:A,className:"hidden",accept:"image/jpeg,image/png,image/webp",onChange:e=>{let t=e.target.files[0];if(t){if(t.size>5242880){alert("File is too large. Maximum allowed size is ".concat(5,"MB.")),e.target.value="";return}if(!B.includes(t.type)){alert("Invalid file format. Please upload JPG, PNG, or WEBP."),e.target.value="";return}E(t),P(URL.createObjectURL(t)),k(null),I(null)}}})]}
1),(0,l.jsx)("div",{className:"h-[15px] w-[15px] relative",children:(0,l.jsx)(o(),{src:"/assets/dashboard/arrow.svg",alt:"arrow",fill:!0,className:"object-cover"})})]}),R&&(0,l.jsx)("p",{className:"text-red-500 text-xs mt-1",children:R})]}),(0,l.jsxs)("div",{className:"md:py-8 w-full p-4 md:px-4 flex flex-col justify-between h-[120px] md:h-[180px] gap-2 ".concat(x?"bg-[#FBEDDF]":"bg-white"," rounded-xl"),children:[(0,l.jsx)("label",{className:"font-medium",children:"Press Release Title"}),(0,l.jsx)("input",{type:"text",placeholder:"Enter a title for your press release",value:y,onChange:e=>w(e.target.value),className:"border border-gray-300 bg-white rounded-md p-2 h-14 text-sm focus:outline-none"})]}),(0,l.jsxs)("div",{className:"md:py-8 w-full md:px-4 flex flex-col p-4 h-[400px] gap-2 ".concat(x?"bg-[#FBEDDF]":"bg-white","  rounded-xl"),children:[(0,l.jsx)("label",{className:"font-medium",children:"Write your press release here"}),(0,l.jsx)("textarea",{placeholder:"Write your press release here...",value:N,onChange:e=>D(e.target.value),className:"border border-gray-300 bg-white rounded-md p-2 h-[80%] text-sm focus:outline-none resize-none"})]}),(0,l.jsxs)("div",{className:"flex flex-row items-center justify-between w-full gap-4",children:[(0,l.jsx)("button",{type:"button",onClick:()=>{if(x){w(""),D(""),E(null),P(null),k(null);try{localStorage.removeItem("customPrTitle"),localStorage.removeItem("customPrContent")}catch(e){}}else s&&s()},className:"px-6 py-2 bg-white border border-gray-300 text-black w-32 rounded hover:bg-gray-100 cursor-pointer",children:x?"Clear":"Cancel"}),(0,l.jsx)("button",{onClick:T,disabled:!N.trim()||h,className:"px-6 py-2 bg-[#EE3A3D] flex-1 text-white rounded hover:bg-red-500 cursor-pointer disabled:opacity-50 flex items-center justify-center",children:h?"Saving...":t?"Update Draft":"Save as Draft"})]})]}),!t&&(0,l.jsx)(a.A,{isOpen:h})]})}},6530:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var l=s(3798),r=s(9214),a=s.n(r);let n=e=>{let{image:t,btn:s,btn2:r,activeForm:n,setActiveform:o}=e;return(0,l.jsx)("div",{className:"h-[90%] w-full ",children:(0,l.jsxs)("div",{className:"  md:w-[80%] mx-auto relative overflow-hidden flex lg:flex-row flex-col justify-between h-full ",children:[(0,l.jsx)("div",{className:"h-[50%] lg:h-full w-full px-4 lg:px-0 lg:w-1/2 flex flex-col justify-center ",children:(0,l.jsxs)("h2",{className:"text-5xl md:text-7xl uppercase mb-4 font-medium",children:["Create your",(0,l.jsx)("br",{}),(0,l.jsx)("span",{className:"text-[#EE3A3D]",children:"press Release"})]})}),(0,l.jsx)("div",{className:" h-[50%]  w-full  lg:w-1/2 lg:h-full flex items-center justify-center  ",children:(0,l.jsx)("div",{className:"w-full h-full flex items-center justify-center md:items-end md:justify-end ",children:(0,l.jsx)("div",{className:" md:h-full relative h-full  w-[80%] lg:w-full md:w-[90%] flex items-end justiy-end",children:(0,l.jsx)(a(),{src:t,priority:!0,className:"md:aspect-[16/14]",width:800,height:800})})})})]})})}},9873:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var l=s(3798),r=s(1462),a=s(4052);function n(e){let{formSections:t,loading:s,dashboardAi:n,handleSubmit:o,handleChange:i,formData:d}=e,[c,m]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=()=>{m(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,l.jsx)("div",{className:"min-h-screen lg:hidden block  py-8 px-4 md:px-8 my-20",children:(0,l.jsxs)("form",{className:"max-w-7xl mx-auto",children:[(0,l.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map((e,t)=>(0,l.jsxs)("div",{className:"".concat(e.bgColor," p-4 rounded-2xl flex flex-col justify-between ").concat(e.height," ").concat(e.fullWidth?"md:col-span-2":""),children:[(0,l.jsx)("label",{className:"font-medium text-sm mb-2",children:e.title.split("\n").map((t,s)=>(0,l.jsxs)("span",{children:[t,s<e.title.split("\n").length-1&&(0,l.jsx)("br",{})]},s))}),(e=>{switch(e.type){case"select":return(0,l.jsx)("select",{className:"w-full border bg-white border-gray-400 rounded-md p-2 text-sm text-gray-500 ".concat("h-[335px]"===e.height?"h-[calc(100%-2rem)]":"h-10"),value:d[e.title]||"",onChange:t=>i(e.title,t.target.value),children:e.options.map(e=>(0,l.jsx)("option",{value:e,children:e},e))});case"date":return console.log("FIELD TITLEtwo:",e.title),(0,l.jsx)("input",{value:d[e.title]||"",onChange:t=>i(e.title,t.target.value),type:"date",className:"w-full border border-gray-400 bg-white rounded-md p-2 text-sm text-gray-500 ".concat("h-[335px]"===e.height?"h-[calc(100%-2rem)]":"h-10")});case"file":return(0,l.jsx)("input",{onChange:t=>i(e.title,t.target.files[0]),type:"file",className:"w-full border border-gray-400 bg-white rounded-md p-2 text-sm text-gray-500 ".concat("h-[335px]"===e.height?"h-[calc(100%-2rem)]":"h-10")});
1default:return(0,l.jsx)("input",{type:e.type,onChange:t=>i(e.title,t.target.value),value:d[e.title]||"",placeholder:e.placeholder,className:"w-full border border-gray-300 bg-white rounded-md p-2 text-sm ".concat("h-[335px]"===e.height?"h-[calc(100%-2rem)]":"h-10")})}})(e)]},t))}),n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex justify-center w-full mt-8",children:(0,l.jsx)("button",{className:"px-6 py-2 bg-[#EE3A3D] w-full text-white rounded hover:bg-red-500 cursor-pointer",onClick:o,children:"Generate"})}),(0,l.jsx)(a.A,{isOpen:s})]})]})})}}},e=>{e.O(0,[931,770,130,666,636,593,792],()=>e(e.s=3449)),_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.