@zuplo/core 6.59.37 → 6.59.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -650,7 +650,7 @@ export default {
650
650
  ${s}`,"wrappedToString"),M4r=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),j4r=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),B4r=t((a,s,c)=>{let _=c===""?"":`with ${c.trim()}() `,m=R4r.bind(null,_,s.toString());Object.defineProperty(m,"name",j4r),Object.defineProperty(a,"toString",{...M4r,value:m})},"changeToString");function FRe(a,s,{ignoreNonConfigurable:c=!1}={}){let{name:_}=a;for(let m of Reflect.ownKeys(s))O4r(a,s,m,c);return L4r(a,s),B4r(a,s,_),a}t(FRe,"mimicFunction");var Qde=new WeakMap,yEt=t((a,s={})=>{if(typeof a!="function")throw new TypeError("Expected a function");let c,_=0,m=a.displayName||a.name||"<anonymous>",v=t(function(...w){if(Qde.set(v,++_),_===1)c=a.apply(this,w),a=null;else if(s.throw===!0)throw new Error(`Function \`${m}\` can only be called once`);return c},"onetime");return FRe(v,a),Qde.set(v,_),v},"onetime");yEt.callCount=a=>{if(!Qde.has(a))throw new Error(`The given function \`${a.name}\` is not wrapped by the \`onetime\` package`);return Qde.get(a)};var vEt=yEt;import{constants as J4r}from"os";var bEt=t(function(){let a=LRe-SEt+1;return Array.from({length:a},U4r)},"getRealtimeSignals"),U4r=t(function(a,s){return{name:`SIGRT${s+1}`,number:SEt+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),SEt=34,LRe=64;import{constants as $4r}from"os";var TEt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var RRe=t(function(){let a=bEt();return[...TEt,...a].map(z4r)},"getSignals"),z4r=t(function({name:a,number:s,description:c,action:_,forced:m=!1,standard:v}){let{signals:{[a]:w}}=$4r,A=w!==void 0;return{name:a,number:A?w:s,description:c,supported:A,action:_,forced:m,standard:v}},"normalizeSignal");var q4r=t(function(){return RRe().reduce(V4r,{})},"getSignalsByName"),V4r=t(function(a,{name:s,number:c,description:_,supported:m,action:v,forced:w,standard:A}){return{...a,[s]:{name:s,number:c,description:_,supported:m,action:v,forced:w,standard:A}}},"getSignalByName"),xEt=q4r(),W4r=t(function(){let a=RRe(),s=LRe+1,c=Array.from({length:s},(_,m)=>H4r(m,a));return Object.assign({},...c)},"getSignalsByNumber"),H4r=t(function(a,s){let c=G4r(a,s);if(c===void 0)return{};let{name:_,description:m,supported:v,action:w,forced:A,standard:M}=c;return{[a]:{name:_,number:a,description:m,supported:v,action:w,forced:A,standard:M}}},"getSignalByNumber"),G4r=t(function(a,s){let c=s.find(({name:_})=>J4r.signals[_]===a);return c!==void 0?c:s.find(_=>_.number===a)},"findSignalByNumber"),nrn=W4r();var K4r=t(({timedOut:a,timeout:s,errorCode:c,signal:_,signalDescription:m,exitCode:v,isCanceled:w})=>a?`timed out after ${s} milliseconds`:w?"was canceled":c!==void 0?`failed with ${c}`:_!==void 0?`was killed with ${_} (${m})`:v!==void 0?`failed with exit code ${v}`:"failed","getErrorPrefix"),MRe=t(({stdout:a,stderr:s,all:c,error:_,signal:m,exitCode:v,command:w,escapedCommand:A,timedOut:M,isCanceled:$,killed:re,parsed:{options:{timeout:ie}}})=>{v=v===null?void 0:v,m=m===null?void 0:m;let X=m===void 0?void 0:xEt[m].description,Re=_&&_.code,De=`Command ${K4r({timedOut:M,timeout:ie,errorCode:Re,signal:m,signalDescription:X,exitCode:v,isCanceled:$})}: ${w}`,Et=Object.prototype.toString.call(_)==="[object Error]",vt=Et?`${De}
651
651
  ${_.message}`:De,yr=[vt,s,a].filter(Boolean).join(`
652
652
  `);return Et?(_.originalMessage=_.message,_.message=yr):_=new Error(yr),_.shortMessage=vt,_.command=w,_.escapedCommand=A,_.exitCode=v,_.signal=m,_.signalDescription=X,_.stdout=a,_.stderr=s,c!==void 0&&(_.all=c),"bufferedData"in _&&delete _.bufferedData,_.failed=!0,_.timedOut=!!M,_.isCanceled=$,_.killed=re&&!M,_},"makeError");var eme=["stdin","stdout","stderr"],Y4r=t(a=>eme.some(s=>a[s]!==void 0),"hasAlias"),EEt=t(a=>{if(!a)return;let{stdio:s}=a;if(s===void 0)return eme.map(_=>a[_]);if(Y4r(a))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${eme.map(_=>`\`${_}\``).join(", ")}`);if(typeof s=="string")return s;if(!Array.isArray(s))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``);let c=Math.max(s.length,eme.length);return Array.from({length:c},(_,m)=>s[m])},"normalizeStdio");var NEt=zp(AEt(),1);import X4r from"node:os";var Z4r=1e3*5,IEt=t((a,s="SIGTERM",c={})=>{let _=a(s);return Q4r(a,s,c,_),_},"spawnedKill"),Q4r=t((a,s,c,_)=>{if(!e3r(s,c,_))return;let m=r3r(c),v=setTimeout(()=>{a("SIGKILL")},m);v.unref&&v.unref()},"setKillTimeout"),e3r=t((a,{forceKillAfterTimeout:s},c)=>t3r(a)&&s!==!1&&c,"shouldForceKill"),t3r=t(a=>a===X4r.constants.signals.SIGTERM||typeof a=="string"&&a.toUpperCase()==="SIGTERM","isSigterm"),r3r=t(({forceKillAfterTimeout:a=!0})=>{if(a===!0)return Z4r;if(!Number.isFinite(a)||a<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${a}\` (${typeof a})`);return a},"getForceKillAfterTimeout"),OEt=t((a,s)=>{a.kill()&&(s.isCanceled=!0)},"spawnedCancel"),n3r=t((a,s,c)=>{a.kill(s),c(Object.assign(new Error("Timed out"),{timedOut:!0,signal:s}))},"timeoutKill"),FEt=t((a,{timeout:s,killSignal:c="SIGTERM"},_)=>{if(s===0||s===void 0)return _;let m,v=new Promise((A,M)=>{m=setTimeout(()=>{n3r(a,c,M)},s)}),w=_.finally(()=>{clearTimeout(m)});return Promise.race([v,w])},"setupTimeout"),LEt=t(({timeout:a})=>{if(a!==void 0&&(!Number.isFinite(a)||a<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${a}\` (${typeof a})`)},"validateTimeout"),REt=t(async(a,{cleanup:s,detached:c},_)=>{if(!s||c)return _;let m=(0,NEt.default)(()=>{a.kill()});return _.finally(()=>{m()})},"setExitHandler");function MEt(a){return a!==null&&typeof a=="object"&&typeof a.pipe=="function"}t(MEt,"isStream");var JRe=zp(UEt(),1),JEt=zp(zEt(),1);var qEt=t((a,s)=>{s===void 0||a.stdin===void 0||(MEt(s)?s.pipe(a.stdin):a.stdin.end(s))},"handleInput"),VEt=t((a,{all:s})=>{if(!s||!a.stdout&&!a.stderr)return;let c=(0,JEt.default)();return a.stdout&&c.add(a.stdout),a.stderr&&c.add(a.stderr),c},"makeAllStream"),$Re=t(async(a,s)=>{if(a){a.destroy();try{return await s}catch(c){return c.bufferedData}}},"getBufferedData"),zRe=t((a,{encoding:s,buffer:c,maxBuffer:_})=>{if(!(!a||!c))return s?(0,JRe.default)(a,{encoding:s,maxBuffer:_}):JRe.default.buffer(a,{maxBuffer:_})},"getStreamPromise"),WEt=t(async({stdout:a,stderr:s,all:c},{encoding:_,buffer:m,maxBuffer:v},w)=>{let A=zRe(a,{encoding:_,buffer:m,maxBuffer:v}),M=zRe(s,{encoding:_,buffer:m,maxBuffer:v}),$=zRe(c,{encoding:_,buffer:m,maxBuffer:v*2});try{return await Promise.all([w,A,M,$])}catch(re){return Promise.all([{error:re,signal:re.signal,timedOut:re.timedOut},$Re(a,A),$Re(s,M),$Re(c,$)])}},"getSpawnedResult");var f3r=(async()=>{})().constructor.prototype,_3r=["then","catch","finally"].map(a=>[a,Reflect.getOwnPropertyDescriptor(f3r,a)]),qRe=t((a,s)=>{for(let[c,_]of _3r){let m=typeof s=="function"?(...v)=>Reflect.apply(_.value,s(),v):_.value.bind(s);Reflect.defineProperty(a,c,{..._,value:m})}return a},"mergePromise"),HEt=t(a=>new Promise((s,c)=>{a.on("exit",(_,m)=>{s({exitCode:_,signal:m})}),a.on("error",_=>{c(_)}),a.stdin&&a.stdin.on("error",_=>{c(_)})}),"getSpawnedPromise");var GEt=t((a,s=[])=>Array.isArray(s)?[a,...s]:[a],"normalizeArgs"),p3r=/^[\w.-]+$/,d3r=/"/g,m3r=t(a=>typeof a!="string"||p3r.test(a)?a:`"${a.replace(d3r,'\\"')}"`,"escapeArg"),KEt=t((a,s)=>GEt(a,s).join(" "),"joinCommand"),YEt=t((a,s)=>GEt(a,s).map(c=>m3r(c)).join(" "),"getEscapedCommand");var y3r=1e3*1e3*100,v3r=t(({env:a,extendEnv:s,preferLocal:c,localDir:_,execPath:m})=>{let v=s?{...ame.env,...a}:a;return c?gEt({env:v,cwd:_,execPath:m}):v},"getEnv"),b3r=t((a,s,c={})=>{let _=ZEt.default._parse(a,s,c);return a=_.command,s=_.args,c=_.options,c={maxBuffer:y3r,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:c.cwd||ame.cwd(),execPath:ame.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...c},c.env=v3r(c),c.stdio=EEt(c),ame.platform==="win32"&&g3r.basename(a,".exe")==="cmd"&&s.unshift("/q"),{file:a,args:s,options:c,parsed:_}},"handleArguments"),VRe=t((a,s,c)=>typeof s!="string"&&!h3r.isBuffer(s)?c===void 0?void 0:"":a.stripFinalNewline?ORe(s):s,"handleOutput");function QEt(a,s,c){let _=b3r(a,s,c),m=KEt(a,s),v=YEt(a,s);LEt(_.options);let w;try{w=XEt.spawn(_.file,_.args,_.options)}catch(Re){let Ne=new XEt.ChildProcess,De=Promise.reject(MRe({error:Re,stdout:"",stderr:"",all:"",command:m,escapedCommand:v,parsed:_,timedOut:!1,isCanceled:!1,killed:!1}));return qRe(Ne,De)}let A=HEt(w),M=FEt(w,_.options,A),$=REt(w,_.options,M),re={isCanceled:!1};w.kill=IEt.bind(null,w.kill.bind(w)),w.cancel=OEt.bind(null,w,re);let X=vEt(t(async()=>{let[{error:Re,exitCode:Ne,signal:De,timedOut:Et},vt,yr,sn]=await WEt(w,_.options,$),Zr=VRe(_.options,vt),an=VRe(_.options,yr),xr=VRe(_.options,sn);if(Re||Ne!==0||De!==null){let br=MRe({error:Re,exitCode:Ne,signal:De,stdout:Zr,stderr:an,all:xr,command:m,escapedCommand:v,parsed:_,timedOut:Et,isCanceled:re.isCanceled||(_.options.signal?_.options.signal.aborted:!1),killed:w.killed});if(!_.options.reject)return br;throw br}return{command:m,escapedCommand:v,exitCode:0,stdout:Zr,stderr:an,all:xr,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},"handlePromise"));return qEt(w,_.options.input),w.all=VEt(w,_.options),qRe(w,X)}t(QEt,"execa");async function cme(a,s){if(a.__ZUPLO_LOG_LEVEL=process.env.__ZUPLO_LOG_LEVEL??process.env.LOG_LEVEL,a.__ZUPLO_LOG_FORMAT=process.env.__ZUPLO_LOG_FORMAT??process.env.LOG_FORMAT,a.LOG_LEVEL=process.env.LOG_LEVEL??process.env.LOG_LEVEL,a.LOG_FORMAT=process.env.LOG_FORMAT??process.env.LOG_FORMAT,a.GIT_SHA=process.env.GIT_SHA??await S3r(s),process.env.__ZUPLO_CONFIG&&(a.__ZUPLO_CONFIG=process.env.__ZUPLO_CONFIG),eCt(ome.join(s,".env.zuplo"))){let c=tCt(ome.join(s,".env.zuplo"),"utf8"),_=WRe.default.parse(c);for(let m of Object.keys(_))if(a[m]=_[m],m==="ZUPLO_SYSTEM_CONFIGURATIONS"){let v=Buffer.from(efe.decode(_[m])).toString(),w=JSON.parse(v);for(let A of Object.keys(w))a[A]=w[A]}}if(eCt(ome.join(s,".env"))){let c=tCt(ome.join(s,".env"),"utf8"),_=WRe.default.parse(c);for(let m of Object.keys(_))a[m]=_[m]}for(let c of Object.keys(a))a[c]===void 0&&delete a[c];return a}t(cme,"setEnvironment");async function S3r(a){let s="unknown";try{let{stdout:c}=await QEt("git",["rev-parse","HEAD"],{cwd:a});c.trim().length===40&&(s=c.trim())}catch{}return s}t(S3r,"getGitSha");async function C3r({buildId:a,output:s,sourceDirectory:c,bundledDir:_,port:m,binaryName:v,publicZuploEnvironmentVariables:w,logger:A,handleRuntimeStdio:M}){if(_){let re=sX.join(c,_,"modules.json");if(!T3r(re))throw new Error("The bundled-dir does not contain a modules.json file.");let ie=await E3r(re,"utf-8").then(JSON.parse),X=await BB(c);return X.status===OA?new Promise((Re,Ne)=>{$(X.config.compatibilityDate,sX.join(c,_),ie,Re,M)().catch(De=>{A.error(De),Ne(De)})}):(A.warn("Failed to get Zuplo config. Using default compatibility date."),new Promise((Re,Ne)=>{$(void 0,c,ie,Re,M)().catch(De=>{A.error(De),Ne(De)})}))}else{let re=new W4({buildId:a,output:s,sourceDirectory:c,command:"dev",logger:A,publicZuploEnvironmentVariables:w??{ZUPLO_ENVIRONMENT_TYPE:"LOCAL_DEVELOPMENT"},urls:void 0});try{await re.start()}catch{A.info("Ran into irrecoverable error while building. Fix the error and rerun the command."),process.exit(1)}return new Promise((ie,X)=>{re.onReload((Re,Ne)=>{(Ne||Re&&Re.errors&&Re.errors.length>0)&&X(Ne??Re?.errors),$(Re?.compatibilityDate,sX.join(c,"dist"),jB(c,Re?.metafile),ie,M)().catch(De=>{A.error(De),X(De)})})})}function $(re,ie,X,Re,Ne){return async()=>{let De={};await cme(De,c);let Et=new rCt.ZuploWorkerd({compatibilityDate:re,scriptDirectory:ie,modules:X,port:m??dh.DEV_SERVER_PORT,bindings:De,handleRuntimeStdio:Ne}),vt=v??"compiled-zup",yr=sX.join(c,"dist");await x3r(yr,{recursive:!0}),await Et.compileBinary({binaryPath:sX.join(c,"dist",vt)}),await Et.dispose(),Re(void 0)}}t($,"compile")}t(C3r,"compileWorkerdServer");var nCt=zp(bRe(),1);import k3r from"node:path";import w3r from"node:net";function aX(a,s){return new Promise(c=>{let _=new w3r.Socket;_.connect(s,a),_.on("connect",()=>{_.destroy(),c(!1)}),_.on("error",()=>{_.destroy(),c(!0)})})}t(aX,"isPortAvailable");var lme=class{static{t(this,"WorkerdServer")}sourceDirectory;port;debugPort;buildWatcher;workerd;logger;output;handleRuntimeStdio;onReload;constructor(s){if(this.sourceDirectory=s.sourceDirectory,this.port=s.port??dh.DEV_SERVER_PORT,this.debugPort=s.debugPort,this.logger=s.logger,this.output=s.output,this.handleRuntimeStdio=s.handleRuntimeStdio,this.onReload=s.onReload,!s.zupTestMode){let c="http://localhost:3000",_=`http://localhost:${this.port}`;this.buildWatcher=new W4({...s,logger:this.logger,publicZuploEnvironmentVariables:{...s.publicZuploEnvironmentVariables,ZUPLO_ENVIRONMENT_TYPE:"LOCAL_DEVELOPMENT"},urls:{devPortal:{defaultUrl:c,urls:[c]},api:{defaultUrl:_,urls:[_]}}}),this.buildWatcher.watchEnvFiles()}}async start(){if(!await aX("localhost",this.port))throw new Error(`Port ${this.port} is currently in use. Please use a different port.`);if(this.buildWatcher)try{await this.buildWatcher.start()}catch(c){this.output.child("api").error(c.toString());let _="Ran into irrecoverable error while starting watcher. Fix the error and restart the server.";this.output.child("api").error(_),this.logger?.info(_),process.exit(1)}this.buildWatcher?.onReload((c,_)=>{_||c&&c.errors&&c.errors.length>0||(this.onReload(c,_),this.startOrReload(c).catch(m=>{this.output.child("api").error(m.toString()),this.logger?.error(m)}))})}async startOrReload(s){try{let c={};await cme(c,this.sourceDirectory),await this.workerd?.dispose(),this.workerd=new nCt.ZuploWorkerd({compatibilityDate:s?.compatibilityDate,scriptDirectory:k3r.join(this.sourceDirectory,"dist"),modules:jB(this.sourceDirectory,s?.metafile),port:this.port,inspectorPort:this.debugPort??void 0,bindings:c,handleRuntimeStdio:this.handleRuntimeStdio}),await this.workerd.serve()}catch(c){this.logger?.debug(c)}}async stop(){await this.buildWatcher?.close(),await this.workerd?.dispose()}};import{fileURLToPath as cCt}from"node:url";import{Readable as iCt}from"node:stream";import sCt from"node:assert";import D3r from"node:child_process";import P3r from"node:fs";import ume from"node:os";import A3r from"node:path";function aCt(a,s){let c=import.meta.resolve(a),_=new URL(".",c),m=new URL(s,_);if(P3r.existsSync(m))return cCt(m)}t(aCt,"getValidExecutablePath");function N3r(){let a=ume.platform()==="win32"?"deno.exe":"deno",s=aCt("deno/package.json",a);if(s)return s;let c=I3r(),_=aCt(`@deno/${c}/package.json`,a);if(_)return _;throw new Error("Failed to locate the managed-dedicated server executable.")}t(N3r,"locateDenoExecutable");function I3r(){let a=ume.platform();return a==="linux"?a+"-"+oCt()+"-glibc":a+"-"+oCt()}t(I3r,"getTarget");function oCt(){let a=ume.arch();if(a!=="arm64"&&a!=="x64")throw new Error("Unsupported architecture "+ume.arch()+". Only x64 and aarch64 binaries are available.");return a}t(oCt,"getArch");var fme=class{static{t(this,"ZenoServer")}serverProcess;sourceDirectory;debugPort;processExitPromise;logger;output;buildWatcher;onReload;handleRuntimeStdio;denoExecutablePath;port=9e3;constructor(s){if(this.debugPort=s.debugPort,this.logger=s.logger,this.output=s.output,this.onReload=s.onReload,this.handleRuntimeStdio=s.handleRuntimeStdio,this.sourceDirectory=s.sourceDirectory,!s.zupTestMode){let c="http://localhost:3000",_=`http://localhost:${this.port}`;this.buildWatcher=new W4({sourceDirectory:s.sourceDirectory,command:"dev",logger:s.logger,publicZuploEnvironmentVariables:{...s.publicZuploEnvironmentVariables,ZUPLO_ENVIRONMENT_TYPE:"LOCAL_DEVELOPMENT"},buildId:"dev",output:s.output,urls:{devPortal:{defaultUrl:c,urls:[c]},api:{defaultUrl:_,urls:[_]}}}),this.buildWatcher.watchEnvFiles()}this.denoExecutablePath=N3r()}getServeArgs(){let s=`${A3r.dirname(cCt(import.meta.url))}/zeno.js`,c=["run","--allow-read","--allow-net","--allow-env","--allow-write"];return this.debugPort&&c.push(`--inspect=127.0.0.1:${this.debugPort}`),c.push(s),c.push("--dir",this.sourceDirectory),c}async getUnavailablePorts(){let s=[];return this.debugPort&&!await aX("127.0.0.1",this.debugPort)&&s.push(this.debugPort),await aX("127.0.0.1",this.port)||s.push(this.port),s}async start(){let s=await this.getUnavailablePorts();if(s.length>0)throw new Error("The following ports are not available: "+s.join(", "));if(this.buildWatcher)try{await this.buildWatcher.start()}catch(c){this.output.child("api").error(c.toString());let _="Ran into irrecoverable error while starting watcher. Fix the error and restart the server.";this.output.child("api").error(_),this.logger?.info(_),process.exit(1)}await this.startOrReload(),this.buildWatcher?.onReload((c,_)=>{_||c&&c.errors&&c.errors.length>0||(this.onReload(c,_),this.startOrReload().catch(m=>{this.output.child("api").error(m.toString()),this.logger?.error(m)}))})}async startOrReload(){try{await this.dispose(),this.logger?.info("Starting managed-dedicated local server");let s=this.getServeArgs();this.serverProcess=D3r.spawn(this.denoExecutablePath,s,{stdio:["pipe","pipe","pipe"],env:{...process.env,FORCE_COLOR:"1"}}),sCt(this.serverProcess.stdout instanceof iCt),sCt(this.serverProcess.stderr instanceof iCt),this.processExitPromise=this.waitForExit(),this.handleRuntimeStdio(this.serverProcess.stdout,this.serverProcess.stderr)}catch(s){this.logger?.debug(s)}}waitForExit(){return new Promise(s=>{this.serverProcess?.once("exit",s)})}dispose(){return this.serverProcess?.kill("SIGKILL"),this.processExitPromise}async stop(){await this.dispose(),await this.buildWatcher?.close()}};async function O3r(a){let s=await BB(a),c=!1;return s.status===OA&&(c=s.config.flags?.managedDedicatedFlags?.useZeno??!1),c||process.env.ZUPLO_DEV_RUNTIME==="zeno"}t(O3r,"useZeno");async function F3r({sourceDirectory:a,port:s,debugPort:c,publicZuploEnvironmentVariables:_,logger:m,output:v,buildId:w,onReload:A,handleRuntimeStdio:M}){process.env.ZUPLO_IS_LOCAL_DEVELOPMENT="true";let $;await O3r(a)?(m.debug("Starting managed-dedicated local dev server."),$=new fme({sourceDirectory:a,debugPort:c,logger:m,output:v,publicZuploEnvironmentVariables:_,onReload:A,handleRuntimeStdio:M})):(m.debug("Starting edge local dev server."),$=new lme({sourceDirectory:a,command:"dev",port:s,debugPort:c,publicZuploEnvironmentVariables:_,logger:m,output:v,buildId:w,onReload:A,handleRuntimeStdio:M})),await $.start();async function re(){await $.stop()}t(re,"handle"),process.on("SIGTERM",re),process.on("SIGINT",re)}t(F3r,"startDevServer");var RCt=zp(fCt(),1),MCt=zp(FCt(),1);import{readFile as mOr}from"node:fs/promises";import _X from"node:path";var pOr=new RegExp("^((https|http)://)?[a-zA-Z0-9]{3}\\.[a-zA-Z0-9][a-zA-Z0-9]{0,61}?[a-zA-Z0-9]\\.(com|net|cn|cc)(:[0-9]{1,4})?/$"),dOr={concat(a,s){return _X.join(a,s)},resolve(a){return this.isAbsolute(a)?this.normalize(a):this.normalize(this.concat(process.cwd(),a))},normalize(a){let s=_X.normalize(a),c=_X.sep,_=[],m=0;return s.split(c).reverse().filter(w=>w!==".").forEach(w=>{w===".."?m++:m===0?_.push(w):m--}),_.reverse().join(c)},isData(a){return a.startsWith("data:")},isURL(a){return pOr.test(a)},isAbsolute(a){return _X.isAbsolute(a)},relativeToFile(a,s){if(this.isData(a)||this.isAbsolute(s))return this.normalize(s);{let c=_X.dirname(a);return this.normalize(this.concat(c,s))}}},Sme=dOr;var LCt=t(a=>{let s=t(c=>c in s.cache?s.cache[c]:s.cache[c]=a(c),"m");return s.forgetEverything=()=>{s.cache=Object.create(null)},s.cache=Object.create(null),s},"memoize");function i9e(a){let s=LCt(async w=>await c(w,await a(w)));async function c(w,A){if(A===void 0)return s(Sme.resolve(w));let M,$,re=t(async X=>($=$||await _(ie))(X),"_resolve"),ie={path:w,text:A,get lines(){return M=M||A.split(`
653
- `)},async resolve(X){try{return await re(X)}catch(Re){return Object.assign({},X,{error:Re})}},_resolve:re};return ie}t(c,"SourceFile");async function _(w){let A=/\u0023 sourceMappingURL=(.+)\n?/g,M;for(;;){let ie=A.exec(w.text);if(ie)M=ie;else break}let $=M&&M[1],re=t(async ie=>Object.assign({},ie,{sourceFile:w,sourceLine:w.lines[ie.line-1]||""}),"defaultResolver");return $?await m(w.path,$,re):re}t(_,"SourceMapResolverFromFetchedFile");async function m(w,A,M){let $=A.startsWith("data:")?await c(w,(0,RCt.dataUriToBuffer)(A).toString()):await c(Sme.relativeToFile(w,A)),re=await new MCt.SourceMapConsumer(JSON.parse($.text)),ie=LCt(async X=>{let Re=Sme.relativeToFile($.path,X),Ne=re.sourceContentFor(X,!0);if(!Ne){let De=X.replace(/\\/g,"/");if(Ne=re.sourceContentFor(De,!0),!Ne&&X.startsWith("./")&&(Ne=re.sourceContentFor(X.substring(2),!0)),!Ne&&!X.startsWith("./")&&!X.startsWith("/")&&(Ne=re.sourceContentFor("./"+X,!0)),!Ne){let Et=[X.replace(/^\.\.\//,""),X.replace(/^\//,""),X.replace(/^\.\.\//g,"")];for(let vt of Et)if(Ne=re.sourceContentFor(vt,!0),Ne)break}if(!Ne){let Et=re.sources.indexOf(X);if(Et>=0){let vt=re.sourcesContent;if(vt&&Et<vt.length){let yr=vt[Et];yr&&(Ne=yr)}}if(!Ne){let vt=X.split("/").pop();if(vt){let yr=re.sources.filter(sn=>sn.includes(vt));for(let sn of yr){let Zr=re.sources.indexOf(sn);if(Ne=re.sourceContentFor(sn,!0),!Ne&&re.sourcesContent&&Zr>=0){let an=re.sourcesContent[Zr];an&&(Ne=an)}if(Ne)break}}}}}return await c(Re,Ne||void 0)});return async X=>{try{let Re=re.originalPositionFor(X);return Re.source?await(await ie(Re.source))._resolve(Object.assign({},X,{line:Re.line,column:(Re.column??0)+1,name:Re.name})):M(X)}catch(Re){return Object.assign(M(X),{sourceMapError:Re})}}}t(m,"SourceMapResolver");let v=t(async function(A){try{return await c(A)}catch(M){let $={path:A,text:"",lines:[],error:M,async resolve(re){return Object.assign({},re,{error:M,sourceLine:"",sourceFile:$})},_resolve(re){return this.resolve(re)}};return $}},"getSource");return v.resetCache=()=>s.forgetEverything(),v.getCache=()=>s.cache,v}t(i9e,"buildGetSourceFunction");var hOr=t(async a=>mOr(a,{encoding:"utf8"}),"fetchFile"),jCt=i9e(hOr);var c1=new URL("./public/",import.meta.url);import{readFile as Tme}from"fs/promises";var Sv=class{static{t(this,"BaseComponent")}#e;#n;#t;scriptFile;cssFile;constructor(a){this.#t=a}async getStyles(){return this.cssFile?this.#t?await Tme(this.cssFile,"utf-8"):(this.#e=this.#e??await Tme(this.cssFile,"utf-8"),this.#e):null}async getScript(){return this.scriptFile?this.#t?await Tme(this.scriptFile,"utf-8"):(this.#n=this.#n??await Tme(this.scriptFile,"utf-8"),this.#n):null}};var BCt=class extends Sv{static{t(this,"Layout")}cssFile=new URL("./layout/style.css",c1);scriptFile=new URL("./layout/script.js",c1);async toHTML(a){return`<!DOCTYPE html>
653
+ `)},async resolve(X){try{return await re(X)}catch(Re){return Object.assign({},X,{error:Re})}},_resolve:re};return ie}t(c,"SourceFile");async function _(w){let A=/\u0023 sourceMappingURL=(.+)\n?/g,M;for(;;){let ie=A.exec(w.text);if(ie)M=ie;else break}let $=M&&M[1],re=t(async ie=>Object.assign({},ie,{sourceFile:w,sourceLine:w.lines[ie.line-1]||""}),"defaultResolver");return $?await m(w.path,$,re):re}t(_,"SourceMapResolverFromFetchedFile");async function m(w,A,M){let $=A.startsWith("data:")?await c(w,(0,RCt.dataUriToBuffer)(A).toString()):await c(Sme.relativeToFile(w,A)),re=await new MCt.SourceMapConsumer(JSON.parse($.text)),ie=LCt(async X=>{let Re=Sme.relativeToFile($.path,X),Ne=re.sourceContentFor(X,!0);if(!Ne){let De=X.replace(/\\/g,"/");if(Ne=re.sourceContentFor(De,!0),!Ne&&X.startsWith("./")&&(Ne=re.sourceContentFor(X.substring(2),!0)),!Ne&&!X.startsWith("./")&&!X.startsWith("/")&&(Ne=re.sourceContentFor("./"+X,!0)),!Ne){let Et=[X.replace(/^\.\.\//,""),X.replace(/^\//,""),X.replace(/^\.\.\//g,"")];for(let vt of Et)if(Ne=re.sourceContentFor(vt,!0),Ne)break}if(!Ne){let Et=re.sources.indexOf(X);if(Et>=0){let vt=re.sourcesContent;if(vt&&Et<vt.length){let yr=vt[Et];yr&&(Ne=yr)}}if(!Ne){let vt=X.split("/").pop();if(vt){let yr=re.sources.filter(sn=>sn.includes(vt));for(let sn of yr){let Zr=re.sources.indexOf(sn);if(Ne=re.sourceContentFor(sn,!0),!Ne&&re.sourcesContent&&Zr>=0){let an=re.sourcesContent[Zr];an&&(Ne=an)}if(Ne)break}}}}}return await c(Re,Ne||"")});return async X=>{try{let Re=re.originalPositionFor(X);return Re.source?await(await ie(Re.source))._resolve(Object.assign({},X,{line:Re.line,column:(Re.column??0)+1,name:Re.name})):M(X)}catch(Re){return Object.assign(M(X),{sourceMapError:Re})}}}t(m,"SourceMapResolver");let v=t(async function(A){try{return await c(A)}catch(M){let $={path:A,text:"",lines:[],error:M,async resolve(re){return Object.assign({},re,{error:M,sourceLine:"",sourceFile:$})},_resolve(re){return this.resolve(re)}};return $}},"getSource");return v.resetCache=()=>s.forgetEverything(),v.getCache=()=>s.cache,v}t(i9e,"buildGetSourceFunction");var hOr=t(async a=>mOr(a,{encoding:"utf8"}),"fetchFile"),jCt=i9e(hOr);var c1=new URL("./public/",import.meta.url);import{readFile as Tme}from"fs/promises";var Sv=class{static{t(this,"BaseComponent")}#e;#n;#t;scriptFile;cssFile;constructor(a){this.#t=a}async getStyles(){return this.cssFile?this.#t?await Tme(this.cssFile,"utf-8"):(this.#e=this.#e??await Tme(this.cssFile,"utf-8"),this.#e):null}async getScript(){return this.scriptFile?this.#t?await Tme(this.scriptFile,"utf-8"):(this.#n=this.#n??await Tme(this.scriptFile,"utf-8"),this.#n):null}};var BCt=class extends Sv{static{t(this,"Layout")}cssFile=new URL("./layout/style.css",c1);scriptFile=new URL("./layout/script.js",c1);async toHTML(a){return`<!DOCTYPE html>
654
654
  <html lang="en">
655
655
  <head>
656
656
  <meta charset="UTF-8" />
package/index.minified.js CHANGED
@@ -655,7 +655,7 @@ export default {
655
655
  ${s}`,"wrappedToString"),H4r=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),G4r=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),K4r=t((a,s,c)=>{let _=c===""?"":`with ${c.trim()}() `,m=W4r.bind(null,_,s.toString());Object.defineProperty(m,"name",G4r),Object.defineProperty(a,"toString",{...H4r,value:m})},"changeToString");function jRe(a,s,{ignoreNonConfigurable:c=!1}={}){let{name:_}=a;for(let m of Reflect.ownKeys(s))J4r(a,s,m,c);return V4r(a,s),K4r(a,s,_),a}t(jRe,"mimicFunction");var Qde=new WeakMap,yEt=t((a,s={})=>{if(typeof a!="function")throw new TypeError("Expected a function");let c,_=0,m=a.displayName||a.name||"<anonymous>",v=t(function(...w){if(Qde.set(v,++_),_===1)c=a.apply(this,w),a=null;else if(s.throw===!0)throw new Error(`Function \`${m}\` can only be called once`);return c},"onetime");return jRe(v,a),Qde.set(v,_),v},"onetime");yEt.callCount=a=>{if(!Qde.has(a))throw new Error(`The given function \`${a.name}\` is not wrapped by the \`onetime\` package`);return Qde.get(a)};var vEt=yEt;import{constants as Q4r}from"os";var bEt=t(function(){let a=BRe-SEt+1;return Array.from({length:a},Y4r)},"getRealtimeSignals"),Y4r=t(function(a,s){return{name:`SIGRT${s+1}`,number:SEt+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),SEt=34,BRe=64;import{constants as X4r}from"os";var TEt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var URe=t(function(){let a=bEt();return[...TEt,...a].map(Z4r)},"getSignals"),Z4r=t(function({name:a,number:s,description:c,action:_,forced:m=!1,standard:v}){let{signals:{[a]:w}}=X4r,A=w!==void 0;return{name:a,number:A?w:s,description:c,supported:A,action:_,forced:m,standard:v}},"normalizeSignal");var e3r=t(function(){return URe().reduce(t3r,{})},"getSignalsByName"),t3r=t(function(a,{name:s,number:c,description:_,supported:m,action:v,forced:w,standard:A}){return{...a,[s]:{name:s,number:c,description:_,supported:m,action:v,forced:w,standard:A}}},"getSignalByName"),xEt=e3r(),r3r=t(function(){let a=URe(),s=BRe+1,c=Array.from({length:s},(_,m)=>n3r(m,a));return Object.assign({},...c)},"getSignalsByNumber"),n3r=t(function(a,s){let c=i3r(a,s);if(c===void 0)return{};let{name:_,description:m,supported:v,action:w,forced:A,standard:R}=c;return{[a]:{name:_,number:a,description:m,supported:v,action:w,forced:A,standard:R}}},"getSignalByNumber"),i3r=t(function(a,s){let c=s.find(({name:_})=>Q4r.signals[_]===a);return c!==void 0?c:s.find(_=>_.number===a)},"findSignalByNumber"),Prn=r3r();var s3r=t(({timedOut:a,timeout:s,errorCode:c,signal:_,signalDescription:m,exitCode:v,isCanceled:w})=>a?`timed out after ${s} milliseconds`:w?"was canceled":c!==void 0?`failed with ${c}`:_!==void 0?`was killed with ${_} (${m})`:v!==void 0?`failed with exit code ${v}`:"failed","getErrorPrefix"),$Re=t(({stdout:a,stderr:s,all:c,error:_,signal:m,exitCode:v,command:w,escapedCommand:A,timedOut:R,isCanceled:$,killed:re,parsed:{options:{timeout:ie}}})=>{v=v===null?void 0:v,m=m===null?void 0:m;let X=m===void 0?void 0:xEt[m].description,Re=_&&_.code,De=`Command ${s3r({timedOut:R,timeout:ie,errorCode:Re,signal:m,signalDescription:X,exitCode:v,isCanceled:$})}: ${w}`,Et=Object.prototype.toString.call(_)==="[object Error]",vt=Et?`${De}
656
656
  ${_.message}`:De,yr=[vt,s,a].filter(Boolean).join(`
657
657
  `);return Et?(_.originalMessage=_.message,_.message=yr):_=new Error(yr),_.shortMessage=vt,_.command=w,_.escapedCommand=A,_.exitCode=v,_.signal=m,_.signalDescription=X,_.stdout=a,_.stderr=s,c!==void 0&&(_.all=c),"bufferedData"in _&&delete _.bufferedData,_.failed=!0,_.timedOut=!!R,_.isCanceled=$,_.killed=re&&!R,_},"makeError");var eme=["stdin","stdout","stderr"],a3r=t(a=>eme.some(s=>a[s]!==void 0),"hasAlias"),EEt=t(a=>{if(!a)return;let{stdio:s}=a;if(s===void 0)return eme.map(_=>a[_]);if(a3r(a))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${eme.map(_=>`\`${_}\``).join(", ")}`);if(typeof s=="string")return s;if(!Array.isArray(s))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof s}\``);let c=Math.max(s.length,eme.length);return Array.from({length:c},(_,m)=>s[m])},"normalizeStdio");var NEt=X_(AEt(),1);import o3r from"node:os";var c3r=1e3*5,IEt=t((a,s="SIGTERM",c={})=>{let _=a(s);return l3r(a,s,c,_),_},"spawnedKill"),l3r=t((a,s,c,_)=>{if(!u3r(s,c,_))return;let m=_3r(c),v=setTimeout(()=>{a("SIGKILL")},m);v.unref&&v.unref()},"setKillTimeout"),u3r=t((a,{forceKillAfterTimeout:s},c)=>f3r(a)&&s!==!1&&c,"shouldForceKill"),f3r=t(a=>a===o3r.constants.signals.SIGTERM||typeof a=="string"&&a.toUpperCase()==="SIGTERM","isSigterm"),_3r=t(({forceKillAfterTimeout:a=!0})=>{if(a===!0)return c3r;if(!Number.isFinite(a)||a<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${a}\` (${typeof a})`);return a},"getForceKillAfterTimeout"),OEt=t((a,s)=>{a.kill()&&(s.isCanceled=!0)},"spawnedCancel"),p3r=t((a,s,c)=>{a.kill(s),c(Object.assign(new Error("Timed out"),{timedOut:!0,signal:s}))},"timeoutKill"),FEt=t((a,{timeout:s,killSignal:c="SIGTERM"},_)=>{if(s===0||s===void 0)return _;let m,v=new Promise((A,R)=>{m=setTimeout(()=>{p3r(a,c,R)},s)}),w=_.finally(()=>{clearTimeout(m)});return Promise.race([v,w])},"setupTimeout"),LEt=t(({timeout:a})=>{if(a!==void 0&&(!Number.isFinite(a)||a<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${a}\` (${typeof a})`)},"validateTimeout"),REt=t(async(a,{cleanup:s,detached:c},_)=>{if(!s||c)return _;let m=(0,NEt.default)(()=>{a.kill()});return _.finally(()=>{m()})},"setExitHandler");function MEt(a){return a!==null&&typeof a=="object"&&typeof a.pipe=="function"}t(MEt,"isStream");var HRe=X_(UEt(),1),JEt=X_(zEt(),1);var qEt=t((a,s)=>{s===void 0||a.stdin===void 0||(MEt(s)?s.pipe(a.stdin):a.stdin.end(s))},"handleInput"),VEt=t((a,{all:s})=>{if(!s||!a.stdout&&!a.stderr)return;let c=(0,JEt.default)();return a.stdout&&c.add(a.stdout),a.stderr&&c.add(a.stderr),c},"makeAllStream"),VRe=t(async(a,s)=>{if(a){a.destroy();try{return await s}catch(c){return c.bufferedData}}},"getBufferedData"),WRe=t((a,{encoding:s,buffer:c,maxBuffer:_})=>{if(!(!a||!c))return s?(0,HRe.default)(a,{encoding:s,maxBuffer:_}):HRe.default.buffer(a,{maxBuffer:_})},"getStreamPromise"),WEt=t(async({stdout:a,stderr:s,all:c},{encoding:_,buffer:m,maxBuffer:v},w)=>{let A=WRe(a,{encoding:_,buffer:m,maxBuffer:v}),R=WRe(s,{encoding:_,buffer:m,maxBuffer:v}),$=WRe(c,{encoding:_,buffer:m,maxBuffer:v*2});try{return await Promise.all([w,A,R,$])}catch(re){return Promise.all([{error:re,signal:re.signal,timedOut:re.timedOut},VRe(a,A),VRe(s,R),VRe(c,$)])}},"getSpawnedResult");var S3r=(async()=>{})().constructor.prototype,T3r=["then","catch","finally"].map(a=>[a,Reflect.getOwnPropertyDescriptor(S3r,a)]),GRe=t((a,s)=>{for(let[c,_]of T3r){let m=typeof s=="function"?(...v)=>Reflect.apply(_.value,s(),v):_.value.bind(s);Reflect.defineProperty(a,c,{..._,value:m})}return a},"mergePromise"),HEt=t(a=>new Promise((s,c)=>{a.on("exit",(_,m)=>{s({exitCode:_,signal:m})}),a.on("error",_=>{c(_)}),a.stdin&&a.stdin.on("error",_=>{c(_)})}),"getSpawnedPromise");var GEt=t((a,s=[])=>Array.isArray(s)?[a,...s]:[a],"normalizeArgs"),x3r=/^[\w.-]+$/,E3r=/"/g,C3r=t(a=>typeof a!="string"||x3r.test(a)?a:`"${a.replace(E3r,'\\"')}"`,"escapeArg"),KEt=t((a,s)=>GEt(a,s).join(" "),"joinCommand"),YEt=t((a,s)=>GEt(a,s).map(c=>C3r(c)).join(" "),"getEscapedCommand");var D3r=1e3*1e3*100,P3r=t(({env:a,extendEnv:s,preferLocal:c,localDir:_,execPath:m})=>{let v=s?{...ame.env,...a}:a;return c?gEt({env:v,cwd:_,execPath:m}):v},"getEnv"),A3r=t((a,s,c={})=>{let _=ZEt.default._parse(a,s,c);return a=_.command,s=_.args,c=_.options,c={maxBuffer:D3r,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:c.cwd||ame.cwd(),execPath:ame.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...c},c.env=P3r(c),c.stdio=EEt(c),ame.platform==="win32"&&k3r.basename(a,".exe")==="cmd"&&s.unshift("/q"),{file:a,args:s,options:c,parsed:_}},"handleArguments"),KRe=t((a,s,c)=>typeof s!="string"&&!w3r.isBuffer(s)?c===void 0?void 0:"":a.stripFinalNewline?MRe(s):s,"handleOutput");function QEt(a,s,c){let _=A3r(a,s,c),m=KEt(a,s),v=YEt(a,s);LEt(_.options);let w;try{w=XEt.spawn(_.file,_.args,_.options)}catch(Re){let Ne=new XEt.ChildProcess,De=Promise.reject($Re({error:Re,stdout:"",stderr:"",all:"",command:m,escapedCommand:v,parsed:_,timedOut:!1,isCanceled:!1,killed:!1}));return GRe(Ne,De)}let A=HEt(w),R=FEt(w,_.options,A),$=REt(w,_.options,R),re={isCanceled:!1};w.kill=IEt.bind(null,w.kill.bind(w)),w.cancel=OEt.bind(null,w,re);let X=vEt(t(async()=>{let[{error:Re,exitCode:Ne,signal:De,timedOut:Et},vt,yr,sn]=await WEt(w,_.options,$),Zr=KRe(_.options,vt),an=KRe(_.options,yr),xr=KRe(_.options,sn);if(Re||Ne!==0||De!==null){let br=$Re({error:Re,exitCode:Ne,signal:De,stdout:Zr,stderr:an,all:xr,command:m,escapedCommand:v,parsed:_,timedOut:Et,isCanceled:re.isCanceled||(_.options.signal?_.options.signal.aborted:!1),killed:w.killed});if(!_.options.reject)return br;throw br}return{command:m,escapedCommand:v,exitCode:0,stdout:Zr,stderr:an,all:xr,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},"handlePromise"));return qEt(w,_.options.input),w.all=VEt(w,_.options),GRe(w,X)}t(QEt,"execa");async function cme(a,s){if(a.__ZUPLO_LOG_LEVEL=process.env.__ZUPLO_LOG_LEVEL??process.env.LOG_LEVEL,a.__ZUPLO_LOG_FORMAT=process.env.__ZUPLO_LOG_FORMAT??process.env.LOG_FORMAT,a.LOG_LEVEL=process.env.LOG_LEVEL??process.env.LOG_LEVEL,a.LOG_FORMAT=process.env.LOG_FORMAT??process.env.LOG_FORMAT,a.GIT_SHA=process.env.GIT_SHA??await N3r(s),process.env.__ZUPLO_CONFIG&&(a.__ZUPLO_CONFIG=process.env.__ZUPLO_CONFIG),eCt(ome.join(s,".env.zuplo"))){let c=tCt(ome.join(s,".env.zuplo"),"utf8"),_=YRe.default.parse(c);for(let m of Object.keys(_))if(a[m]=_[m],m==="ZUPLO_SYSTEM_CONFIGURATIONS"){let v=Buffer.from(efe.decode(_[m])).toString(),w=JSON.parse(v);for(let A of Object.keys(w))a[A]=w[A]}}if(eCt(ome.join(s,".env"))){let c=tCt(ome.join(s,".env"),"utf8"),_=YRe.default.parse(c);for(let m of Object.keys(_))a[m]=_[m]}for(let c of Object.keys(a))a[c]===void 0&&delete a[c];return a}t(cme,"setEnvironment");async function N3r(a){let s="unknown";try{let{stdout:c}=await QEt("git",["rev-parse","HEAD"],{cwd:a});c.trim().length===40&&(s=c.trim())}catch{}return s}t(N3r,"getGitSha");async function L3r({buildId:a,output:s,sourceDirectory:c,bundledDir:_,port:m,binaryName:v,publicZuploEnvironmentVariables:w,logger:A,handleRuntimeStdio:R}){if(_){let re=sX.join(c,_,"modules.json");if(!I3r(re))throw new Error("The bundled-dir does not contain a modules.json file.");let ie=await F3r(re,"utf-8").then(JSON.parse),X=await BB(c);return X.status===RA?new Promise((Re,Ne)=>{$(X.config.compatibilityDate,sX.join(c,_),ie,Re,R)().catch(De=>{A.error(De),Ne(De)})}):(A.warn("Failed to get Zuplo config. Using default compatibility date."),new Promise((Re,Ne)=>{$(void 0,c,ie,Re,R)().catch(De=>{A.error(De),Ne(De)})}))}else{let re=new c6({buildId:a,output:s,sourceDirectory:c,command:"dev",logger:A,publicZuploEnvironmentVariables:w??{ZUPLO_ENVIRONMENT_TYPE:"LOCAL_DEVELOPMENT"},urls:void 0});try{await re.start()}catch{A.info("Ran into irrecoverable error while building. Fix the error and rerun the command."),process.exit(1)}return new Promise((ie,X)=>{re.onReload((Re,Ne)=>{(Ne||Re&&Re.errors&&Re.errors.length>0)&&X(Ne??Re?.errors),$(Re?.compatibilityDate,sX.join(c,"dist"),jB(c,Re?.metafile),ie,R)().catch(De=>{A.error(De),X(De)})})})}function $(re,ie,X,Re,Ne){return async()=>{let De={};await cme(De,c);let Et=new rCt.ZuploWorkerd({compatibilityDate:re,scriptDirectory:ie,modules:X,port:m??qm.DEV_SERVER_PORT,bindings:De,handleRuntimeStdio:Ne}),vt=v??"compiled-zup",yr=sX.join(c,"dist");await O3r(yr,{recursive:!0}),await Et.compileBinary({binaryPath:sX.join(c,"dist",vt)}),await Et.dispose(),Re(void 0)}}t($,"compile")}t(L3r,"compileWorkerdServer");var nCt=X_(kRe(),1);import M3r from"node:path";import R3r from"node:net";function aX(a,s){return new Promise(c=>{let _=new R3r.Socket;_.connect(s,a),_.on("connect",()=>{_.destroy(),c(!1)}),_.on("error",()=>{_.destroy(),c(!0)})})}t(aX,"isPortAvailable");var lme=class{static{t(this,"WorkerdServer")}sourceDirectory;port;debugPort;buildWatcher;workerd;logger;output;handleRuntimeStdio;onReload;constructor(s){if(this.sourceDirectory=s.sourceDirectory,this.port=s.port??qm.DEV_SERVER_PORT,this.debugPort=s.debugPort,this.logger=s.logger,this.output=s.output,this.handleRuntimeStdio=s.handleRuntimeStdio,this.onReload=s.onReload,!s.zupTestMode){let c="http://localhost:3000",_=`http://localhost:${this.port}`;this.buildWatcher=new c6({...s,logger:this.logger,publicZuploEnvironmentVariables:{...s.publicZuploEnvironmentVariables,ZUPLO_ENVIRONMENT_TYPE:"LOCAL_DEVELOPMENT"},urls:{devPortal:{defaultUrl:c,urls:[c]},api:{defaultUrl:_,urls:[_]}}}),this.buildWatcher.watchEnvFiles()}}async start(){if(!await aX("localhost",this.port))throw new Error(`Port ${this.port} is currently in use. Please use a different port.`);if(this.buildWatcher)try{await this.buildWatcher.start()}catch(c){this.output.child("api").error(c.toString());let _="Ran into irrecoverable error while starting watcher. Fix the error and restart the server.";this.output.child("api").error(_),this.logger?.info(_),process.exit(1)}this.buildWatcher?.onReload((c,_)=>{_||c&&c.errors&&c.errors.length>0||(this.onReload(c,_),this.startOrReload(c).catch(m=>{this.output.child("api").error(m.toString()),this.logger?.error(m)}))})}async startOrReload(s){try{let c={};await cme(c,this.sourceDirectory),await this.workerd?.dispose(),this.workerd=new nCt.ZuploWorkerd({compatibilityDate:s?.compatibilityDate,scriptDirectory:M3r.join(this.sourceDirectory,"dist"),modules:jB(this.sourceDirectory,s?.metafile),port:this.port,inspectorPort:this.debugPort??void 0,bindings:c,handleRuntimeStdio:this.handleRuntimeStdio}),await this.workerd.serve()}catch(c){this.logger?.debug(c)}}async stop(){await this.buildWatcher?.close(),await this.workerd?.dispose()}};import{fileURLToPath as cCt}from"node:url";import{Readable as iCt}from"node:stream";import sCt from"node:assert";import j3r from"node:child_process";import B3r from"node:fs";import ume from"node:os";import U3r from"node:path";function aCt(a,s){let c=import.meta.resolve(a),_=new URL(".",c),m=new URL(s,_);if(B3r.existsSync(m))return cCt(m)}t(aCt,"getValidExecutablePath");function $3r(){let a=ume.platform()==="win32"?"deno.exe":"deno",s=aCt("deno/package.json",a);if(s)return s;let c=z3r(),_=aCt(`@deno/${c}/package.json`,a);if(_)return _;throw new Error("Failed to locate the managed-dedicated server executable.")}t($3r,"locateDenoExecutable");function z3r(){let a=ume.platform();return a==="linux"?a+"-"+oCt()+"-glibc":a+"-"+oCt()}t(z3r,"getTarget");function oCt(){let a=ume.arch();if(a!=="arm64"&&a!=="x64")throw new Error("Unsupported architecture "+ume.arch()+". Only x64 and aarch64 binaries are available.");return a}t(oCt,"getArch");var fme=class{static{t(this,"ZenoServer")}serverProcess;sourceDirectory;debugPort;processExitPromise;logger;output;buildWatcher;onReload;handleRuntimeStdio;denoExecutablePath;port=9e3;constructor(s){if(this.debugPort=s.debugPort,this.logger=s.logger,this.output=s.output,this.onReload=s.onReload,this.handleRuntimeStdio=s.handleRuntimeStdio,this.sourceDirectory=s.sourceDirectory,!s.zupTestMode){let c="http://localhost:3000",_=`http://localhost:${this.port}`;this.buildWatcher=new c6({sourceDirectory:s.sourceDirectory,command:"dev",logger:s.logger,publicZuploEnvironmentVariables:{...s.publicZuploEnvironmentVariables,ZUPLO_ENVIRONMENT_TYPE:"LOCAL_DEVELOPMENT"},buildId:"dev",output:s.output,urls:{devPortal:{defaultUrl:c,urls:[c]},api:{defaultUrl:_,urls:[_]}}}),this.buildWatcher.watchEnvFiles()}this.denoExecutablePath=$3r()}getServeArgs(){let s=`${U3r.dirname(cCt(import.meta.url))}/zeno.js`,c=["run","--allow-read","--allow-net","--allow-env","--allow-write"];return this.debugPort&&c.push(`--inspect=127.0.0.1:${this.debugPort}`),c.push(s),c.push("--dir",this.sourceDirectory),c}async getUnavailablePorts(){let s=[];return this.debugPort&&!await aX("127.0.0.1",this.debugPort)&&s.push(this.debugPort),await aX("127.0.0.1",this.port)||s.push(this.port),s}async start(){let s=await this.getUnavailablePorts();if(s.length>0)throw new Error("The following ports are not available: "+s.join(", "));if(this.buildWatcher)try{await this.buildWatcher.start()}catch(c){this.output.child("api").error(c.toString());let _="Ran into irrecoverable error while starting watcher. Fix the error and restart the server.";this.output.child("api").error(_),this.logger?.info(_),process.exit(1)}await this.startOrReload(),this.buildWatcher?.onReload((c,_)=>{_||c&&c.errors&&c.errors.length>0||(this.onReload(c,_),this.startOrReload().catch(m=>{this.output.child("api").error(m.toString()),this.logger?.error(m)}))})}async startOrReload(){try{await this.dispose(),this.logger?.info("Starting managed-dedicated local server");let s=this.getServeArgs();this.serverProcess=j3r.spawn(this.denoExecutablePath,s,{stdio:["pipe","pipe","pipe"],env:{...process.env,FORCE_COLOR:"1"}}),sCt(this.serverProcess.stdout instanceof iCt),sCt(this.serverProcess.stderr instanceof iCt),this.processExitPromise=this.waitForExit(),this.handleRuntimeStdio(this.serverProcess.stdout,this.serverProcess.stderr)}catch(s){this.logger?.debug(s)}}waitForExit(){return new Promise(s=>{this.serverProcess?.once("exit",s)})}dispose(){return this.serverProcess?.kill("SIGKILL"),this.processExitPromise}async stop(){await this.dispose(),await this.buildWatcher?.close()}};async function J3r(a){let s=await BB(a),c=!1;return s.status===RA&&(c=s.config.flags?.managedDedicatedFlags?.useZeno??!1),c||process.env.ZUPLO_DEV_RUNTIME==="zeno"}t(J3r,"useZeno");async function q3r({sourceDirectory:a,port:s,debugPort:c,publicZuploEnvironmentVariables:_,logger:m,output:v,buildId:w,onReload:A,handleRuntimeStdio:R}){process.env.ZUPLO_IS_LOCAL_DEVELOPMENT="true";let $;await J3r(a)?(m.debug("Starting managed-dedicated local dev server."),$=new fme({sourceDirectory:a,debugPort:c,logger:m,output:v,publicZuploEnvironmentVariables:_,onReload:A,handleRuntimeStdio:R})):(m.debug("Starting edge local dev server."),$=new lme({sourceDirectory:a,command:"dev",port:s,debugPort:c,publicZuploEnvironmentVariables:_,logger:m,output:v,buildId:w,onReload:A,handleRuntimeStdio:R})),await $.start();async function re(){await $.stop()}t(re,"handle"),process.on("SIGTERM",re),process.on("SIGINT",re)}t(q3r,"startDevServer");var RCt=X_(fCt(),1),MCt=X_(FCt(),1);import{readFile as COr}from"node:fs/promises";import _X from"node:path";var xOr=new RegExp("^((https|http)://)?[a-zA-Z0-9]{3}\\.[a-zA-Z0-9][a-zA-Z0-9]{0,61}?[a-zA-Z0-9]\\.(com|net|cn|cc)(:[0-9]{1,4})?/$"),EOr={concat(a,s){return _X.join(a,s)},resolve(a){return this.isAbsolute(a)?this.normalize(a):this.normalize(this.concat(process.cwd(),a))},normalize(a){let s=_X.normalize(a),c=_X.sep,_=[],m=0;return s.split(c).reverse().filter(w=>w!==".").forEach(w=>{w===".."?m++:m===0?_.push(w):m--}),_.reverse().join(c)},isData(a){return a.startsWith("data:")},isURL(a){return xOr.test(a)},isAbsolute(a){return _X.isAbsolute(a)},relativeToFile(a,s){if(this.isData(a)||this.isAbsolute(s))return this.normalize(s);{let c=_X.dirname(a);return this.normalize(this.concat(c,s))}}},Sme=EOr;var LCt=t(a=>{let s=t(c=>c in s.cache?s.cache[c]:s.cache[c]=a(c),"m");return s.forgetEverything=()=>{s.cache=Object.create(null)},s.cache=Object.create(null),s},"memoize");function c9e(a){let s=LCt(async w=>await c(w,await a(w)));async function c(w,A){if(A===void 0)return s(Sme.resolve(w));let R,$,re=t(async X=>($=$||await _(ie))(X),"_resolve"),ie={path:w,text:A,get lines(){return R=R||A.split(`
658
- `)},async resolve(X){try{return await re(X)}catch(Re){return Object.assign({},X,{error:Re})}},_resolve:re};return ie}t(c,"SourceFile");async function _(w){let A=/\u0023 sourceMappingURL=(.+)\n?/g,R;for(;;){let ie=A.exec(w.text);if(ie)R=ie;else break}let $=R&&R[1],re=t(async ie=>Object.assign({},ie,{sourceFile:w,sourceLine:w.lines[ie.line-1]||""}),"defaultResolver");return $?await m(w.path,$,re):re}t(_,"SourceMapResolverFromFetchedFile");async function m(w,A,R){let $=A.startsWith("data:")?await c(w,(0,RCt.dataUriToBuffer)(A).toString()):await c(Sme.relativeToFile(w,A)),re=await new MCt.SourceMapConsumer(JSON.parse($.text)),ie=LCt(async X=>{let Re=Sme.relativeToFile($.path,X),Ne=re.sourceContentFor(X,!0);if(!Ne){let De=X.replace(/\\/g,"/");if(Ne=re.sourceContentFor(De,!0),!Ne&&X.startsWith("./")&&(Ne=re.sourceContentFor(X.substring(2),!0)),!Ne&&!X.startsWith("./")&&!X.startsWith("/")&&(Ne=re.sourceContentFor("./"+X,!0)),!Ne){let Et=[X.replace(/^\.\.\//,""),X.replace(/^\//,""),X.replace(/^\.\.\//g,"")];for(let vt of Et)if(Ne=re.sourceContentFor(vt,!0),Ne)break}if(!Ne){let Et=re.sources.indexOf(X);if(Et>=0){let vt=re.sourcesContent;if(vt&&Et<vt.length){let yr=vt[Et];yr&&(Ne=yr)}}if(!Ne){let vt=X.split("/").pop();if(vt){let yr=re.sources.filter(sn=>sn.includes(vt));for(let sn of yr){let Zr=re.sources.indexOf(sn);if(Ne=re.sourceContentFor(sn,!0),!Ne&&re.sourcesContent&&Zr>=0){let an=re.sourcesContent[Zr];an&&(Ne=an)}if(Ne)break}}}}}return await c(Re,Ne||void 0)});return async X=>{try{let Re=re.originalPositionFor(X);return Re.source?await(await ie(Re.source))._resolve(Object.assign({},X,{line:Re.line,column:(Re.column??0)+1,name:Re.name})):R(X)}catch(Re){return Object.assign(R(X),{sourceMapError:Re})}}}t(m,"SourceMapResolver");let v=t(async function(A){try{return await c(A)}catch(R){let $={path:A,text:"",lines:[],error:R,async resolve(re){return Object.assign({},re,{error:R,sourceLine:"",sourceFile:$})},_resolve(re){return this.resolve(re)}};return $}},"getSource");return v.resetCache=()=>s.forgetEverything(),v.getCache=()=>s.cache,v}t(c9e,"buildGetSourceFunction");var wOr=t(async a=>COr(a,{encoding:"utf8"}),"fetchFile"),jCt=c9e(wOr);var l1=new URL("./public/",import.meta.url);import{readFile as Tme}from"fs/promises";var Sv=class{static{t(this,"BaseComponent")}#e;#n;#t;scriptFile;cssFile;constructor(a){this.#t=a}async getStyles(){return this.cssFile?this.#t?await Tme(this.cssFile,"utf-8"):(this.#e=this.#e??await Tme(this.cssFile,"utf-8"),this.#e):null}async getScript(){return this.scriptFile?this.#t?await Tme(this.scriptFile,"utf-8"):(this.#n=this.#n??await Tme(this.scriptFile,"utf-8"),this.#n):null}};var BCt=class extends Sv{static{t(this,"Layout")}cssFile=new URL("./layout/style.css",l1);scriptFile=new URL("./layout/script.js",l1);async toHTML(a){return`<!DOCTYPE html>
658
+ `)},async resolve(X){try{return await re(X)}catch(Re){return Object.assign({},X,{error:Re})}},_resolve:re};return ie}t(c,"SourceFile");async function _(w){let A=/\u0023 sourceMappingURL=(.+)\n?/g,R;for(;;){let ie=A.exec(w.text);if(ie)R=ie;else break}let $=R&&R[1],re=t(async ie=>Object.assign({},ie,{sourceFile:w,sourceLine:w.lines[ie.line-1]||""}),"defaultResolver");return $?await m(w.path,$,re):re}t(_,"SourceMapResolverFromFetchedFile");async function m(w,A,R){let $=A.startsWith("data:")?await c(w,(0,RCt.dataUriToBuffer)(A).toString()):await c(Sme.relativeToFile(w,A)),re=await new MCt.SourceMapConsumer(JSON.parse($.text)),ie=LCt(async X=>{let Re=Sme.relativeToFile($.path,X),Ne=re.sourceContentFor(X,!0);if(!Ne){let De=X.replace(/\\/g,"/");if(Ne=re.sourceContentFor(De,!0),!Ne&&X.startsWith("./")&&(Ne=re.sourceContentFor(X.substring(2),!0)),!Ne&&!X.startsWith("./")&&!X.startsWith("/")&&(Ne=re.sourceContentFor("./"+X,!0)),!Ne){let Et=[X.replace(/^\.\.\//,""),X.replace(/^\//,""),X.replace(/^\.\.\//g,"")];for(let vt of Et)if(Ne=re.sourceContentFor(vt,!0),Ne)break}if(!Ne){let Et=re.sources.indexOf(X);if(Et>=0){let vt=re.sourcesContent;if(vt&&Et<vt.length){let yr=vt[Et];yr&&(Ne=yr)}}if(!Ne){let vt=X.split("/").pop();if(vt){let yr=re.sources.filter(sn=>sn.includes(vt));for(let sn of yr){let Zr=re.sources.indexOf(sn);if(Ne=re.sourceContentFor(sn,!0),!Ne&&re.sourcesContent&&Zr>=0){let an=re.sourcesContent[Zr];an&&(Ne=an)}if(Ne)break}}}}}return await c(Re,Ne||"")});return async X=>{try{let Re=re.originalPositionFor(X);return Re.source?await(await ie(Re.source))._resolve(Object.assign({},X,{line:Re.line,column:(Re.column??0)+1,name:Re.name})):R(X)}catch(Re){return Object.assign(R(X),{sourceMapError:Re})}}}t(m,"SourceMapResolver");let v=t(async function(A){try{return await c(A)}catch(R){let $={path:A,text:"",lines:[],error:R,async resolve(re){return Object.assign({},re,{error:R,sourceLine:"",sourceFile:$})},_resolve(re){return this.resolve(re)}};return $}},"getSource");return v.resetCache=()=>s.forgetEverything(),v.getCache=()=>s.cache,v}t(c9e,"buildGetSourceFunction");var wOr=t(async a=>COr(a,{encoding:"utf8"}),"fetchFile"),jCt=c9e(wOr);var l1=new URL("./public/",import.meta.url);import{readFile as Tme}from"fs/promises";var Sv=class{static{t(this,"BaseComponent")}#e;#n;#t;scriptFile;cssFile;constructor(a){this.#t=a}async getStyles(){return this.cssFile?this.#t?await Tme(this.cssFile,"utf-8"):(this.#e=this.#e??await Tme(this.cssFile,"utf-8"),this.#e):null}async getScript(){return this.scriptFile?this.#t?await Tme(this.scriptFile,"utf-8"):(this.#n=this.#n??await Tme(this.scriptFile,"utf-8"),this.#n):null}};var BCt=class extends Sv{static{t(this,"Layout")}cssFile=new URL("./layout/style.css",l1);scriptFile=new URL("./layout/script.js",l1);async toHTML(a){return`<!DOCTYPE html>
659
659
  <html lang="en">
660
660
  <head>
661
661
  <meta charset="UTF-8" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/core",
3
- "version": "6.59.37",
3
+ "version": "6.59.41",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -41,9 +41,9 @@
41
41
  "prettier": "^3.5.3"
42
42
  },
43
43
  "peerDependencies": {
44
- "@zuplo/graphql": "6.59.37",
45
- "@zuplo/otel": "6.59.37",
46
- "@zuplo/runtime": "6.59.37",
44
+ "@zuplo/graphql": "6.59.41",
45
+ "@zuplo/otel": "6.59.41",
46
+ "@zuplo/runtime": "6.59.41",
47
47
  "deno": "2.3.1"
48
48
  }
49
49
  }