"use strict";(()=>{var a={};a.id=4,a.ids=[4],a.modules={14217:a=>{a.exports=require("cheerio")},19362:a=>{a.exports=require("@kamilmielnik/trie")},21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},31097:a=>{a.exports=require("follow-redirects")},33873:a=>{a.exports=require("path")},42029:a=>{a.exports=require("unzipper")},55124:a=>{a.exports=require("winston")},55511:a=>{a.exports=require("crypto")},66605:a=>{a.exports=require("transliteration")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},79551:a=>{a.exports=require("url")},88437:(a,b,c)=>{c.r(b),c.d(b,{config:()=>s,default:()=>r,handler:()=>u});var d={};c.r(d),c.d(d,{config:()=>m,default:()=>n});var e=c(61223),f=c(74600),g=c(4409),h=c(46440),i=c(77715),j=c(57519),k=c(29562),l=c(75494);let m={api:{responseLimit:"25mb"}},n=async(a,b)=>{let c=(0,l.T)(a);try{let{locale:d}=(a=>{let{locale:b}=a.query;if(!(0,k.isLocale)(b))throw Error('Invalid "locale" parameter');return{locale:b}})(a);j.logger.info("dictionary - request",{meta:c,payload:{locale:d}});let e=await i.dictionaries.get(d);b.status(200).send(e.serialize())}catch(d){let a=d instanceof Error?d.message:"Unknown error";j.logger.error("dictionary - error",{error:d,meta:c}),b.status(500).send({error:"Server error",message:a})}};var o=c(49275),p=c(30879),q=c(53373);let r=(0,h.M)(d,"default"),s=(0,h.M)(d,"config"),t=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/dictionary/[locale]",pathname:"/api/dictionary/[locale]",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function u(a,b,c){c.requestMeta&&(0,q.setRequestMeta)(a,c.requestMeta),t.isDev&&(0,q.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/dictionary/[locale]",f=await t.prepare(a,b,{srcPage:d});if(!f){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:g,params:h,prerenderManifest:i,routerServerContext:j}=f;try{let c,e=a.method||"GET",f=(0,o.getTracer)(),k=f.getActiveScopeSpan(),l=!!(null==j?void 0:j.isWrappedByNextServer),m=t.instrumentationOnRequestError.bind(t),n=async k=>t.render(a,b,{query:{...g,...h},params:h,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:i.preview,propagateError:!1,dev:t.isDev,page:"/api/dictionary/[locale]",internalRevalidate:null==j?void 0:j.revalidate,onError:(...b)=>m(a,...b)}).finally(()=>{if(!k)return;k.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=f.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=a.get("next.route");if(g){let a=`${e} ${g}`;k.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),k.updateName(a),c&&c!==k&&(c.setAttribute("http.route",g),c.updateName(a))}else k.updateName(`${e} ${d}`)});l&&k?await n(k):(c=f.getActiveScopeSpan(),await f.withPropagatedContext(a.headers,()=>f.trace(p.BaseServerSpan.handleRequest,{spanName:`${e} ${d}`,kind:o.SpanKind.SERVER,attributes:{"http.method":e,"http.target":a.url}},n),void 0,!l))}catch(a){if(t.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[671,392],()=>b(b.s=88437));module.exports=c})();