(()=>{var a={};a.id=234,a.ids=[234],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},41393:(a,b,c)=>{"use strict";c.r(b),c.d(b,{profiles:()=>h});var d=c(12873),e=c(58040),f=c(20377),g=c(85766);let h=(0,d.D)("profiles",{id:(0,e.Qq)("id").primaryKey().$defaultFn(()=>crypto.randomUUID()),slug:(0,e.Qq)("slug").notNull().unique(),name:(0,e.Qq)("name").notNull(),title:(0,e.Qq)("title"),company:(0,e.Qq)("company"),photoUrl:(0,e.Qq)("photo_url"),workPhone:(0,e.Qq)("work_phone"),personalPhone:(0,e.Qq)("personal_phone"),whatsapp:(0,e.Qq)("whatsapp"),email:(0,e.Qq)("email"),website:(0,e.Qq)("website"),address:(0,e.Qq)("address"),instagram:(0,e.Qq)("instagram"),facebook:(0,e.Qq)("facebook"),linkedin:(0,e.Qq)("linkedin"),twitter:(0,e.Qq)("twitter"),threads:(0,e.Qq)("threads"),customLink1Title:(0,e.Qq)("custom_link_1_title"),customLink1Url:(0,e.Qq)("custom_link_1_url"),customLink2Title:(0,e.Qq)("custom_link_2_title"),customLink2Url:(0,e.Qq)("custom_link_2_url"),customLink3Title:(0,e.Qq)("custom_link_3_title"),customLink3Url:(0,e.Qq)("custom_link_3_url"),customLink4Title:(0,e.Qq)("custom_link_4_title"),customLink4Url:(0,e.Qq)("custom_link_4_url"),wifiSsid:(0,e.Qq)("wifi_ssid"),wifiPassword:(0,e.Qq)("wifi_password"),createdAt:(0,f.nd)("created_at",{mode:"timestamp"}).default((0,g.ll)`(strftime('%s', 'now'))`)})},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},92979:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{GET:()=>x});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(97356),v=c(85766),w=c(10641);async function x(){let a=(0,u.L)();try{return await a.run((0,v.ll)`DROP TABLE IF EXISTS "profiles";`),await a.run((0,v.ll)`
      CREATE TABLE "profiles" (
        "id" text PRIMARY KEY NOT NULL,
        "slug" text NOT NULL,
        "name" text NOT NULL,
        "title" text,
        "company" text,
        "photo_url" text,
        
        "work_phone" text,
        "personal_phone" text,
        "whatsapp" text,
        "email" text,
        "website" text,
        "address" text,
        
        "instagram" text,
        "facebook" text,
        "linkedin" text,
        "twitter" text,
        "threads" text,

        "custom_link_1_title" text,
        "custom_link_1_url" text,
        "custom_link_2_title" text,
        "custom_link_2_url" text,
        "custom_link_3_title" text,
        "custom_link_3_url" text,
        "custom_link_4_title" text,
        "custom_link_4_url" text,

        "wifi_ssid" text,
        "wifi_password" text,

        "created_at" integer DEFAULT (strftime('%s', 'now'))
      );
    `),await a.run((0,v.ll)`CREATE UNIQUE INDEX "profiles_slug_unique" ON "profiles" ("slug");`),w.NextResponse.json({success:!0,message:"Tablo başarıyla oluşturuldu."})}catch(a){return w.NextResponse.json({success:!1,error:a.message})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/admin/init-db/route",pathname:"/admin/init-db",filename:"route",bundlePath:"app/admin/init-db/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"C:\\Users\\berke\\Desktop\\NFC BASKI\\Web Sitesi\\app\\admin\\init-db\\route.ts",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){var d;let e="/admin/init-db/route";"/index"===e&&(e="/");let g=await y.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D}=g,E=(0,j.normalizeAppPath)(e),F=!!(z.dynamicRoutes[E]||z.routes[D]);if(F&&!x){let a=!!z.routes[D],b=z.dynamicRoutes[E];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let G=null;!F||y.isDev||x||(G="/index"===(G=D)?"/":G);let H=!0===y.isDev||!F,I=F&&!H,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:z,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:H,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>y.onRequestError(a,b,d,A)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>y.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!F)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})},A),b}},l=await y.handleResponse({req:a,nextConfig:w,cacheKey:G,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:k,waitUntil:c.waitUntil});if(!F)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",B?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&F||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:B})}),F)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},96487:()=>{},97356:(a,b,c)=>{"use strict";c.d(b,{L:()=>k});var d=c(87550),e=c.n(d),f=c(46098),g=c(41393),h=c(33873),i=c(29021);let j=null;function k(){if(j)return j;let a=(0,h.join)(process.cwd(),"data");try{(0,i.mkdirSync)(a,{recursive:!0})}catch{}let b=(0,h.join)(a,"nfc-profiles.db"),c=new(e())(b);return c.pragma("journal_mode = WAL"),c.exec(`
    CREATE TABLE IF NOT EXISTS profiles (
      id TEXT PRIMARY KEY,
      slug TEXT NOT NULL UNIQUE,
      name TEXT NOT NULL,
      title TEXT,
      company TEXT,
      photo_url TEXT,
      work_phone TEXT,
      personal_phone TEXT,
      whatsapp TEXT,
      email TEXT,
      website TEXT,
      address TEXT,
      instagram TEXT,
      facebook TEXT,
      linkedin TEXT,
      twitter TEXT,
      threads TEXT,
      custom_link_1_title TEXT,
      custom_link_1_url TEXT,
      custom_link_2_title TEXT,
      custom_link_2_url TEXT,
      custom_link_3_title TEXT,
      custom_link_3_url TEXT,
      custom_link_4_title TEXT,
      custom_link_4_url TEXT,
      wifi_ssid TEXT,
      wifi_password TEXT,
      created_at INTEGER DEFAULT (strftime('%s', 'now'))
    )
  `),j=(0,f.f)(c,{schema:g})}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[331,692,98],()=>b(b.s=92979));module.exports=c})();