exports.id=9579,exports.ids=[1960,9579],exports.modules={29579:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{runServerAction:()=>m});var e=c(75919),f=c(76760),g=c.n(f),h=c(73136),i=c(47300),j=c(62485),k=c(25475),l=a([i,j]);async function m(a){let b=(0,i.actionBundlePath)(a.utility.dir,a.action.name),c=(0,h.pathToFileURL)(b).toString(),d=function(){let a="lib/server/utilities/worker-bootstrap.js",b=process.env.REFLEX_PKG_ROOT;if(b)return g().resolve(b,a);let c=null;try{c=95679}catch{}return"string"==typeof c&&g().isAbsolute(c)?c:g().resolve(process.cwd(),a)}();return new Promise((b,f)=>{let g=new e.Worker(d,{workerData:{bundleUrl:c,actionName:a.action.name,utilityId:a.utility.manifest.id,scope:a.utility.scope},env:{},eval:!1,resourceLimits:{maxOldGenerationSizeMb:256,maxYoungGenerationSizeMb:64}}),h=!1,i=(c,d,e)=>{h||(h=!0,clearTimeout(l),g.removeAllListeners(),g.terminate().catch(()=>{}),c?((0,k.u0)({ts:new Date().toISOString(),utilityId:a.utility.manifest.id,scope:a.utility.scope,channel:"worker",method:`action:${a.action.name}`,phase:"end",correlationId:a.parentCorrelationId??"(detached)",error:e??c.message}),f(c)):b(d))},l=setTimeout(()=>{i(Error("server action timed out"),void 0,"timeout")},a.action.timeoutMs);g.on("error",a=>i(a)),g.on("exit",a=>{0!==a&&i(Error(`worker exited with code ${a}`))}),g.on("message",async b=>{if(b&&"object"==typeof b){if("host-rpc"===b.type){let c=b.id,d=b.method,e=b.args;try{let b=await (0,j.p)({utility:a.utility,channel:"worker",...a.parentCorrelationId?{parentCorrelationId:a.parentCorrelationId}:{}},d,e);g.postMessage({type:"host-rpc-result",id:c,ok:!0,result:b})}catch(a){g.postMessage({type:"host-rpc-result",id:c,ok:!1,error:a instanceof Error?a.message:String(a)})}return}"invoke-result"===b.type&&(b.ok?i(null,b.result):i(Error(b.error||"server action failed")))}}),g.postMessage({type:"invoke",args:a.args})})}[i,j]=l.then?(await l)():l,d()}catch(a){d(a)}})},46735:a=>{function b(a){return Promise.resolve().then(()=>{var b=Error("Cannot find module '"+a+"'");throw b.code="MODULE_NOT_FOUND",b})}b.keys=()=>[],b.resolve=b,b.id=46735,a.exports=b},95679:(a,b,c)=>{"use strict";var d=c(75919);if(!d.parentPort)throw Error("worker-bootstrap.js must be loaded as a worker_threads child");let e=new Map,f=1,g=new Proxy({},{get(a,b){if("string"==typeof b)return function a(b){return new Proxy(function(){},{get(c,d){if("string"==typeof d&&"then"!==d&&"catch"!==d&&"finally"!==d)return a(b?`${b}.${d}`:d)},apply:(a,c,g)=>{var h;return h=g[0],new Promise((a,c)=>{let g=f++;e.set(g,{resolve:a,reject:c}),d.parentPort.postMessage({type:"host-rpc",id:g,method:b,args:h})})}})}(b)}});globalThis.__reflexHost=g,d.parentPort.on("message",async a=>{if(a&&"host-rpc-result"===a.type){let b=e.get(a.id);if(!b)return;e.delete(a.id),a.ok?b.resolve(a.result):b.reject(Error(a.error||"rpc failed"));return}if(a&&"invoke"===a.type)try{let b=await c(46735)(d.workerData.bundleUrl),e=b[d.workerData.actionName]??b.default;if("function"!=typeof e)throw Error(`action "${d.workerData.actionName}" must export a function (named export or default)`);let f=await e(a.args,g);d.parentPort.postMessage({type:"invoke-result",ok:!0,result:f})}catch(a){d.parentPort.postMessage({type:"invoke-result",ok:!1,error:a&&a.message?a.message:String(a)})}})}};