(()=>{var e={};e.id=9979,e.ids=[9979],e.modules={53524:e=>{"use strict";e.exports=require("@prisma/client")},47849:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external")},72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},55403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},94749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},39491:e=>{"use strict";e.exports=require("assert")},50852:e=>{"use strict";e.exports=require("async_hooks")},14300:e=>{"use strict";e.exports=require("buffer")},32081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},82361:e=>{"use strict";e.exports=require("events")},57147:e=>{"use strict";e.exports=require("fs")},73292:e=>{"use strict";e.exports=require("fs/promises")},13685:e=>{"use strict";e.exports=require("http")},95687:e=>{"use strict";e.exports=require("https")},22037:e=>{"use strict";e.exports=require("os")},71017:e=>{"use strict";e.exports=require("path")},63477:e=>{"use strict";e.exports=require("querystring")},76224:e=>{"use strict";e.exports=require("tty")},57310:e=>{"use strict";e.exports=require("url")},73837:e=>{"use strict";e.exports=require("util")},59796:e=>{"use strict";e.exports=require("zlib")},17589:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>s.ZP,__next_app__:()=>p,originalPathname:()=>d,pages:()=>c,routeModule:()=>u,tree:()=>l});var a=r(50482),i=r(69108),s=r(83543),n=r(68300),o={};for(let e in n)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>n[e]);r.d(t,o);let l=["",{children:["pricing",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,23203)),"C:\\test2\\pagecraft-ai\\src\\app\\pricing\\page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,43625)),"C:\\test2\\pagecraft-ai\\src\\app\\layout.tsx"],error:[()=>Promise.resolve().then(r.bind(r,24117)),"C:\\test2\\pagecraft-ai\\src\\app\\error.tsx"],"not-found":[()=>Promise.resolve().then(r.bind(r,48206)),"C:\\test2\\pagecraft-ai\\src\\app\\not-found.tsx"]}],c=["C:\\test2\\pagecraft-ai\\src\\app\\pricing\\page.tsx"],d="/pricing/page",p={require:r,loadChunk:()=>Promise.resolve()},u=new a.AppPageRouteModule({definition:{kind:i.x.APP_PAGE,page:"/pricing/page",pathname:"/pricing",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:l}})},72443:(e,t,r)=>{Promise.resolve().then(r.bind(r,84805))},62312:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,r(69224).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},83918:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,r(69224).Z)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},79200:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,r(69224).Z)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]])},84805:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PricingClient:()=>f});var a=r(95344),i=r(79200),s=r(69224);/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let n=(0,s.Z)("Crown",[["path",{d:"m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14",key:"zkxr6b"}]]);var o=r(83918),l=r(62312);/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let c=(0,s.Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var d=r(25390),p=r(56506),u=r(3729),g=r(9885),h=r(81723),m=r(75590);let x={FREE:a.jsx(i.Z,{className:"h-6 w-6"}),PRO:a.jsx(n,{className:"h-6 w-6"}),BUSINESS:a.jsx(o.Z,{className:"h-6 w-6"})};function f({plans:e,currentPlan:t,isLoggedIn:r}){let{t:s,lang:n}=(0,g.Z)(),f="ar"===n,y=[{q:s("pricingFaqQ1"),a:s("pricingFaqA1")},{q:s("pricingFaqQ2"),a:s("pricingFaqA2")},{q:s("pricingFaqQ3"),a:s("pricingFaqA3")}],[b,w]=(0,u.useState)(null);return(0,a.jsxs)(a.Fragment,{children:[a.jsx(h.Navbar,{}),(0,a.jsxs)("div",{className:"min-h-screen bg-[#0a0a0f]",children:[(0,a.jsxs)("section",{className:"relative py-24 overflow-hidden",children:[(0,a.jsxs)("div",{className:"absolute inset-0",children:[a.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-indigo-500/10 rounded-full blur-[120px]"}),a.jsx("div",{className:"absolute top-20 right-1/4 w-[200px] h-[200px] bg-purple-500/8 rounded-full blur-[80px]"})]}),(0,a.jsxs)("div",{className:"relative max-w-5xl mx-auto px-4 text-center",children:[(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full border border-white/[0.08] bg-white/[0.03] text-sm text-gray-400 mb-6",children:[a.jsx(i.Z,{className:"h-3.5 w-3.5 text-indigo-400"}),f?"أسعار شفافة وبسيطة":"Simple, transparent pricing"]}),a.jsx("h1",{className:"text-4xl md:text-6xl font-bold tracking-tight mb-5 bg-gradient-to-b from-white via-white to-gray-500 bg-clip-text text-transparent",children:s("pricingTitle")}),a.jsx("p",{className:"text-lg text-gray-400 max-w-2xl mx-auto leading-relaxed",children:s("pricingSubtitle")})]})]}),a.jsx("section",{className:"max-w-6xl mx-auto px-4 pb-24",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:e.map((e,n)=>{let o=e.name===t,c=f?e.displayName.ar:e.displayName.en;return(0,a.jsxs)("div",{className:`relative rounded-2xl p-8 flex flex-col transition-all duration-300 group ${e.highlighted?"border-2 border-indigo-500/40 bg-gradient-to-b from-indigo-500/[0.08] to-transparent shadow-2xl shadow-indigo-500/10 scale-[1.03] hover:shadow-indigo-500/20":"border border-white/[0.08] bg-white/[0.02] hover:border-white/[0.15] hover:bg-white/[0.04]"}`,children:[e.highlighted&&a.jsx("div",{className:"absolute -top-3.5 left-1/2 -translate-x-1/2 bg-gradient-to-r from-indigo-500 to-purple-600 text-white text-xs font-bold px-5 py-1.5 rounded-full shadow-lg shadow-indigo-500/30",children:s("pricingMostPopular")}),(0,a.jsxs)("div",{className:"mb-8",children:[a.jsx("div",{className:`inline-flex items-center justify-center w-12 h-12 rounded-xl mb-4 ${e.highlighted?"bg-indigo-500/20 text-indigo-400":"bg-white/[0.05] text-gray-400 group-hover:text-white"} transition-colors`,children:x[e.name]||a.jsx(i.Z,{className:"h-6 w-6"})}),a.jsx("h2",{className:"text-xl font-bold text-white mb-1",children:c}),(0,a.jsxs)("div",{className:"mt-4 flex items-baseline gap-1",children:[a.jsx("span",{className:`text-5xl font-extrabold ${e.highlighted?"bg-gradient-to-r from-indigo-400 to-purple-400 bg-clip-text text-transparent":"text-white"}`,children:0===e.price.monthly?f?"مجاني":"Free":`$${e.price.monthly}`}),e.price.monthly>0&&a.jsx("span",{className:"text-gray-500 text-sm",children:s("pricingMonthly")})]}),a.jsx("p",{className:"text-sm text-gray-500 mt-2",children:f?`حتى ${e.pagesLimit} صفحة هبوط`:`Up to ${e.pagesLimit} landing pages`})]}),a.jsx("ul",{className:"space-y-3.5 mb-8 flex-1",children:e.features.map((t,r)=>(0,a.jsxs)("li",{className:"flex items-start gap-2.5 text-sm",children:[a.jsx("div",{className:`rounded-full p-0.5 mt-0.5 ${e.highlighted?"bg-indigo-500/20":"bg-white/[0.06]"}`,children:a.jsx(l.Z,{className:`h-3 w-3 ${e.highlighted?"text-indigo-400":"text-green-400"}`})}),a.jsx("span",{className:"text-gray-300",children:f?t.ar:t.en})]},r))}),a.jsx("div",{children:o?a.jsx("div",{className:"w-full text-center py-3 px-4 rounded-xl bg-white/[0.05] text-gray-500 text-sm font-medium border border-white/[0.06]",children:s("pricingCurrentPlan")}):r?(0,a.jsxs)(p.default,{href:"/settings",className:`w-full block text-center py-3 px-4 rounded-xl text-sm font-medium transition-all ${e.highlighted?"bg-gradient-to-r from-indigo-500 to-purple-600 text-white hover:from-indigo-400 hover:to-purple-500 shadow-lg shadow-indigo-500/25 hover:shadow-indigo-500/40":"border border-white/[0.1] bg-white/[0.04] text-gray-300 hover:bg-white/[0.08] hover:text-white"}`,children:[s("pricingUpgrade")," ",c]}):a.jsx(p.default,{href:"/register",className:`w-full block text-center py-3 px-4 rounded-xl text-sm font-medium transition-all ${e.highlighted?"bg-gradient-to-r from-indigo-500 to-purple-600 text-white hover:from-indigo-400 hover:to-purple-500 shadow-lg shadow-indigo-500/25 hover:shadow-indigo-500/40":"border border-white/[0.1] bg-white/[0.04] text-gray-300 hover:bg-white/[0.08] hover:text-white"}`,children:"FREE"===e.name?s("pricingGetStarted"):`${s("pricingUpgrade")} ${c}`})})]},e.name)})})}),(0,a.jsxs)("section",{className:"relative py-24",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-white/[0.01] to-transparent"}),(0,a.jsxs)("div",{className:"relative max-w-3xl mx-auto px-4",children:[a.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12 bg-gradient-to-b from-white to-gray-400 bg-clip-text text-transparent",children:s("pricingFaq")}),a.jsx("div",{className:"space-y-3",children:y.map((e,t)=>(0,a.jsxs)("div",{className:"border border-white/[0.06] rounded-xl bg-white/[0.02] overflow-hidden transition-all hover:border-white/[0.1]",children:[(0,a.jsxs)("button",{onClick:()=>w(b===t?null:t),className:"w-full flex items-center justify-between px-6 py-5 text-left font-medium text-gray-200 hover:text-white transition-colors",children:[a.jsx("span",{children:e.q}),a.jsx("div",{className:`p-1 rounded-lg transition-all ${b===t?"bg-indigo-500/20 text-indigo-400":"text-gray-600"}`,children:b===t?a.jsx(c,{className:"h-4 w-4 shrink-0"}):a.jsx(d.Z,{className:"h-4 w-4 shrink-0"})})]}),b===t&&a.jsx("div",{className:"px-6 pb-5 text-gray-400 text-sm leading-relaxed",children:e.a})]},t))})]})]}),(0,a.jsxs)("section",{className:"relative py-20",children:[a.jsx("div",{className:"absolute inset-0",children:a.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[200px] bg-indigo-500/8 rounded-full blur-[100px]"})}),(0,a.jsxs)("div",{className:"relative max-w-2xl mx-auto px-4 text-center",children:[a.jsx("h3",{className:"text-2xl md:text-3xl font-bold text-white mb-4",children:f?"جاهز للبدء؟":"Ready to get started?"}),a.jsx("p",{className:"text-gray-400 mb-8",children:f?"ابدأ مجاناً وقم بالترقية في أي وقت":"Start free and upgrade anytime"}),(0,a.jsxs)(p.default,{href:r?"/create":"/register",className:"inline-flex items-center gap-2 px-8 py-3 rounded-xl text-sm font-medium bg-gradient-to-r from-indigo-500 to-purple-600 text-white hover:from-indigo-400 hover:to-purple-500 shadow-lg shadow-indigo-500/25 hover:shadow-indigo-500/40 transition-all",children:[a.jsx(o.Z,{className:"h-4 w-4"}),f?"ابدأ الآن":"Get Started Now"]})]})]})]}),a.jsx(m.Footer,{})]})}},97347:e=>{"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,s={};function n(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean);return`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}; ${r.join("; ")}`}function o(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[a,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(a,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function l(e){var t,r;if(!e)return;let[[a,i],...s]=o(e),{domain:n,expires:l,httponly:p,maxage:u,path:g,samesite:h,secure:m,priority:x}=Object.fromEntries(s.map(([e,t])=>[e.toLowerCase(),t]));return function(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}({name:a,value:decodeURIComponent(i),domain:n,...l&&{expires:new Date(l)},...p&&{httpOnly:!0},..."string"==typeof u&&{maxAge:Number(u)},path:g,...h&&{sameSite:c.includes(t=(t=h).toLowerCase())?t:void 0},...m&&{secure:!0},...x&&{priority:d.includes(r=(r=x).toLowerCase())?r:void 0}})}((e,r)=>{for(var a in r)t(e,a,{get:r[a],enumerable:!0})})(s,{RequestCookies:()=>p,ResponseCookies:()=>u,parseCookie:()=>o,parseSetCookie:()=>l,stringifyCookie:()=>n}),e.exports=((e,s,n,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let n of a(s))i.call(e,n)||void 0===n||t(e,n,{get:()=>s[n],enumerable:!(o=r(s,n))||o.enumerable});return e})(t({},"__esModule",{value:!0}),s);var c=["strict","lax","none"],d=["low","medium","high"],p=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of o(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let a="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===a).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,a=this._parsed;return a.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(a).map(([e,t])=>n(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>n(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},u=class{constructor(e){var t,r,a;this._parsed=new Map,this._headers=e;let i=null!=(a=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?a:[];for(let e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,a,i,s,n=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,s=!1;l();)if(","===(r=e.charAt(o))){for(a=o,o+=1,l(),i=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(s=!0,o=i,n.push(e.substring(t,a)),t=o):o=a+1}else o+=1;(!s||o>=e.length)&&n.push(e.substring(t,e.length))}return n}(i)){let t=l(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let a="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===a)}has(e){return this._parsed.has(e)}set(...e){let[t,r,a]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...a})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=n(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r,a]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:r,domain:a,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(n).join("; ")}}},63608:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RequestCookies:function(){return a.RequestCookies},ResponseCookies:function(){return a.ResponseCookies}});let a=r(97347)},23203:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m,generateMetadata:()=>h});var a=r(25036),i=r(61246),s=r(81355),n=r(82002),o=r(34490),l=r(86843);let c=(0,l.createProxy)(String.raw`C:\test2\pagecraft-ai\src\app\pricing\pricing-client.tsx`),{__esModule:d,$$typeof:p}=c;c.default;let u=(0,l.createProxy)(String.raw`C:\test2\pagecraft-ai\src\app\pricing\pricing-client.tsx#PricingClient`);var g=r(87976);async function h(){return(0,g.Zr)({title:"Pricing — PageCraft AI",description:"Choose the perfect plan for your landing page needs. Free tier available. Professional and enterprise plans for teams.",path:"/pricing"})}async function m(){let e;let t=await (0,s.getServerSession)(n.Lz),r="FREE";if(t?.user?.id)try{let e=await o.prisma.user.findUnique({where:{id:t.user.id},select:{plan:!0}});e&&(r=e.plan)}catch{console.warn("[pricing] DB error fetching user plan, using FREE")}try{let t=await (0,i.B$)();e=Object.values(t)}catch{e=Object.values(i.Xf)}return(0,a.jsxs)(a.Fragment,{children:[a.jsx(g.hg,{data:(0,g.FE)({name:"PageCraft AI",description:"AI-Powered Landing Page Builder",price:0,currency:"USD",features:["AI-powered landing page generation","Bilingual support (Arabic & English)","Multiple professional layouts","Lead capture forms","Blog system"]})}),a.jsx(u,{plans:e,currentPlan:r,isLoggedIn:!!t})]})}},82002:(e,t,r)=>{"use strict";r.d(t,{Lz:()=>u});var a=r(65822),i=r(86485),s=r(10375),n=r(6521),o=r.n(n),l=r(34490),c=r(6632);let d=new Map;async function p(e){let t=await (0,c.FE)("security_config"),r=t?.maxLoginAttempts??5;if(0===r)return;let a=d.get(e);if(a){if(Date.now()-a.lastAttempt>36e5){d.delete(e);return}a.count>=r?await new Promise(e=>setTimeout(e,3e4)):a.count>=Math.floor(r/2)&&await new Promise(e=>setTimeout(e,2e3))}}let u={adapter:(0,a.N)(l.prisma),session:{strategy:"jwt"},pages:{signIn:"/login",newUser:"/dashboard"},providers:[(0,i.Z)({name:"credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},async authorize(e){if(!e?.email||!e?.password)throw Error("Email and password are required");try{var t;await p(e.email);let r=await l.prisma.user.findUnique({where:{email:e.email}});if(!r||!r.password||!await o().compare(e.password,r.password))throw function(e){let t=d.get(e);t?(t.count+=1,t.lastAttempt=Date.now()):d.set(e,{count:1,lastAttempt:Date.now()})}(e.email),Error("Invalid email or password");return t=e.email,d.delete(t),{id:r.id,email:r.email,name:r.name,image:r.image}}catch(e){if(e?.message?.includes("Invalid")||e?.message?.includes("required"))throw e;throw console.error("[auth] DB error during login:",e),Error("Authentication service temporarily unavailable")}}}),...process.env.GOOGLE_CLIENT_ID&&process.env.GOOGLE_CLIENT_SECRET?[(0,s.Z)({clientId:process.env.GOOGLE_CLIENT_ID,clientSecret:process.env.GOOGLE_CLIENT_SECRET})]:[]],callbacks:{session:async({session:e,token:t})=>(t&&e.user&&(e.user.id=t.sub,e.user.role=t.role),e),async jwt({token:e,user:t}){if(t){e.sub=t.id;try{let r=await l.prisma.user.findUnique({where:{id:t.id},select:{role:!0}});e.role=r?.role??null}catch(t){console.warn("[auth] DB error in JWT callback, defaulting role to null"),e.role=null}}return e}}}},61246:(e,t,r)=>{"use strict";r.d(t,{B$:()=>n,B7:()=>i,Xf:()=>a,uo:()=>s});let a={FREE:{name:"FREE",displayName:{en:"Free",ar:"مجاني"},price:{monthly:0,currency:"USD"},pagesLimit:3,leadsEnabled:!1,analyticsEnabled:!0,exportEnabled:!0,customDomainEnabled:!1,regenerateEnabled:!1,highlighted:!1,features:[{en:"3 landing pages",ar:"3 صفحات هبوط"},{en:"AI page generation",ar:"توليد صفحات بالذكاء الاصطناعي"},{en:"Basic analytics",ar:"تحليلات أساسية"},{en:"HTML export",ar:"تصدير HTML"},{en:"PageCraft subdomain",ar:"نطاق فرعي من PageCraft"}]},PRO:{name:"PRO",displayName:{en:"Pro",ar:"برو"},price:{monthly:19,currency:"USD"},pagesLimit:20,leadsEnabled:!0,analyticsEnabled:!0,exportEnabled:!0,customDomainEnabled:!1,regenerateEnabled:!0,highlighted:!0,features:[{en:"20 landing pages",ar:"20 صفحة هبوط"},{en:"AI page generation",ar:"توليد صفحات بالذكاء الاصطناعي"},{en:"Lead capture & inbox",ar:"جمع العملاء المحتملين"},{en:"Advanced analytics",ar:"تحليلات متقدمة"},{en:"HTML export",ar:"تصدير HTML"},{en:"Priority AI generation",ar:"أولوية في التوليد"}]},BUSINESS:{name:"BUSINESS",displayName:{en:"Business",ar:"أعمال"},price:{monthly:49,currency:"USD"},pagesLimit:100,leadsEnabled:!0,analyticsEnabled:!0,exportEnabled:!0,customDomainEnabled:!0,regenerateEnabled:!0,highlighted:!1,features:[{en:"100 landing pages",ar:"100 صفحة هبوط"},{en:"Everything in Pro",ar:"كل مميزات برو"},{en:"Custom domain support",ar:"دعم النطاق المخصص"},{en:"White-label branding",ar:"إزالة شعار PageCraft"},{en:"Team collaboration",ar:"العمل الجماعي"},{en:"Priority support",ar:"دعم أولوية"}]}};function i(e){return a[e].leadsEnabled}function s(e){return a[e].regenerateEnabled}async function n(){try{let{prisma:e}=await Promise.resolve().then(r.bind(r,34490)),t=await e.systemSettings.findUnique({where:{key:"plans_config"}});if(t?.value)return t.value}catch{}return a}},87976:(e,t,r)=>{"use strict";r.d(t,{$2:()=>i,A2:()=>o,A8:()=>n,FE:()=>c,Kj:()=>p,Ut:()=>l,Zr:()=>s,cG:()=>d,hg:()=>u});var a=r(25036);function i(){let e="http://localhost:3000";return e.endsWith("/")?e.slice(0,-1):e}function s(e){let{title:t,description:r,path:a="",image:s,noIndex:n=!1,publishedTime:o,modifiedTime:l,authors:c,type:d="website"}=e,p=i(),u=`${p}${a}`,g=s||`${p}/og-default.svg`,h={title:t,description:r,alternates:{canonical:u,languages:{en:u,ar:u,"x-default":u}},openGraph:{title:t,description:r,url:u,siteName:"PageCraft AI",type:d,locale:"en_US",alternateLocale:["ar_SA"],images:[{url:g,width:1200,height:630,alt:t}]},twitter:{card:"summary_large_image",title:t,description:r,images:[g]}};return"article"===d&&o&&(h.openGraph={...h.openGraph,type:"article",publishedTime:o,modifiedTime:l,authors:c?.map(e=>e.name)}),n&&(h.robots={index:!1,follow:!1}),h}function n(e){let{siteName:t,siteDescription:r,logoUrl:a}=e,s=i();return{"@context":"https://schema.org","@type":"Organization",name:t,description:r,url:s,logo:a||`${s}/logo.png`,sameAs:[]}}function o(e){let{siteName:t,siteDescription:r}=e,a=i();return{"@context":"https://schema.org","@type":"WebSite",name:t,description:r,url:a,potentialAction:{"@type":"SearchAction",target:`${a}/search?q={search_term_string}`,"query-input":"required name=search_term_string"}}}function l(e){let{headline:t,description:r,url:a,image:s,author:n,publishedTime:o,modifiedTime:l,readTime:c}=e,d=i();return{"@context":"https://schema.org","@type":"Article",headline:t,description:r,url:a,image:s||`${d}/og-default.svg`,author:{"@type":"Person",name:n.name,url:n.url},publisher:{"@type":"Organization",name:"PageCraft AI",logo:{"@type":"ImageObject",url:`${d}/logo.png`}},datePublished:o,dateModified:l||o,...c&&{timeRequired:`PT${c}M`}}}function c(e){let{name:t,description:r,price:a,currency:s,features:n,image:o}=e,l=i();return{"@context":"https://schema.org","@type":"Product",name:t,description:r,image:o||`${l}/og-default.svg`,offers:{"@type":"Offer",price:a,priceCurrency:s,availability:"https://schema.org/InStock"},...n&&{additionalProperty:n.map(e=>({"@type":"PropertyValue",name:"Feature",value:e}))}}}function d(e){let{name:t,description:r,url:a}=e;return{"@context":"https://schema.org","@type":"WebPage",name:t,description:r,url:a}}function p(){let e=i();return{"@context":"https://schema.org","@type":"ContactPage",name:"Contact Us",description:"Get in touch with the PageCraft AI team",url:`${e}/contact`}}function u({data:e}){return a.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})}}};var t=require("../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[1638,6521,244,5312,6632,3910],()=>r(17589));module.exports=a})();