"use strict";(()=>{var e={};e.id=4783,e.ids=[4783],e.modules={1708:e=>{e.exports=require("node:process")},3295:e=>{e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:e=>{e.exports=require("node:buffer")},10846:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11723:e=>{e.exports=require("querystring")},11997:e=>{e.exports=require("punycode")},12412:e=>{e.exports=require("assert")},16141:e=>{e.exports=require("node:zlib")},21820:e=>{e.exports=require("os")},27910:e=>{e.exports=require("stream")},28354:e=>{e.exports=require("util")},29021:e=>{e.exports=require("fs")},29294:e=>{e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29706:(e,r,t)=>{t.d(r,{nE:()=>i,z$:()=>a});var s=t(63095),o=t(39300),n=t(94634);async function i(e){let r=await (0,s.A)().select().from(o.options).where((0,n.eq)(o.options.optionName,e));return Object.keys(r).length>0?r[0].optionValue:(await a(e,""),null)}async function a(e,r){"boolean"==typeof r&&(r=r?"1":" 0"),0==Object.keys(await (0,s.A)().select().from(o.options).where((0,n.eq)(o.options.optionName,e))).length?await (0,s.A)().insert(o.options).values({optionName:e,optionValue:r}):await (0,s.A)().update(o.options).set({optionValue:r}).where((0,n.eq)(o.options.optionName,e))}},33873:e=>{e.exports=require("path")},34631:e=>{e.exports=require("tls")},37067:e=>{e.exports=require("node:http")},37830:e=>{e.exports=require("node:stream/web")},44708:e=>{e.exports=require("node:https")},44870:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},51455:e=>{e.exports=require("node:fs/promises")},55511:e=>{e.exports=require("crypto")},55591:e=>{e.exports=require("https")},57075:e=>{e.exports=require("node:stream")},57975:e=>{e.exports=require("node:util")},63033:e=>{e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:e=>{e.exports=require("node:fs")},73136:e=>{e.exports=require("node:url")},73566:e=>{e.exports=require("worker_threads")},74075:e=>{e.exports=require("zlib")},76760:e=>{e.exports=require("node:path")},77030:e=>{e.exports=require("node:net")},78474:e=>{e.exports=require("node:events")},79428:e=>{e.exports=require("buffer")},79551:e=>{e.exports=require("url")},79646:e=>{e.exports=require("child_process")},81630:e=>{e.exports=require("http")},81636:(e,r,t)=>{t.r(r),t.d(r,{patchFetch:()=>y,routeModule:()=>d,serverHooks:()=>q,workAsyncStorage:()=>l,workUnitAsyncStorage:()=>x});var s={};t.r(s),t.d(s,{POST:()=>c});var o=t(96559),n=t(48088),i=t(37719),a=t(32190),u=t(29706),p=t(24271);async function c(e){let r=!1;if("1"!=(r=await (0,u.nE)("enableSync")))return a.NextResponse.json({data:!1,success:!1,msg:"Sync is not enabled."});if(r){let e=await (0,u.nE)("webdavURL");if(""==e||null==e)return a.NextResponse.json({data:!0,success:!1,msg:"WebDAV is not configured. If you want to synchronize data among different devices, you can configure WebDAV in sync page. To disable this message showing up, you can disable sync."});let r=await (0,p.xm)();if(null==r)return a.NextResponse.json({data:!0,success:!1,msg:"WebDAV settings are empty! Please first configure your WebDAV."});if(!await (0,p.SA)(r))return a.NextResponse.json({data:!0,success:!1,msg:"WebDAV connection failed! If you have unsynchronized data on other device, please first configure your WebDAV and sync your data."});let t=await (0,p.q5)(r,"TimyNote-sync/sync.json");try{return await (0,p.xv)(),a.NextResponse.json({data:t,success:!0,msg:"Data synced successfully!"})}catch(e){return a.NextResponse.json({data:t??null,success:!1,msg:e})}}}let d=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/[locale]/api/sync/init-sync/route",pathname:"/[locale]/api/sync/init-sync",filename:"route",bundlePath:"app/[locale]/api/sync/init-sync/route"},resolvedPagePath:"E:\\xampp01\\htdocs\\wx-saas\\timynote\\app\\[locale]\\api\\sync\\init-sync\\route.tsx",nextConfigOutput:"standalone",userland:s}),{workAsyncStorage:l,workUnitAsyncStorage:x,serverHooks:q}=d;function y(){return(0,i.patchFetch)({workAsyncStorage:l,workUnitAsyncStorage:x})}},83997:e=>{e.exports=require("tty")},87550:e=>{e.exports=require("better-sqlite3")},91645:e=>{e.exports=require("net")},94735:e=>{e.exports=require("events")}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[4447,580,902,588,5903,3612,6907],()=>t(81636));module.exports=s})();