| var r="4.23.9";export{r as v}; |
| "use strict";var r="4.23.9";exports.version=r; |
| var Xt=Object.defineProperty;var c=(t,r)=>Xt(t,"name",{value:r,configurable:!0});import kt from"node:crypto";import j from"node:module";import{MessageChannel as zt}from"node:worker_threads";import{i as L,b as Vt,e as Y,m as Kt}from"./node-features-JeyyvQz6.mjs";import{l as ut,t as ft,g as Yt,a as Zt,d as A,b as u,e as Z,f as U,h as B,j as tt,k as te,m as P,n as ee,o as q,p as pt,q as ht,w as gt,s as Q,u as yt,v as F,x as re}from"./register-DjEWBuYC.mjs";import{pathToFileURL as S,fileURLToPath as R}from"node:url";import{readFileSync as se,existsSync as ne}from"node:fs";import{readFile as oe}from"node:fs/promises";import{p as ae,i as Pt,t as St,a as H,b as vt,c as ie,r as et}from"./index-CVGQLgGk.mjs";import{p as Ut}from"./client-D_mPDF5S.mjs";import v from"node:path";const ce=c(()=>({active:!0,parsedTsconfig:void 0}),"createDefaultData"),wt=c(t=>{const r={active:!0,namespace:t?.namespace,onImport:t?.onImport,parsedTsconfig:void 0,port:t?.port,tsconfig:t?.tsconfig};return t?.tsconfig!==!1&&(r.parsedTsconfig=ut(t?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),me=c(t=>async r=>{if(!r)throw new Error(`tsx must be loaded with --import instead of --loader | ||
| The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(t,wt(r)),r.port&&r.port.on("message",e=>{e==="deactivate"&&(t.active=!1,r.port.postMessage({type:"deactivated"}))})},"createInitialize"),de=c(t=>()=>(t.parsedTsconfig=ut(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"createGlobalPreload"),le=c(t=>{const{pathname:r}=new URL(t),e=v.extname(r);if(e===".mts"||e===".mjs")return"module";if(e===".cts"||e===".cjs")return"commonjs";if(e===".js"||ft.includes(e))return Yt(t)},"getFormatFromFileUrl"),ue=c(t=>{const{pathname:r}=new URL(t),e=v.extname(r);if(e===".mts"||e===".mjs")return"module";if(e===".cts"||e===".cjs")return"commonjs";if(e===".js"||ft.includes(e))return Zt(t)},"getFormatFromFileUrlSync"),Rt="tsx-namespace",I=`${Rt}=`,W="tsx-commonjs-export-preparse",fe=`${W}=1`,O="tsx-commonjs-virtual-query",$=new Map,pe=/^data:/i,T=c(t=>pe.test(t),"isDataUrl"),rt=c((t,r)=>t.slice(1).split("&").filter(e=>e&&r.every(s=>!e.startsWith(s))).join("&"),"getQueryWithoutParameters"),x=c((t,r)=>{const e=rt(t,r);return e?`?${e}`:""},"getSearchWithoutParameters"),he=c(t=>t.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),ge=c(t=>{const r=he(t);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const e=r.match(/\{([^}]*)\}/)?.[1];if(e)return e.split(",").some(s=>{const n=s.trim().split(/\s+as\s+/)[0];return!!(n&&n!=="default")})?"named":void 0},"getCommonJsImportBinding"),ye=c((t,r,e)=>{const s=$.get(t);if(!s)return!1;try{const[n]=ae(s);return n.some(o=>{if(o.d!==-1||o.n!==r)return!1;const a=ge(s.slice(o.ss,o.s));return a==="named"||e&&a==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),w=c(t=>{const r=t.indexOf("?"),e=t.indexOf("#");if(T(t)){if(e===-1)return;const s=t.slice(e+1),n=s.lastIndexOf("&"),o=s.slice(n+1);return o.startsWith(I)?o.slice(I.length):void 0}if(!(r===-1||e!==-1&&e<r))return new URLSearchParams(t.slice(r,e===-1?void 0:e)).get(Rt)??void 0},"getNamespace"),It=L(Vt)?"importAttributes":"importAssertions",Tt=c(t=>t==="commonjs"||t==="commonjs-typescript","isCommonJsFormat"),Et=c(t=>t==="module-typescript"||t==="typescript","isModuleTypeScriptFormat"),Pe=L(Y),Se=[`${O}=`],G=[`${W}=`,`${O}=`],E=c((t,r)=>r.parsedTsconfig&&te(r.parsedTsconfig,t)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),ve=c(t=>{if(!t.searchParams.has(O))return;const{pathname:r}=t,e=r.toLowerCase().lastIndexOf("%3f");if(e===-1)return;const s=new URL(t);return s.pathname=r.slice(0,e),s.search="",R(s)},"getFilePathFromVirtualQuery"),st=c(t=>{const r=t.startsWith(P)?new URL(t):void 0,e=r?R(r):t,s=r&&ve(r),n=s||e,o=r&&s?S(n).toString()+x(r.search,Se):t;return{fileUrl:r,filePath:n,loadUrl:o}},"getFileLoadContext"),jt=c((t,r)=>{if(!r?.search)return t;const e=x(r.search,G);return e?S(t).toString()+e:t},"getTransformPath"),Lt=c((t,r,e)=>{const s=[...r?rt(r.search,[I,...G]).split("&").filter(Boolean):[],...e?[`namespace=${encodeURIComponent(e)}`]:[]].join("&");return s?`${t}?${s}`:t},"getFilePathWithQuery"),Ue=new TextDecoder,Ft=c(t=>typeof t=="string"?t:Ue.decode(t),"decodeSource"),we=c((t,r)=>{const e=new URL(r),s=r.startsWith(P)?st(r).filePath:void 0;if(T(r)){if(t.namespace){const o=`${I}${t.namespace}`;e.hash===`#${o}`?e.hash="":e.hash.endsWith(`&${o}`)&&(e.hash=e.hash.slice(0,-o.length-1))}}else e.searchParams.delete("tsx-namespace"),e.searchParams.delete(W),e.searchParams.delete(O);s&&(e.pathname=new URL(S(s)).pathname);const n=e.toString();return t.port&&t.port.postMessage({type:"load",url:n}),t.onImport?.(n),n},"notifyLoad"),Wt=c((t,r)=>{if(!t.active)return!1;const e=w(r);if(t.namespace!==e)return!1;const s=we(t,r);return Ut.send&&Ut.send({type:"dependency",path:s}),!0},"prepareLoad"),Ot=c((t,r)=>{if(!ee.test(t))return r;const e=r[It];return e?.type?r:{...r,[It]:{...e,type:"json"}}},"prepareJsonAttributes"),nt=c(({conditions:t})=>t?.includes("require")===!0&&!t.includes("import"),"isCommonJsRequireContext$1"),Re=c(t=>{const r=c(async(e,s,n)=>{if(!Wt(t,e))return n(e,s);const o=w(e),{fileUrl:a,filePath:i,loadUrl:l}=st(e),f=Ot(l,s),m=await n(l,f);u(3,"loaded by next loader",{url:e,loadUrl:l,loaded:m});const d=a?.searchParams.has(W)===!0,p=m.format,h=a?new URL(S(i)):void 0;if(h&&a&&(h.search=x(a.search,G)),Tt(p)&&a&&m.responseURL?.startsWith("file:")&&!i.endsWith(".cjs")){const g=await oe(S(i),"utf8"),M=Pt(g);if(p==="commonjs-typescript"||!i.endsWith(".js")||M){if(!Pe){if(d&&M&&Z.test(i)){const _=await St(g,i,{define:{"import.meta.url":JSON.stringify(h.toString())},tsconfigRaw:E(i,t)});return $.set(e,_.code),{format:"module",source:U(_)}}return m}if(!o&&!d&&!i.endsWith(".cts"))return m;const dt=!!(o||d||x(a.search,G)),lt=H(g,jt(i,a),{cjsBanner:dt?`require = require("node:module").createRequire(${JSON.stringify(S(i).toString())});`:void 0,tsconfigRaw:E(i,t)});if(m.format="commonjs",m.source=U(lt),dt){const _=Lt(i,a,o);m.responseURL=`data:text/javascript,${encodeURIComponent(lt.code)}?filePath=${encodeURIComponent(_)}`}return u(3,"returning CJS export annotation",m),m}}if(!m.source)return m;const y=Ft(m.source),N=p==="json"&&!nt(s);if(p==="commonjs-typescript"){const g=H(y,i,{tsconfigRaw:E(i,t)});return{...m,format:"commonjs",source:U(g)}}if(N||Et(p)||B.test(e)){const g=await St(y,i,{tsconfigRaw:E(i,t)});return $.set(e,g.code),{format:"module",source:U(g)}}if(m.format==="module"){const g=vt(i,y);g?(m.source=U(g),$.set(e,g.code)):$.set(e,y)}return m},"load");return A?async(e,s,n)=>{u(2,"load",{url:e,context:s});const o=await r(e,s,n);return u(1,"loaded",{url:e,result:o}),o}:r},"createLoad"),Ie=c(t=>{const r=c((e,s,n)=>{if(nt(s)&&tt()||!Wt(t,e))return n(e,s);const o=w(e),{fileUrl:a,filePath:i,loadUrl:l}=st(e),f=Ot(l,s),m=n(l,f);u(3,"loaded by next loader",{url:e,loadUrl:l,loaded:m});const d=m.format;if(Tt(d)&&L(Y)&&m.responseURL?.startsWith("file:")&&!i.endsWith(".cjs")){const y=se(S(i),"utf8");if(d==="commonjs-typescript"||!i.endsWith(".js")||Pt(y)){const N=H(y,jt(i,a),{tsconfigRaw:E(i,t)}),g=!o&&tt(),M=Lt(i,a,o);return m.format="commonjs",m.shouldBeReloadedByCJSLoader=g,m.source=U(N),g||(m.responseURL=`data:text/javascript,${encodeURIComponent(N.code)}?filePath=${encodeURIComponent(M)}`),u(3,"returning CJS export annotation",m),m}}if(!m.source)return m;const p=Ft(m.source),h=d==="json"&&!nt(s);if(d==="commonjs-typescript"){const y=H(p,i,{tsconfigRaw:E(i,t)});return{...m,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:U(y)}}if(h||Et(d)||B.test(e)){const y=ie(p,i,{tsconfigRaw:E(i,t)});return{format:"module",source:U(y)}}if(m.format==="module"){const y=vt(i,p);y&&(m.source=U(y))}return m},"load");return A?(e,s,n)=>{u(2,"loadSync",{url:e,context:s});const o=r(e,s,n);return u(1,"loadedSync",{url:e,result:o}),o}:r},"createLoadSync"),Te=c(t=>{if(q(t)||t.startsWith("#")||t.includes(":"))return!1;const r=t.split("/"),e=r[0]?.startsWith("@")?2:1;return r.length>e&&r.slice(0,e).every(Boolean)},"isBarePackageSubpath"),Ee=c(t=>{const r=t.lastIndexOf(pt);if(r===-1)return;const s=t.slice(r+pt.length).split(v.sep),n=s[0]?.startsWith("@")?2:1;if(!(s.length<=n||!s[n-1]))return v.join(t.slice(0,r),"node_modules",...s.slice(0,n))},"getPackageDirectory"),$t=c((t,r)=>{if(!Te(t)||!r.startsWith(P))return;const e=R(r),s=Ee(e);if(!s)return;const o=et(v.join(s,"package.json"))?.exports;if(o!=null)return{kind:"root-exports"};const a=et(v.join(e,"package.json"));return typeof a?.main!="string"||!a.main?{kind:"legacy-directory"}:{kind:"legacy-directory",mainUrl:S(v.resolve(e,a.main)).toString()}},"getPackageSubpathDirectoryInfo"),je=L(Y),bt=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,Ct=c(t=>!q(t)&&!bt.test(t),"isTsconfigPathAliasSpecifier"),D=c(t=>{if(t.url)return t.url;const r=t.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const e=t.message.match(/^Cannot find package '([^']+)'/);if(e){const[,s]=e;if(!v.isAbsolute(s))return;const n=S(s);if(n.pathname.endsWith("/")&&(n.pathname+="package.json"),n.pathname.endsWith("/package.json")){const o=et(n);if(o?.main)return new URL(o.main,n).toString()}else return n.toString()}},"getMissingPathFromNotFound"),b=c(t=>t==="ERR_MODULE_NOT_FOUND"||t==="MODULE_NOT_FOUND","isModuleNotFound"),X=c(t=>t instanceof Error&&(b(t.code)||t.code==="ERR_UNSUPPORTED_DIR_IMPORT"),"isDirectoryEntryMiss"),k=c(t=>t.conditions.includes("require")&&!t.conditions.includes("import"),"isCommonJsRequireContext"),ot=c(t=>{const r=t.indexOf("?"),e=t.indexOf("#");return r===-1?e:e===-1?r:Math.min(r,e)},"getUrlMetadataIndex"),Jt=c((t,r)=>r||!q(t)&&!bt.test(t)?t.indexOf("?"):ot(t),"getSpecifierMetadataIndex"),Nt=c(t=>{if(t?.startsWith(P))return R(new URL(t))},"getParentFilePath"),Le=c(t=>{if(!t)return!1;const r=Nt(t);if(r)return B.test(r);const e=ot(t);return B.test(e===-1?t:t.slice(0,e))},"isTypeScriptParent"),C=c(t=>{const r=Nt(t);return r!==void 0&&ht(r)},"isParentDependency"),Mt=c(t=>v.extname(new URL(t).pathname)===".js"&&ht(R(t)),"isImplicitJavaScriptDependency"),_t=c((t,r)=>Le(t)||r&&!C(t),"resolvesTsExtensions"),Fe=c((t,r)=>{const e=ot(t),s=e===-1?t:t.slice(0,e);try{if(s.startsWith(P))return R(s);if(v.isAbsolute(s))return s;if(F(s)&&r?.startsWith(P))return R(new URL(s,r))}catch{}},"getProbeFilePath"),At=c((t,r)=>{const e=Fe(t,r);return e!==void 0&&!ne(e)},"candidateDoesntExist"),z=c(async(t,r,e,s)=>{const n=yt(t);if(u(3,"resolveExtensions",{url:t,context:r,throwError:s,tryPaths:n}),!n)return;let o;for(const a of n)if(!At(a,r.parentURL))try{return await e(a,r)}catch(i){const{code:l}=i;if(!b(l)&&l!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw i;o=i}if(s){if(o===void 0)return e(n[0],r);throw o}},"resolveExtensions"),J=c((t,r,e,s)=>{const n=yt(t);if(u(3,"resolveExtensionsSync",{url:t,context:r,throwError:s,tryPaths:n}),!n)return;let o;for(const a of n)if(!At(a,r.parentURL))try{return e(a,r)}catch(i){const{code:l}=i;if(!b(l)&&l!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw i;o=i}if(s){if(o===void 0)return e(n[0],r);throw o}},"resolveExtensionsSync"),We=c(async(t,r,e,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,o=_t(r.parentURL,n);if(u(3,"resolveBase",{specifier:t,context:r,specifierStartsWithFileUrl:t.startsWith(P),isRelativePath:F(t),resolveTsExtensions:o,allowJs:n}),(t.startsWith(P)||F(t))&&o){const a=await z(t,r,e,void 0);if(u(3,"resolveBase resolved",{specifier:t,context:r,resolved:a}),a)return a}try{return await e(t,r)}catch(a){if(u(3,"resolveBase error",{specifier:t,context:r,error:a}),a instanceof Error){const i=a;if(b(i.code)){const l=D(i);if(l){const f=await z(l,r,e,void 0);if(f)return f}}}throw a}},"resolveBase"),at=c((t,r,e,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,o=_t(r.parentURL,n);if(u(3,"resolveBaseSync",{specifier:t,context:r,specifierStartsWithFileUrl:t.startsWith(P),isRelativePath:F(t),resolveTsExtensions:o,allowJs:n}),(t.startsWith(P)||F(t))&&o){const a=J(t,r,e,void 0);if(u(3,"resolveBaseSync resolved",{specifier:t,context:r,resolved:a}),a)return a}try{return e(t,r)}catch(a){if(u(3,"resolveBaseSync error",{specifier:t,context:r,error:a}),a instanceof Error){const i=a;if(b(i.code)){const l=D(i);if(l){const f=J(l,r,e,void 0);if(f)return f}}}throw a}},"resolveBaseSync"),it=c(async(t,r,e,s)=>{if(u(3,"resolveDirectory",{specifier:t,context:r,isDirectory:Q.test(t)}),(t==="."||t===".."||t.endsWith("/.."))&&(t+="/"),Q.test(t)){const n=new URL(t,r.parentURL);return n.pathname=v.join(n.pathname,"index"),await z(n.toString(),r,e,!0)}try{return await We(t,r,e,s)}catch(n){if(n instanceof Error){u(3,"resolveDirectory error",{specifier:t,context:r,error:n});const o=n;if(o.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const a=D(o);if(a){if(t.startsWith("#"))throw n;const i=$t(t,a);if(i?.kind==="root-exports")throw n;if(i?.mainUrl){try{return await e(i.mainUrl,r)}catch(m){if(!X(m))throw m}try{return await it(i.mainUrl,r,e,s)}catch(m){if(!X(m))throw m}}const l=`${a}/index`,f=await z(l,r,e);if(f)return f}}}throw n}},"resolveDirectory"),ct=c((t,r,e,s)=>{if(u(3,"resolveDirectorySync",{specifier:t,context:r,isDirectory:Q.test(t)}),(t==="."||t===".."||t.endsWith("/.."))&&(t+="/"),Q.test(t)){const n=k(r);if(n&&!q(t))return at(t,r,e,s);const o=new URL(t,r.parentURL);return o.pathname=v.join(o.pathname,"index"),n?J(R(o),r,e,!1)??at(t,r,e,s):J(o.toString(),r,e,!0)}try{return at(t,r,e,s)}catch(n){if(n instanceof Error){u(3,"resolveDirectorySync error",{specifier:t,context:r,error:n});const o=n;if(o.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const a=D(o);if(a){if(t.startsWith("#"))throw n;const i=$t(t,a);if(i?.kind==="root-exports")throw n;if(i?.mainUrl){try{return e(i.mainUrl,r)}catch(m){if(!X(m))throw m}try{return ct(i.mainUrl,r,e,s)}catch(m){if(!X(m))throw m}}const l=`${a}/index`,f=J(l,r,e);if(f)return f}}}throw n}},"resolveDirectorySync"),Oe=c(async(t,r,e,s)=>{const n=Ct(t);if(u(3,"resolveTsPaths",{specifier:t,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:C(r.parentURL)}),n&&s.parsedTsconfig&&!C(r.parentURL)){const o=gt(s.parsedTsconfig,t);u(3,"resolveTsPaths",{possiblePaths:o});for(const a of o)try{return await it(S(a).toString(),r,e,s)}catch{}}return it(t,r,e,s)},"resolveTsPaths"),$e=c((t,r,e,s)=>{const n=Ct(t);if(u(3,"resolveTsPathsSync",{specifier:t,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:C(r.parentURL)}),n&&s.parsedTsconfig&&!C(r.parentURL)){const o=gt(s.parsedTsconfig,t);u(3,"resolveTsPathsSync",{possiblePaths:o});for(const a of o)try{return ct(S(a).toString(),r,e,s)}catch{}}return ct(t,r,e,s)},"resolveTsPathsSync"),V="tsx://",mt=c((t,r)=>{const e=t.indexOf("#"),s=e===-1?t:t.slice(0,e),n=e===-1?"":t.slice(e);return`${s}${s.includes("?")?"&":"?"}${r}${n}`},"addQuery"),K=c((t,r)=>T(t)?`${t}${t.includes("#")?"&":"#"}${I}${r}`:mt(t,`${I}${r}`),"addNamespace"),Bt=c((t,r)=>{const e=r.indexOf("#"),s=r[0]==="?"?r.slice(1,e===-1?void 0:e):"",n=e===-1?"":r.slice(e),o=t.indexOf("#"),a=o===-1?t:t.slice(0,o),i=o===-1?"":t.slice(o),l=s?mt(a,s):a;return new URL(`${l}${n||i}`).toString()},"mergeUrlMetadata"),qt=c((t,r,e)=>{if(r!=="commonjs"||!t.startsWith(P)||!Z.test(t))return t;const s=new URL(t),n=[rt(s.search,[I]),...e?[`namespace=${encodeURIComponent(e)}`]:[]].filter(Boolean).join("&");return n?(s.pathname+=`%3F${n}`,s.searchParams.set(O,"1"),s.toString()):t},"preserveCommonJsQueryIdentity"),be=c(t=>{const r=c(async(e,s,n)=>{if(!t.active||e.startsWith("node:"))return n(e,s);const o=s.parentURL&&w(s.parentURL);let a=T(e)?o:w(e)??o;if(t.namespace){let h;if(e.startsWith(V)){try{h=JSON.parse(e.slice(V.length))}catch{}h?.namespace&&(a=h.namespace)}if(t.namespace!==a)return n(e,s);h&&(e=h.specifier,s.parentURL=h.parentURL)}if(T(e)){const h=await n(e,s);return t.namespace?{...h,url:K(h.url,t.namespace)}:h}const i=Jt(e,k(s)),l=i===-1?e:e.slice(0,i),f=i===-1?"":e.slice(i),m=await Oe(l,s,n,t);if(u(2,"nextResolve",{resolved:m}),m.format==="builtin")return m;const d={...m};d.url.startsWith(P)&&(d.format==="module-typescript"?d.format="module":d.format==="commonjs-typescript"?d.format="commonjs":!d.format&&!Mt(d.url)&&(d.format=await le(d.url),u(2,"getFormatFromFileUrl",{resolved:d,format:d.format}))),f&&(d.url=Bt(d.url,f));const p=s.parentURL&&d.format==="commonjs"&&Z.test(d.url)&&(new URL(s.parentURL).searchParams.has(W)||ye(s.parentURL,e,je));return a&&w(d.url)===void 0&&(d.url=K(d.url,a)),p&&(d.url=mt(d.url,fe)),(a||p)&&(d.url=qt(d.url,d.format,a)),d},"resolve");return A?async(e,s,n)=>{u(2,"resolve",{specifier:e,context:s});const o=await r(e,s,n);return u(1,"resolved",{specifier:e,context:s,result:o}),o}:r},"createResolve"),Ce=c(t=>{const r=c((e,s,n)=>{if(!t.active||e.startsWith("node:")||k(s)&&tt())return n(e,s);const o=s.parentURL&&w(s.parentURL);let a=T(e)?o:w(e)??o;if(t.namespace){let p;if(e.startsWith(V)){try{p=JSON.parse(e.slice(V.length))}catch{}p?.namespace&&(a=p.namespace)}if(t.namespace!==a)return n(e,s);p&&(e=p.specifier,s.parentURL=p.parentURL)}if(T(e)){const p=n(e,s);return t.namespace?{...p,url:K(p.url,t.namespace)}:p}const i=Jt(e,k(s)),l=i===-1?e:e.slice(0,i),f=i===-1?"":e.slice(i),m=$e(l,s,n,t);if(u(2,"nextResolve",{resolved:m}),m.format==="builtin")return m;const d={...m};return d.url.startsWith(P)&&(d.format==="module-typescript"?d.format="module":d.format==="commonjs-typescript"?d.format="commonjs":!d.format&&!Mt(d.url)&&(d.format=ue(d.url),u(2,"getFormatFromFileUrlSync",{resolved:d,format:d.format}))),f&&(d.url=Bt(d.url,f)),a&&w(d.url)===void 0&&(d.url=K(d.url,a)),d.url=qt(d.url,d.format,a),d},"resolve");return A?(e,s,n)=>{u(2,"resolveSync",{specifier:e,context:s});const o=r(e,s,n);return u(1,"resolvedSync",{specifier:e,context:s,result:o}),o}:r},"createResolveSync"),Qt=c(t=>(r,e)=>{if(!e)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=e.startsWith(P)?e:S(e).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:t})}`)},"createScopedImport");let Ht=!1;const Je=c(t=>{const r=[];for(let e=0;e<t.length;e+=1){const s=t[e];if(s==="--import"){const n=t[e+1];n&&r.push(n),e+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),Ne=c(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,t])=>t),"collectNodeOptionsImportSpecifiers"),xt=[new URL("loader.mjs",import.meta.url).toString(),new URL("esm/index.mjs",import.meta.url).toString()],Me=new Set(["tsx","tsx/esm",...xt,...xt.map(t=>decodeURI(new URL(t).pathname))]),_e=c(t=>Me.has(t),"isTsxImport"),Gt=c(t=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(t),"isTypeScriptImport"),Ae=c(()=>{const t=Je(process.execArgv),r=t.findIndex(_e);return r>0&&t.slice(0,r).some(Gt)},"hasCliTypeScriptPreload"),Be=Ne().some(Gt)||Ae(),Dt=typeof j.registerHooks=="function"&&L(Kt)&&!Be,qe=c(t=>{if(!j.register&&!Dt)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!Ht){const{_resolveFilename:i}=j;j._resolveFilename=(l,...f)=>i(re(l),...f),Ht=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),Dt){const i=wt({namespace:t?.namespace,onImport:t?.onImport,tsconfig:t?.tsconfig}),l=j.registerHooks({load:Ie(i),resolve:Ce(i)}),f=c(async()=>{i.active=!1,l.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return t?.namespace&&(f.import=Qt(t.namespace),f.unregister=f),f}const{port1:e,port2:s}=new zt;j.register(`./esm/index.mjs?${kt.randomUUID()}`,{parentURL:import.meta.url,data:{port:s,namespace:t?.namespace,tsconfig:t?.tsconfig},transferList:[s]});const n=t?.onImport,o=n&&(i=>{i.type==="load"&&n(i.url)});o&&(e.on("message",o),e.unref());const a=c(()=>(r===!1&&process.setSourceMapsEnabled(!1),o&&e.off("message",o),e.postMessage("deactivate"),new Promise(i=>{const l=c(f=>{f.type==="deactivated"&&(i(),e.off("message",l))},"onDeactivated");e.on("message",l)})),"unregister");return t?.namespace&&(a.import=Qt(t.namespace),a.unregister=a),a},"register");export{de as a,Re as b,me as c,be as d,ce as e,qe as r}; |
| "use strict";var Ie=Object.defineProperty;var l=(e,r)=>Ie(e,"name",{value:r,configurable:!0});var je=require("node:crypto"),w=require("node:module"),We=require("node:worker_threads"),R=require("./node-features-CEjg7cMX.cjs"),o=require("./register-CRHZwkwo.cjs"),h=require("node:url"),te=require("node:fs"),be=require("node:fs/promises"),y=require("./index-LWEOpzQe.cjs"),re=require("./client-D3mGB526.cjs"),S=require("node:path"),F=typeof document<"u"?document.currentScript:null;const Me=l(()=>({active:!0,parsedTsconfig:void 0}),"createDefaultData"),se=l(e=>{const r={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(r.parsedTsconfig=o.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),Oe=l(e=>async r=>{if(!r)throw new Error(`tsx must be loaded with --import instead of --loader | ||
| The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(e,se(r)),r.port&&r.port.on("message",t=>{t==="deactivate"&&(e.active=!1,r.port.postMessage({type:"deactivated"}))})},"createInitialize"),$e=l(e=>()=>(e.parsedTsconfig=o.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"createGlobalPreload"),Ce=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||o.tsExtensions.includes(t))return o.getPackageType(e)},"getFormatFromFileUrl"),Je=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||o.tsExtensions.includes(t))return o.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),ne="tsx-namespace",E=`${ne}=`,I="tsx-commonjs-export-preparse",_e=`${I}=1`,j="tsx-commonjs-virtual-query",W=new Map,Ne=/^data:/i,T=l(e=>Ne.test(e),"isDataUrl"),H=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),_=l((e,r)=>{const t=H(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),qe=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Ae=l(e=>{const r=qe(e);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const t=r.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(s=>{const n=s.trim().split(/\s+as\s+/)[0];return!!(n&&n!=="default")})?"named":void 0},"getCommonJsImportBinding"),xe=l((e,r,t)=>{const s=W.get(e);if(!s)return!1;try{const[n]=y.parseEsm(s);return n.some(a=>{if(a.d!==-1||a.n!==r)return!1;const i=Ae(s.slice(a.ss,a.s));return i==="named"||t&&i==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),v=l(e=>{const r=e.indexOf("?"),t=e.indexOf("#");if(T(e)){if(t===-1)return;const s=e.slice(t+1),n=s.lastIndexOf("&"),a=s.slice(n+1);return a.startsWith(E)?a.slice(E.length):void 0}if(!(r===-1||t!==-1&&t<r))return new URLSearchParams(e.slice(r,t===-1?void 0:t)).get(ne)??void 0},"getNamespace"),oe=R.isFeatureSupported(R.importAttributes)?"importAttributes":"importAssertions",ae=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),ie=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Be=R.isFeatureSupported(R.esmLoadReadFile),Qe=[`${j}=`],N=[`${I}=`,`${j}=`],L=l((e,r)=>r.parsedTsconfig&&o.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),De=l(e=>{if(!e.searchParams.has(j))return;const{pathname:r}=e,t=r.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const s=new URL(e);return s.pathname=r.slice(0,t),s.search="",h.fileURLToPath(s)},"getFilePathFromVirtualQuery"),G=l(e=>{const r=e.startsWith(o.fileUrlPrefix)?new URL(e):void 0,t=r?h.fileURLToPath(r):e,s=r&&De(r),n=s||t,a=r&&s?h.pathToFileURL(n).toString()+_(r.search,Qe):e;return{fileUrl:r,filePath:n,loadUrl:a}},"getFileLoadContext"),ce=l((e,r)=>{if(!r?.search)return e;const t=_(r.search,N);return t?h.pathToFileURL(e).toString()+t:e},"getTransformPath"),le=l((e,r,t)=>{const s=[...r?H(r.search,[E,...N]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),He=new TextDecoder,me=l(e=>typeof e=="string"?e:He.decode(e),"decodeSource"),Ge=l((e,r)=>{const t=new URL(r),s=r.startsWith(o.fileUrlPrefix)?G(r).filePath:void 0;if(T(r)){if(e.namespace){const a=`${E}${e.namespace}`;t.hash===`#${a}`?t.hash="":t.hash.endsWith(`&${a}`)&&(t.hash=t.hash.slice(0,-a.length-1))}}else t.searchParams.delete("tsx-namespace"),t.searchParams.delete(I),t.searchParams.delete(j);s&&(t.pathname=new URL(h.pathToFileURL(s)).pathname);const n=t.toString();return e.port&&e.port.postMessage({type:"load",url:n}),e.onImport?.(n),n},"notifyLoad"),de=l((e,r)=>{if(!e.active)return!1;const t=v(r);if(e.namespace!==t)return!1;const s=Ge(e,r);return re.parent.send&&re.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),ue=l((e,r)=>{if(!o.isJsonPattern.test(e))return r;const t=r[oe];return t?.type?r:{...r,[oe]:{...t,type:"json"}}},"prepareJsonAttributes"),z=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),ze=l(e=>{const r=l(async(t,s,n)=>{if(!de(e,t))return n(t,s);const a=v(t),{fileUrl:i,filePath:c,loadUrl:u}=G(t),f=ue(u,s),m=await n(u,f);o.logEsm(3,"loaded by next loader",{url:t,loadUrl:u,loaded:m});const d=i?.searchParams.has(I)===!0,p=m.format,g=i?new URL(h.pathToFileURL(c)):void 0;if(g&&i&&(g.search=_(i.search,N)),ae(p)&&i&&m.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const P=await be.readFile(h.pathToFileURL(c),"utf8"),C=y.isESM(P);if(p==="commonjs-typescript"||!c.endsWith(".js")||C){if(!Be){if(d&&C&&o.implicitTsExtensionsPattern.test(c)){const J=await y.transform(P,c,{define:{"import.meta.url":JSON.stringify(g.toString())},tsconfigRaw:L(c,e)});return W.set(t,J.code),{format:"module",source:o.inlineSourceMap(J)}}return m}if(!a&&!d&&!c.endsWith(".cts"))return m;const Z=!!(a||d||_(i.search,N)),ee=y.transformSync(P,ce(c,i),{cjsBanner:Z?`require = require("node:module").createRequire(${JSON.stringify(h.pathToFileURL(c).toString())});`:void 0,tsconfigRaw:L(c,e)});if(m.format="commonjs",m.source=o.inlineSourceMap(ee),Z){const J=le(c,i,a);m.responseURL=`data:text/javascript,${encodeURIComponent(ee.code)}?filePath=${encodeURIComponent(J)}`}return o.logEsm(3,"returning CJS export annotation",m),m}}if(!m.source)return m;const U=me(m.source),$=p==="json"&&!z(s);if(p==="commonjs-typescript"){const P=y.transformSync(U,c,{tsconfigRaw:L(c,e)});return{...m,format:"commonjs",source:o.inlineSourceMap(P)}}if($||ie(p)||o.tsExtensionsPattern.test(t)){const P=await y.transform(U,c,{tsconfigRaw:L(c,e)});return W.set(t,P.code),{format:"module",source:o.inlineSourceMap(P)}}if(m.format==="module"){const P=y.transformDynamicImport(c,U);P?(m.source=o.inlineSourceMap(P),W.set(t,P.code)):W.set(t,U)}return m},"load");return o.debugEnabled?async(t,s,n)=>{o.logEsm(2,"load",{url:t,context:s});const a=await r(t,s,n);return o.logEsm(1,"loaded",{url:t,result:a}),a}:r},"createLoad"),Xe=l(e=>{const r=l((t,s,n)=>{if(z(s)&&o.isGlobalCjsLoaderActive()||!de(e,t))return n(t,s);const a=v(t),{fileUrl:i,filePath:c,loadUrl:u}=G(t),f=ue(u,s),m=n(u,f);o.logEsm(3,"loaded by next loader",{url:t,loadUrl:u,loaded:m});const d=m.format;if(ae(d)&&R.isFeatureSupported(R.esmLoadReadFile)&&m.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const U=te.readFileSync(h.pathToFileURL(c),"utf8");if(d==="commonjs-typescript"||!c.endsWith(".js")||y.isESM(U)){const $=y.transformSync(U,ce(c,i),{tsconfigRaw:L(c,e)}),P=!a&&o.isGlobalCjsLoaderActive(),C=le(c,i,a);return m.format="commonjs",m.shouldBeReloadedByCJSLoader=P,m.source=o.inlineSourceMap($),P||(m.responseURL=`data:text/javascript,${encodeURIComponent($.code)}?filePath=${encodeURIComponent(C)}`),o.logEsm(3,"returning CJS export annotation",m),m}}if(!m.source)return m;const p=me(m.source),g=d==="json"&&!z(s);if(d==="commonjs-typescript"){const U=y.transformSync(p,c,{tsconfigRaw:L(c,e)});return{...m,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:o.inlineSourceMap(U)}}if(g||ie(d)||o.tsExtensionsPattern.test(t)){const U=y.transformEsmSync(p,c,{tsconfigRaw:L(c,e)});return{format:"module",source:o.inlineSourceMap(U)}}if(m.format==="module"){const U=y.transformDynamicImport(c,p);U&&(m.source=o.inlineSourceMap(U))}return m},"load");return o.debugEnabled?(t,s,n)=>{o.logEsm(2,"loadSync",{url:t,context:s});const a=r(t,s,n);return o.logEsm(1,"loadedSync",{url:t,result:a}),a}:r},"createLoadSync"),ke=l(e=>{if(o.isFilePath(e)||e.startsWith("#")||e.includes(":"))return!1;const r=e.split("/"),t=r[0]?.startsWith("@")?2:1;return r.length>t&&r.slice(0,t).every(Boolean)},"isBarePackageSubpath"),Ve=l(e=>{const r=e.lastIndexOf(o.nodeModulesPath);if(r===-1)return;const s=e.slice(r+o.nodeModulesPath.length).split(S.sep),n=s[0]?.startsWith("@")?2:1;if(!(s.length<=n||!s[n-1]))return S.join(e.slice(0,r),"node_modules",...s.slice(0,n))},"getPackageDirectory"),fe=l((e,r)=>{if(!ke(e)||!r.startsWith(o.fileUrlPrefix))return;const t=h.fileURLToPath(r),s=Ve(t);if(!s)return;const a=y.readJsonFile(S.join(s,"package.json"))?.exports;if(a!=null)return{kind:"root-exports"};const i=y.readJsonFile(S.join(t,"package.json"));return typeof i?.main!="string"||!i.main?{kind:"legacy-directory"}:{kind:"legacy-directory",mainUrl:h.pathToFileURL(S.resolve(t,i.main)).toString()}},"getPackageSubpathDirectoryInfo"),Ke=R.isFeatureSupported(R.esmLoadReadFile),pe=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,he=l(e=>!o.isFilePath(e)&&!pe.test(e),"isTsconfigPathAliasSpecifier"),q=l(e=>{if(e.url)return e.url;const r=e.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,s]=t;if(!S.isAbsolute(s))return;const n=h.pathToFileURL(s);if(n.pathname.endsWith("/")&&(n.pathname+="package.json"),n.pathname.endsWith("/package.json")){const a=y.readJsonFile(n);if(a?.main)return new URL(a.main,n).toString()}else return n.toString()}},"getMissingPathFromNotFound"),b=l(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),A=l(e=>e instanceof Error&&(b(e.code)||e.code==="ERR_UNSUPPORTED_DIR_IMPORT"),"isDirectoryEntryMiss"),x=l(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),X=l(e=>{const r=e.indexOf("?"),t=e.indexOf("#");return r===-1?t:t===-1?r:Math.min(r,t)},"getUrlMetadataIndex"),ge=l((e,r)=>r||!o.isFilePath(e)&&!pe.test(e)?e.indexOf("?"):X(e),"getSpecifierMetadataIndex"),Pe=l(e=>{if(e?.startsWith(o.fileUrlPrefix))return h.fileURLToPath(new URL(e))},"getParentFilePath"),Ye=l(e=>{if(!e)return!1;const r=Pe(e);if(r)return o.tsExtensionsPattern.test(r);const t=X(e);return o.tsExtensionsPattern.test(t===-1?e:e.slice(0,t))},"isTypeScriptParent"),M=l(e=>{const r=Pe(e);return r!==void 0&&o.isDependencyPath(r)},"isParentDependency"),ye=l(e=>S.extname(new URL(e).pathname)===".js"&&o.isDependencyPath(h.fileURLToPath(e)),"isImplicitJavaScriptDependency"),Ue=l((e,r)=>Ye(e)||r&&!M(e),"resolvesTsExtensions"),Ze=l((e,r)=>{const t=X(e),s=t===-1?e:e.slice(0,t);try{if(s.startsWith(o.fileUrlPrefix))return h.fileURLToPath(s);if(S.isAbsolute(s))return s;if(o.isRelativePath(s)&&r?.startsWith(o.fileUrlPrefix))return h.fileURLToPath(new URL(s,r))}catch{}},"getProbeFilePath"),Se=l((e,r)=>{const t=Ze(e,r);return t!==void 0&&!te.existsSync(t)},"candidateDoesntExist"),B=l(async(e,r,t,s)=>{const n=o.getExtensionResolution(e);if(o.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:n}),!n)return;let a;for(const i of n)if(!Se(i,r.parentURL))try{return await t(i,r)}catch(c){const{code:u}=c;if(!b(u)&&u!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(s){if(a===void 0)return t(n[0],r);throw a}},"resolveExtensions"),O=l((e,r,t,s)=>{const n=o.getExtensionResolution(e);if(o.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:n}),!n)return;let a;for(const i of n)if(!Se(i,r.parentURL))try{return t(i,r)}catch(c){const{code:u}=c;if(!b(u)&&u!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(s){if(a===void 0)return t(n[0],r);throw a}},"resolveExtensionsSync"),et=l(async(e,r,t,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,a=Ue(r.parentURL,n);if(o.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(o.fileUrlPrefix),isRelativePath:o.isRelativePath(e),resolveTsExtensions:a,allowJs:n}),(e.startsWith(o.fileUrlPrefix)||o.isRelativePath(e))&&a){const i=await B(e,r,t,void 0);if(o.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return await t(e,r)}catch(i){if(o.logEsm(3,"resolveBase error",{specifier:e,context:r,error:i}),i instanceof Error){const c=i;if(b(c.code)){const u=q(c);if(u){const f=await B(u,r,t,void 0);if(f)return f}}}throw i}},"resolveBase"),k=l((e,r,t,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,a=Ue(r.parentURL,n);if(o.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(o.fileUrlPrefix),isRelativePath:o.isRelativePath(e),resolveTsExtensions:a,allowJs:n}),(e.startsWith(o.fileUrlPrefix)||o.isRelativePath(e))&&a){const i=O(e,r,t,void 0);if(o.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return t(e,r)}catch(i){if(o.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:i}),i instanceof Error){const c=i;if(b(c.code)){const u=q(c);if(u){const f=O(u,r,t,void 0);if(f)return f}}}throw i}},"resolveBaseSync"),V=l(async(e,r,t,s)=>{if(o.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:o.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),o.isDirectoryPattern.test(e)){const n=new URL(e,r.parentURL);return n.pathname=S.join(n.pathname,"index"),await B(n.toString(),r,t,!0)}try{return await et(e,r,t,s)}catch(n){if(n instanceof Error){o.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:n});const a=n;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const i=q(a);if(i){if(e.startsWith("#"))throw n;const c=fe(e,i);if(c?.kind==="root-exports")throw n;if(c?.mainUrl){try{return await t(c.mainUrl,r)}catch(m){if(!A(m))throw m}try{return await V(c.mainUrl,r,t,s)}catch(m){if(!A(m))throw m}}const u=`${i}/index`,f=await B(u,r,t);if(f)return f}}}throw n}},"resolveDirectory"),K=l((e,r,t,s)=>{if(o.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:o.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),o.isDirectoryPattern.test(e)){const n=x(r);if(n&&!o.isFilePath(e))return k(e,r,t,s);const a=new URL(e,r.parentURL);return a.pathname=S.join(a.pathname,"index"),n?O(h.fileURLToPath(a),r,t,!1)??k(e,r,t,s):O(a.toString(),r,t,!0)}try{return k(e,r,t,s)}catch(n){if(n instanceof Error){o.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:n});const a=n;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const i=q(a);if(i){if(e.startsWith("#"))throw n;const c=fe(e,i);if(c?.kind==="root-exports")throw n;if(c?.mainUrl){try{return t(c.mainUrl,r)}catch(m){if(!A(m))throw m}try{return K(c.mainUrl,r,t,s)}catch(m){if(!A(m))throw m}}const u=`${i}/index`,f=O(u,r,t);if(f)return f}}}throw n}},"resolveDirectorySync"),tt=l(async(e,r,t,s)=>{const n=he(e);if(o.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:M(r.parentURL)}),n&&s.parsedTsconfig&&!M(r.parentURL)){const a=o.wt(s.parsedTsconfig,e);o.logEsm(3,"resolveTsPaths",{possiblePaths:a});for(const i of a)try{return await V(h.pathToFileURL(i).toString(),r,t,s)}catch{}}return V(e,r,t,s)},"resolveTsPaths"),rt=l((e,r,t,s)=>{const n=he(e);if(o.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:M(r.parentURL)}),n&&s.parsedTsconfig&&!M(r.parentURL)){const a=o.wt(s.parsedTsconfig,e);o.logEsm(3,"resolveTsPathsSync",{possiblePaths:a});for(const i of a)try{return K(h.pathToFileURL(i).toString(),r,t,s)}catch{}}return K(e,r,t,s)},"resolveTsPathsSync"),Q="tsx://",Y=l((e,r)=>{const t=e.indexOf("#"),s=t===-1?e:e.slice(0,t),n=t===-1?"":e.slice(t);return`${s}${s.includes("?")?"&":"?"}${r}${n}`},"addQuery"),D=l((e,r)=>T(e)?`${e}${e.includes("#")?"&":"#"}${E}${r}`:Y(e,`${E}${r}`),"addNamespace"),Re=l((e,r)=>{const t=r.indexOf("#"),s=r[0]==="?"?r.slice(1,t===-1?void 0:t):"",n=t===-1?"":r.slice(t),a=e.indexOf("#"),i=a===-1?e:e.slice(0,a),c=a===-1?"":e.slice(a),u=s?Y(i,s):i;return new URL(`${u}${n||c}`).toString()},"mergeUrlMetadata"),ve=l((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(o.fileUrlPrefix)||!o.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),n=[H(s.search,[E]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return n?(s.pathname+=`%3F${n}`,s.searchParams.set(j,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),st=l(e=>{const r=l(async(t,s,n)=>{if(!e.active||t.startsWith("node:"))return n(t,s);const a=s.parentURL&&v(s.parentURL);let i=T(t)?a:v(t)??a;if(e.namespace){let g;if(t.startsWith(Q)){try{g=JSON.parse(t.slice(Q.length))}catch{}g?.namespace&&(i=g.namespace)}if(e.namespace!==i)return n(t,s);g&&(t=g.specifier,s.parentURL=g.parentURL)}if(T(t)){const g=await n(t,s);return e.namespace?{...g,url:D(g.url,e.namespace)}:g}const c=ge(t,x(s)),u=c===-1?t:t.slice(0,c),f=c===-1?"":t.slice(c),m=await tt(u,s,n,e);if(o.logEsm(2,"nextResolve",{resolved:m}),m.format==="builtin")return m;const d={...m};d.url.startsWith(o.fileUrlPrefix)&&(d.format==="module-typescript"?d.format="module":d.format==="commonjs-typescript"?d.format="commonjs":!d.format&&!ye(d.url)&&(d.format=await Ce(d.url),o.logEsm(2,"getFormatFromFileUrl",{resolved:d,format:d.format}))),f&&(d.url=Re(d.url,f));const p=s.parentURL&&d.format==="commonjs"&&o.implicitTsExtensionsPattern.test(d.url)&&(new URL(s.parentURL).searchParams.has(I)||xe(s.parentURL,t,Ke));return i&&v(d.url)===void 0&&(d.url=D(d.url,i)),p&&(d.url=Y(d.url,_e)),(i||p)&&(d.url=ve(d.url,d.format,i)),d},"resolve");return o.debugEnabled?async(t,s,n)=>{o.logEsm(2,"resolve",{specifier:t,context:s});const a=await r(t,s,n);return o.logEsm(1,"resolved",{specifier:t,context:s,result:a}),a}:r},"createResolve"),nt=l(e=>{const r=l((t,s,n)=>{if(!e.active||t.startsWith("node:")||x(s)&&o.isGlobalCjsLoaderActive())return n(t,s);const a=s.parentURL&&v(s.parentURL);let i=T(t)?a:v(t)??a;if(e.namespace){let p;if(t.startsWith(Q)){try{p=JSON.parse(t.slice(Q.length))}catch{}p?.namespace&&(i=p.namespace)}if(e.namespace!==i)return n(t,s);p&&(t=p.specifier,s.parentURL=p.parentURL)}if(T(t)){const p=n(t,s);return e.namespace?{...p,url:D(p.url,e.namespace)}:p}const c=ge(t,x(s)),u=c===-1?t:t.slice(0,c),f=c===-1?"":t.slice(c),m=rt(u,s,n,e);if(o.logEsm(2,"nextResolve",{resolved:m}),m.format==="builtin")return m;const d={...m};return d.url.startsWith(o.fileUrlPrefix)&&(d.format==="module-typescript"?d.format="module":d.format==="commonjs-typescript"?d.format="commonjs":!d.format&&!ye(d.url)&&(d.format=Je(d.url),o.logEsm(2,"getFormatFromFileUrlSync",{resolved:d,format:d.format}))),f&&(d.url=Re(d.url,f)),i&&v(d.url)===void 0&&(d.url=D(d.url,i)),d.url=ve(d.url,d.format,i),d},"resolve");return o.debugEnabled?(t,s,n)=>{o.logEsm(2,"resolveSync",{specifier:t,context:s});const a=r(t,s,n);return o.logEsm(1,"resolvedSync",{specifier:t,context:s,result:a}),a}:r},"createResolveSync"),Ee=l(e=>(r,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=t.startsWith(o.fileUrlPrefix)?t:h.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let Te=!1;const ot=l(e=>{const r=[];for(let t=0;t<e.length;t+=1){const s=e[t];if(s==="--import"){const n=e[t+1];n&&r.push(n),t+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),at=l(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),Le=[new URL("loader.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:F&&F.src||new URL("register-D3Z1kaw7.cjs",document.baseURI).href).toString(),new URL("esm/index.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:F&&F.src||new URL("register-D3Z1kaw7.cjs",document.baseURI).href).toString()],it=new Set(["tsx","tsx/esm",...Le,...Le.map(e=>decodeURI(new URL(e).pathname))]),ct=l(e=>it.has(e),"isTsxImport"),we=l(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),lt=l(()=>{const e=ot(process.execArgv),r=e.findIndex(ct);return r>0&&e.slice(0,r).some(we)},"hasCliTypeScriptPreload"),mt=at().some(we)||lt(),Fe=typeof w.registerHooks=="function"&&R.isFeatureSupported(R.moduleRegisterHooksCjsReload)&&!mt,dt=l(e=>{if(!w.register&&!Fe)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!Te){const{_resolveFilename:c}=w;w._resolveFilename=(u,...f)=>c(o.interopCjsExports(u),...f),Te=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),Fe){const c=se({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),u=w.registerHooks({load:Xe(c),resolve:nt(c)}),f=l(async()=>{c.active=!1,u.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(f.import=Ee(e.namespace),f.unregister=f),f}const{port1:t,port2:s}=new We.MessageChannel;w.register(`./esm/index.mjs?${je.randomUUID()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:F&&F.src||new URL("register-D3Z1kaw7.cjs",document.baseURI).href,data:{port:s,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[s]});const n=e?.onImport,a=n&&(c=>{c.type==="load"&&n(c.url)});a&&(t.on("message",a),t.unref());const i=l(()=>(r===!1&&process.setSourceMapsEnabled(!1),a&&t.off("message",a),t.postMessage("deactivate"),new Promise(c=>{const u=l(f=>{f.type==="deactivated"&&(c(),t.off("message",u))},"onDeactivated");t.on("message",u)})),"unregister");return e?.namespace&&(i.import=Ee(e.namespace),i.unregister=i),i},"register");exports.createDefaultData=Me,exports.createGlobalPreload=$e,exports.createInitialize=Oe,exports.createLoad=ze,exports.createResolve=st,exports.register=dt; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var m=Object.defineProperty;var q=(r,e)=>m(r,"name",{value:e,configurable:!0});var s=require("../../register-BYFLLcJ9.cjs"),c=require("node:crypto");require("../../get-pipe-path-D4YM6rQt.cjs");var t=require("../../register-CRHZwkwo.cjs");require("../../require-BomokLx3.cjs");var n=require("../../node-features-CEjg7cMX.cjs");require("node:module"),require("node:worker_threads"),require("node:url"),require("node:fs"),require("node:fs/promises"),require("../../index-LWEOpzQe.cjs"),require("node:path"),require("esbuild"),require("node:os"),require("../../temporary-directory-B83uKxJF.cjs"),require("../../client-D3mGB526.cjs"),require("node:net"),require("module"),require("fs"),require("os"),require("path"),require("node:util"),require("../../index-BWFBUo6r.cjs");const g=q((r,e)=>{if(!e||typeof e=="object"&&!e.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const i=typeof e=="string",u=i?e:e.parentURL,a=c.randomUUID(),o=t.register({namespace:a});return!n.isFeatureSupported(n.esmLoadReadFile)&&!t.isBarePackageNamePattern.test(r)&&t.cjsExtensionPattern.test(r)?Promise.resolve(o.require(r,u)):s.register({namespace:a,...i?{}:e}).import(r,u)},"tsImport");exports.register=s.register,exports.tsImport=g; | ||
| "use strict";var m=Object.defineProperty;var q=(r,e)=>m(r,"name",{value:e,configurable:!0});var s=require("../../register-D3Z1kaw7.cjs"),c=require("node:crypto");require("../../get-pipe-path-D4YM6rQt.cjs");var t=require("../../register-CRHZwkwo.cjs");require("../../require-BomokLx3.cjs");var n=require("../../node-features-CEjg7cMX.cjs");require("node:module"),require("node:worker_threads"),require("node:url"),require("node:fs"),require("node:fs/promises"),require("../../index-LWEOpzQe.cjs"),require("node:path"),require("esbuild"),require("node:os"),require("../../temporary-directory-B83uKxJF.cjs"),require("../../client-D3mGB526.cjs"),require("node:net"),require("module"),require("fs"),require("os"),require("path"),require("node:util"),require("../../index-BWFBUo6r.cjs");const g=q((r,e)=>{if(!e||typeof e=="object"&&!e.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const i=typeof e=="string",u=i?e:e.parentURL,a=c.randomUUID(),o=t.register({namespace:a});return!n.isFeatureSupported(n.esmLoadReadFile)&&!t.isBarePackageNamePattern.test(r)&&t.cjsExtensionPattern.test(r)?Promise.resolve(o.require(r,u)):s.register({namespace:a,...i?{}:e}).import(r,u)},"tsImport");exports.register=s.register,exports.tsImport=g; |
@@ -1,1 +0,1 @@ | ||
| var s=Object.defineProperty;var i=(t,r)=>s(t,"name",{value:r,configurable:!0});import{r as p}from"../../register-45NAB8gE.mjs";import n from"node:crypto";import"../../get-pipe-path-_tAJyU_v.mjs";import{r as c,i as u,c as d}from"../../register-DjEWBuYC.mjs";import"../../require-DLrt45w5.mjs";import{i as f,e as g}from"../../node-features-JeyyvQz6.mjs";import"node:module";import"node:worker_threads";import"node:url";import"node:fs";import"node:fs/promises";import"../../index-CVGQLgGk.mjs";import"node:path";import"esbuild";import"node:os";import"../../temporary-directory-BDDVQOvU.mjs";import"../../client-D_mPDF5S.mjs";import"node:net";import"module";import"fs";import"os";import"path";import"node:util";import"../../index-gbaejti9.mjs";const U=i((t,r)=>{if(!r||typeof r=="object"&&!r.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const o=typeof r=="string",e=o?r:r.parentURL,m=n.randomUUID(),a=c({namespace:m});return!f(g)&&!u.test(t)&&d.test(t)?Promise.resolve(a.require(t,e)):p({namespace:m,...o?{}:r}).import(t,e)},"tsImport");export{p as register,U as tsImport}; | ||
| var s=Object.defineProperty;var i=(t,r)=>s(t,"name",{value:r,configurable:!0});import{r as p}from"../../register-Bu1t3CsJ.mjs";import n from"node:crypto";import"../../get-pipe-path-_tAJyU_v.mjs";import{r as c,i as u,c as d}from"../../register-DjEWBuYC.mjs";import"../../require-DLrt45w5.mjs";import{i as f,e as g}from"../../node-features-JeyyvQz6.mjs";import"node:module";import"node:worker_threads";import"node:url";import"node:fs";import"node:fs/promises";import"../../index-CVGQLgGk.mjs";import"node:path";import"esbuild";import"node:os";import"../../temporary-directory-BDDVQOvU.mjs";import"../../client-D_mPDF5S.mjs";import"node:net";import"module";import"fs";import"os";import"path";import"node:util";import"../../index-gbaejti9.mjs";const U=i((t,r)=>{if(!r||typeof r=="object"&&!r.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const o=typeof r=="string",e=o?r:r.parentURL,m=n.randomUUID(),a=c({namespace:m});return!f(g)&&!u.test(t)&&d.test(t)?Promise.resolve(a.require(t,e)):p({namespace:m,...o?{}:r}).import(t,e)},"tsImport");export{p as register,U as tsImport}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var s=Object.defineProperty;var o=(e,i)=>s(e,"name",{value:i,configurable:!0});var c=require("node:worker_threads"),a=require("../node-features-CEjg7cMX.cjs"),r=require("../register-BYFLLcJ9.cjs");require("node:crypto"),require("../get-pipe-path-D4YM6rQt.cjs"),require("node:module"),require("node:path"),require("node:url"),require("../register-CRHZwkwo.cjs"),require("node:fs"),require("esbuild"),require("../index-LWEOpzQe.cjs"),require("../client-D3mGB526.cjs"),require("../require-BomokLx3.cjs"),require("node:fs/promises"),require("module"),require("../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("fs"),require("os"),require("path"),require("node:util"),require("../index-BWFBUo6r.cjs"),require("node:net");function q(e){var i=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,l.get?l:{enumerable:!0,get:o(function(){return e[t]},"get")})}}),i.default=e,Object.freeze(i)}o(q,"_interopNamespaceDefault");var n=q(c);(a.isFeatureSupported(a.moduleRegisterHooksCjsReload)&&!n.isInternalThread||a.isFeatureSupported(a.moduleRegister)&&n.isMainThread)&&r.register();const u=r.createDefaultData(),d=r.createInitialize(u),f=r.createGlobalPreload(u),p=r.createLoad(u),b=r.createResolve(u);exports.globalPreload=f,exports.initialize=d,exports.load=p,exports.resolve=b; | ||
| "use strict";var s=Object.defineProperty;var o=(e,i)=>s(e,"name",{value:i,configurable:!0});var c=require("node:worker_threads"),a=require("../node-features-CEjg7cMX.cjs"),r=require("../register-D3Z1kaw7.cjs");require("node:crypto"),require("../get-pipe-path-D4YM6rQt.cjs"),require("node:module"),require("node:path"),require("node:url"),require("../register-CRHZwkwo.cjs"),require("node:fs"),require("esbuild"),require("../index-LWEOpzQe.cjs"),require("../client-D3mGB526.cjs"),require("../require-BomokLx3.cjs"),require("node:fs/promises"),require("module"),require("../temporary-directory-B83uKxJF.cjs"),require("node:os"),require("fs"),require("os"),require("path"),require("node:util"),require("../index-BWFBUo6r.cjs"),require("node:net");function q(e){var i=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,l.get?l:{enumerable:!0,get:o(function(){return e[t]},"get")})}}),i.default=e,Object.freeze(i)}o(q,"_interopNamespaceDefault");var n=q(c);(a.isFeatureSupported(a.moduleRegisterHooksCjsReload)&&!n.isInternalThread||a.isFeatureSupported(a.moduleRegister)&&n.isMainThread)&&r.register();const u=r.createDefaultData(),d=r.createInitialize(u),f=r.createGlobalPreload(u),p=r.createLoad(u),b=r.createResolve(u);exports.globalPreload=f,exports.initialize=d,exports.load=p,exports.resolve=b; |
@@ -1,1 +0,1 @@ | ||
| import*as o from"node:worker_threads";import{i as t,m as i,a as e}from"../node-features-JeyyvQz6.mjs";import{r as a,c as m,a as p,b as s,d as l,e as d}from"../register-45NAB8gE.mjs";import"node:crypto";import"../get-pipe-path-_tAJyU_v.mjs";import"node:module";import"node:path";import"node:url";import"../register-DjEWBuYC.mjs";import"node:fs";import"esbuild";import"../index-CVGQLgGk.mjs";import"../client-D_mPDF5S.mjs";import"../require-DLrt45w5.mjs";import"node:fs/promises";import"module";import"../temporary-directory-BDDVQOvU.mjs";import"node:os";import"fs";import"os";import"path";import"node:util";import"../index-gbaejti9.mjs";import"node:net";(t(i)&&!o.isInternalThread||t(e)&&o.isMainThread)&&a();const r=d(),c=m(r),n=p(r),f=s(r),u=l(r);export{n as globalPreload,c as initialize,f as load,u as resolve}; | ||
| import*as o from"node:worker_threads";import{i as t,m as i,a as e}from"../node-features-JeyyvQz6.mjs";import{r as a,c as m,a as p,b as s,d as l,e as d}from"../register-Bu1t3CsJ.mjs";import"node:crypto";import"../get-pipe-path-_tAJyU_v.mjs";import"node:module";import"node:path";import"node:url";import"../register-DjEWBuYC.mjs";import"node:fs";import"esbuild";import"../index-CVGQLgGk.mjs";import"../client-D_mPDF5S.mjs";import"../require-DLrt45w5.mjs";import"node:fs/promises";import"module";import"../temporary-directory-BDDVQOvU.mjs";import"node:os";import"fs";import"os";import"path";import"node:util";import"../index-gbaejti9.mjs";import"node:net";(t(i)&&!o.isInternalThread||t(e)&&o.isMainThread)&&a();const r=d(),c=m(r),n=p(r),f=s(r),u=l(r);export{n as globalPreload,c as initialize,f as load,u as resolve}; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";var r=require("./get-pipe-path-D4YM6rQt.cjs"),e=require("./esm/index.cjs");require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:worker_threads"),require("./node-features-CEjg7cMX.cjs"),require("./register-BYFLLcJ9.cjs"),require("node:crypto"),require("node:module"),require("./register-CRHZwkwo.cjs"),require("node:url"),require("node:fs"),require("fs"),require("os"),require("path"),require("./index-LWEOpzQe.cjs"),require("esbuild"),require("./client-D3mGB526.cjs"),require("node:net"),require("node:util"),require("./index-BWFBUo6r.cjs"),require("node:fs/promises"),require("./require-BomokLx3.cjs"),r.require("./cjs/index.cjs"),exports.globalPreload=e.globalPreload,exports.initialize=e.initialize,exports.load=e.load,exports.resolve=e.resolve; | ||
| "use strict";var r=require("./get-pipe-path-D4YM6rQt.cjs"),e=require("./esm/index.cjs");require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:worker_threads"),require("./node-features-CEjg7cMX.cjs"),require("./register-D3Z1kaw7.cjs"),require("node:crypto"),require("node:module"),require("./register-CRHZwkwo.cjs"),require("node:url"),require("node:fs"),require("fs"),require("os"),require("path"),require("./index-LWEOpzQe.cjs"),require("esbuild"),require("./client-D3mGB526.cjs"),require("node:net"),require("node:util"),require("./index-BWFBUo6r.cjs"),require("node:fs/promises"),require("./require-BomokLx3.cjs"),r.require("./cjs/index.cjs"),exports.globalPreload=e.globalPreload,exports.initialize=e.initialize,exports.load=e.load,exports.resolve=e.resolve; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| import{r}from"./get-pipe-path-_tAJyU_v.mjs";import{globalPreload as A,initialize as B,load as C,resolve as D}from"./esm/index.mjs";import"module";import"node:path";import"./temporary-directory-BDDVQOvU.mjs";import"node:os";import"node:worker_threads";import"./node-features-JeyyvQz6.mjs";import"./register-45NAB8gE.mjs";import"node:crypto";import"node:module";import"./register-DjEWBuYC.mjs";import"node:url";import"node:fs";import"fs";import"os";import"path";import"./index-CVGQLgGk.mjs";import"esbuild";import"./client-D_mPDF5S.mjs";import"node:net";import"node:util";import"./index-gbaejti9.mjs";import"node:fs/promises";import"./require-DLrt45w5.mjs";r("./cjs/index.cjs");export{A as globalPreload,B as initialize,C as load,D as resolve}; | ||
| import{r}from"./get-pipe-path-_tAJyU_v.mjs";import{globalPreload as A,initialize as B,load as C,resolve as D}from"./esm/index.mjs";import"module";import"node:path";import"./temporary-directory-BDDVQOvU.mjs";import"node:os";import"node:worker_threads";import"./node-features-JeyyvQz6.mjs";import"./register-Bu1t3CsJ.mjs";import"node:crypto";import"node:module";import"./register-DjEWBuYC.mjs";import"node:url";import"node:fs";import"fs";import"os";import"path";import"./index-CVGQLgGk.mjs";import"esbuild";import"./client-D_mPDF5S.mjs";import"node:net";import"node:util";import"./index-gbaejti9.mjs";import"node:fs/promises";import"./require-DLrt45w5.mjs";r("./cjs/index.cjs");export{A as globalPreload,B as initialize,C as load,D as resolve}; |
+1
-1
@@ -1,3 +0,3 @@ | ||
| "use strict";var u=Object.defineProperty;var s=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=require("node:repl"),l=require("./package-CbP9_Eiu.cjs"),q=require("./index-LWEOpzQe.cjs");require("node:path"),require("node:url"),require("esbuild"),require("node:crypto"),require("./node-features-CEjg7cMX.cjs"),require("node:fs"),require("node:os"),require("./temporary-directory-B83uKxJF.cjs"),console.log(`Welcome to tsx v${l.version} (Node.js ${process.version}). | ||
| "use strict";var u=Object.defineProperty;var s=(e,r)=>u(e,"name",{value:r,configurable:!0});var c=require("node:repl"),l=require("./package-D8zHkzom.cjs"),q=require("./index-LWEOpzQe.cjs");require("node:path"),require("node:url"),require("esbuild"),require("node:crypto"),require("./node-features-CEjg7cMX.cjs"),require("node:fs"),require("node:os"),require("./temporary-directory-B83uKxJF.cjs"),console.log(`Welcome to tsx v${l.version} (Node.js ${process.version}). | ||
| Type ".help" for more information.`);const i=c.start(),{eval:p}=i,v=s(async function(e,r,o,t){const a=await q.transform(e,o,{loader:"ts",tsconfigRaw:{compilerOptions:{preserveValueImports:!0}},define:{require:"global.require"}}).catch(n=>(console.log(n.message),{code:` | ||
| `}));return p.call(this,a.code,r,o,t)},"preEval");i.eval=v; |
+1
-1
@@ -1,3 +0,3 @@ | ||
| var p=Object.defineProperty;var t=(o,r)=>p(o,"name",{value:r,configurable:!0});import a from"node:repl";import{v as l}from"./package-qeSTyjZj.mjs";import{t as c}from"./index-CVGQLgGk.mjs";import"node:path";import"node:url";import"esbuild";import"node:crypto";import"./node-features-JeyyvQz6.mjs";import"node:fs";import"node:os";import"./temporary-directory-BDDVQOvU.mjs";console.log(`Welcome to tsx v${l} (Node.js ${process.version}). | ||
| var p=Object.defineProperty;var t=(o,r)=>p(o,"name",{value:r,configurable:!0});import a from"node:repl";import{v as l}from"./package-BPDo_TJ6.mjs";import{t as c}from"./index-CVGQLgGk.mjs";import"node:path";import"node:url";import"esbuild";import"node:crypto";import"./node-features-JeyyvQz6.mjs";import"node:fs";import"node:os";import"./temporary-directory-BDDVQOvU.mjs";console.log(`Welcome to tsx v${l} (Node.js ${process.version}). | ||
| Type ".help" for more information.`);const s=a.start(),{eval:f}=s,v=t(async function(o,r,e,i){const m=await c(o,e,{loader:"ts",tsconfigRaw:{compilerOptions:{preserveValueImports:!0}},define:{require:"global.require"}}).catch(n=>(console.log(n.message),{code:` | ||
| `}));return f.call(this,m.code,r,e,i)},"preEval");s.eval=v; |
+1
-1
| { | ||
| "name": "tsx", | ||
| "version": "4.23.8", | ||
| "version": "4.23.9", | ||
| "description": "TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
| "use strict";var r="4.23.8";exports.version=r; |
| var r="4.23.8";export{r as v}; |
| var kt=Object.defineProperty;var c=(t,r)=>kt(t,"name",{value:r,configurable:!0});import xt from"node:crypto";import T from"node:module";import{MessageChannel as Gt}from"node:worker_threads";import{i as E,b as Xt,e as K,m as zt}from"./node-features-JeyyvQz6.mjs";import{l as dt,t as lt,g as Vt,a as Kt,d as N,b as u,e as Y,f as v,h as _,j as Z,k as Yt,m as y,n as Zt,o as A,p as ut,q as ft,w as pt,s as B,u as ht,v as j,x as te}from"./register-DjEWBuYC.mjs";import{pathToFileURL as P,fileURLToPath as R}from"node:url";import{readFileSync as ee,existsSync as re}from"node:fs";import{readFile as se}from"node:fs/promises";import{p as ne,i as gt,t as yt,a as q,b as Pt,c as oe,r as tt}from"./index-CVGQLgGk.mjs";import{p as St}from"./client-D_mPDF5S.mjs";import S from"node:path";const ae=c(()=>({active:!0,parsedTsconfig:void 0}),"createDefaultData"),vt=c(t=>{const r={active:!0,namespace:t?.namespace,onImport:t?.onImport,parsedTsconfig:void 0,port:t?.port,tsconfig:t?.tsconfig};return t?.tsconfig!==!1&&(r.parsedTsconfig=dt(t?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),ie=c(t=>async r=>{if(!r)throw new Error(`tsx must be loaded with --import instead of --loader | ||
| The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(t,vt(r)),r.port&&r.port.on("message",e=>{e==="deactivate"&&(t.active=!1,r.port.postMessage({type:"deactivated"}))})},"createInitialize"),ce=c(t=>()=>(t.parsedTsconfig=dt(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"createGlobalPreload"),me=c(t=>{const{pathname:r}=new URL(t),e=S.extname(r);if(e===".mts"||e===".mjs")return"module";if(e===".cts"||e===".cjs")return"commonjs";if(e===".js"||lt.includes(e))return Vt(t)},"getFormatFromFileUrl"),de=c(t=>{const{pathname:r}=new URL(t),e=S.extname(r);if(e===".mts"||e===".mjs")return"module";if(e===".cts"||e===".cjs")return"commonjs";if(e===".js"||lt.includes(e))return Kt(t)},"getFormatFromFileUrlSync"),Ut="tsx-namespace",Q=`${Ut}=`,L="tsx-commonjs-export-preparse",le=`${L}=1`,F="tsx-commonjs-virtual-query",W=new Map,et=c((t,r)=>t.slice(1).split("&").filter(e=>e&&r.every(s=>!e.startsWith(s))).join("&"),"getQueryWithoutParameters"),D=c((t,r)=>{const e=et(t,r);return e?`?${e}`:""},"getSearchWithoutParameters"),ue=c(t=>t.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),fe=c(t=>{const r=ue(t);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const e=r.match(/\{([^}]*)\}/)?.[1];if(e)return e.split(",").some(s=>{const n=s.trim().split(/\s+as\s+/)[0];return!!(n&&n!=="default")})?"named":void 0},"getCommonJsImportBinding"),pe=c((t,r,e)=>{const s=W.get(t);if(!s)return!1;try{const[n]=ne(s);return n.some(a=>{if(a.d!==-1||a.n!==r)return!1;const i=fe(s.slice(a.ss,a.s));return i==="named"||e&&i==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),U=c(t=>{const r=t.indexOf("?"),e=t.indexOf("#");if(!(r===-1||e!==-1&&e<r))return new URLSearchParams(t.slice(r,e===-1?void 0:e)).get(Ut)??void 0},"getNamespace"),Rt=E(Xt)?"importAttributes":"importAssertions",wt=c(t=>t==="commonjs"||t==="commonjs-typescript","isCommonJsFormat"),Tt=c(t=>t==="module-typescript"||t==="typescript","isModuleTypeScriptFormat"),he=E(K),ge=[`${F}=`],H=[`${L}=`,`${F}=`],w=c((t,r)=>r.parsedTsconfig&&Yt(r.parsedTsconfig,t)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),ye=c(t=>{if(!t.searchParams.has(F))return;const{pathname:r}=t,e=r.toLowerCase().lastIndexOf("%3f");if(e===-1)return;const s=new URL(t);return s.pathname=r.slice(0,e),s.search="",R(s)},"getFilePathFromVirtualQuery"),rt=c(t=>{const r=t.startsWith(y)?new URL(t):void 0,e=r?R(r):t,s=r&&ye(r),n=s||e,a=r&&s?P(n).toString()+D(r.search,ge):t;return{fileUrl:r,filePath:n,loadUrl:a}},"getFileLoadContext"),It=c((t,r)=>{if(!r?.search)return t;const e=D(r.search,H);return e?P(t).toString()+e:t},"getTransformPath"),Et=c((t,r,e)=>{const s=[...r?et(r.search,[Q,...H]).split("&").filter(Boolean):[],...e?[`namespace=${encodeURIComponent(e)}`]:[]].join("&");return s?`${t}?${s}`:t},"getFilePathWithQuery"),Pe=new TextDecoder,jt=c(t=>typeof t=="string"?t:Pe.decode(t),"decodeSource"),Se=c((t,r)=>{const e=new URL(r),s=r.startsWith(y)?rt(r).filePath:void 0;e.searchParams.delete("tsx-namespace"),e.searchParams.delete(L),e.searchParams.delete(F),s&&(e.pathname=new URL(P(s)).pathname);const n=e.toString();return t.port&&t.port.postMessage({type:"load",url:n}),t.onImport?.(n),n},"notifyLoad"),Lt=c((t,r)=>{if(!t.active)return!1;const e=U(r);if(t.namespace!==e)return!1;const s=Se(t,r);return St.send&&St.send({type:"dependency",path:s}),!0},"prepareLoad"),Ft=c((t,r)=>{if(!Zt.test(t))return r;const e=r[Rt];return e?.type?r:{...r,[Rt]:{...e,type:"json"}}},"prepareJsonAttributes"),st=c(({conditions:t})=>t?.includes("require")===!0&&!t.includes("import"),"isCommonJsRequireContext$1"),ve=c(t=>{const r=c(async(e,s,n)=>{if(!Lt(t,e))return n(e,s);const a=U(e),{fileUrl:i,filePath:m,loadUrl:d}=rt(e),l=Ft(d,s),o=await n(d,l);u(3,"loaded by next loader",{url:e,loadUrl:d,loaded:o});const f=i?.searchParams.has(L)===!0,p=o.format,I=i?new URL(P(m)):void 0;if(I&&i&&(I.search=D(i.search,H)),wt(p)&&i&&o.responseURL?.startsWith("file:")&&!m.endsWith(".cjs")){const h=await se(P(m),"utf8"),$=gt(h);if(p==="commonjs-typescript"||!m.endsWith(".js")||$){if(!he){if(f&&$&&Y.test(m)){const M=await yt(h,m,{define:{"import.meta.url":JSON.stringify(I.toString())},tsconfigRaw:w(m,t)});return W.set(e,M.code),{format:"module",source:v(M)}}return o}if(!a&&!f&&!m.endsWith(".cts"))return o;const ct=!!(a||f||D(i.search,H)),mt=q(h,It(m,i),{cjsBanner:ct?`require = require("node:module").createRequire(${JSON.stringify(P(m).toString())});`:void 0,tsconfigRaw:w(m,t)});if(o.format="commonjs",o.source=v(mt),ct){const M=Et(m,i,a);o.responseURL=`data:text/javascript,${encodeURIComponent(mt.code)}?filePath=${encodeURIComponent(M)}`}return u(3,"returning CJS export annotation",o),o}}if(!o.source)return o;const g=jt(o.source),J=p==="json"&&!st(s);if(p==="commonjs-typescript"){const h=q(g,m,{tsconfigRaw:w(m,t)});return{...o,format:"commonjs",source:v(h)}}if(J||Tt(p)||_.test(e)){const h=await yt(g,m,{tsconfigRaw:w(m,t)});return W.set(e,h.code),{format:"module",source:v(h)}}if(o.format==="module"){const h=Pt(m,g);h?(o.source=v(h),W.set(e,h.code)):W.set(e,g)}return o},"load");return N?async(e,s,n)=>{u(2,"load",{url:e,context:s});const a=await r(e,s,n);return u(1,"loaded",{url:e,result:a}),a}:r},"createLoad"),Ue=c(t=>{const r=c((e,s,n)=>{if(st(s)&&Z()||!Lt(t,e))return n(e,s);const a=U(e),{fileUrl:i,filePath:m,loadUrl:d}=rt(e),l=Ft(d,s),o=n(d,l);u(3,"loaded by next loader",{url:e,loadUrl:d,loaded:o});const f=o.format;if(wt(f)&&E(K)&&o.responseURL?.startsWith("file:")&&!m.endsWith(".cjs")){const g=ee(P(m),"utf8");if(f==="commonjs-typescript"||!m.endsWith(".js")||gt(g)){const J=q(g,It(m,i),{tsconfigRaw:w(m,t)}),h=!a&&Z(),$=Et(m,i,a);return o.format="commonjs",o.shouldBeReloadedByCJSLoader=h,o.source=v(J),h||(o.responseURL=`data:text/javascript,${encodeURIComponent(J.code)}?filePath=${encodeURIComponent($)}`),u(3,"returning CJS export annotation",o),o}}if(!o.source)return o;const p=jt(o.source),I=f==="json"&&!st(s);if(f==="commonjs-typescript"){const g=q(p,m,{tsconfigRaw:w(m,t)});return{...o,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:v(g)}}if(I||Tt(f)||_.test(e)){const g=oe(p,m,{tsconfigRaw:w(m,t)});return{format:"module",source:v(g)}}if(o.format==="module"){const g=Pt(m,p);g&&(o.source=v(g))}return o},"load");return N?(e,s,n)=>{u(2,"loadSync",{url:e,context:s});const a=r(e,s,n);return u(1,"loadedSync",{url:e,result:a}),a}:r},"createLoadSync"),Re=c(t=>{if(A(t)||t.startsWith("#")||t.includes(":"))return!1;const r=t.split("/"),e=r[0]?.startsWith("@")?2:1;return r.length>e&&r.slice(0,e).every(Boolean)},"isBarePackageSubpath"),we=c(t=>{const r=t.lastIndexOf(ut);if(r===-1)return;const s=t.slice(r+ut.length).split(S.sep),n=s[0]?.startsWith("@")?2:1;if(!(s.length<=n||!s[n-1]))return S.join(t.slice(0,r),"node_modules",...s.slice(0,n))},"getPackageDirectory"),Wt=c((t,r)=>{if(!Re(t)||!r.startsWith(y))return;const e=R(r),s=we(e);if(!s)return;const a=tt(S.join(s,"package.json"))?.exports;if(a!=null)return{kind:"root-exports"};const i=tt(S.join(e,"package.json"));return typeof i?.main!="string"||!i.main?{kind:"legacy-directory"}:{kind:"legacy-directory",mainUrl:P(S.resolve(e,i.main)).toString()}},"getPackageSubpathDirectoryInfo"),Te=E(K),Ot=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,bt=c(t=>!A(t)&&!Ot.test(t),"isTsconfigPathAliasSpecifier"),k=c(t=>{if(t.url)return t.url;const r=t.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const e=t.message.match(/^Cannot find package '([^']+)'/);if(e){const[,s]=e;if(!S.isAbsolute(s))return;const n=P(s);if(n.pathname.endsWith("/")&&(n.pathname+="package.json"),n.pathname.endsWith("/package.json")){const a=tt(n);if(a?.main)return new URL(a.main,n).toString()}else return n.toString()}},"getMissingPathFromNotFound"),O=c(t=>t==="ERR_MODULE_NOT_FOUND"||t==="MODULE_NOT_FOUND","isModuleNotFound"),x=c(t=>t instanceof Error&&(O(t.code)||t.code==="ERR_UNSUPPORTED_DIR_IMPORT"),"isDirectoryEntryMiss"),G=c(t=>t.conditions.includes("require")&&!t.conditions.includes("import"),"isCommonJsRequireContext"),nt=c(t=>{const r=t.indexOf("?"),e=t.indexOf("#");return r===-1?e:e===-1?r:Math.min(r,e)},"getUrlMetadataIndex"),Ct=c((t,r)=>r||!A(t)&&!Ot.test(t)?t.indexOf("?"):nt(t),"getSpecifierMetadataIndex"),Jt=c(t=>{if(t?.startsWith(y))return R(new URL(t))},"getParentFilePath"),Ie=c(t=>{if(!t)return!1;const r=Jt(t);if(r)return _.test(r);const e=nt(t);return _.test(e===-1?t:t.slice(0,e))},"isTypeScriptParent"),b=c(t=>{const r=Jt(t);return r!==void 0&&ft(r)},"isParentDependency"),$t=c(t=>S.extname(new URL(t).pathname)===".js"&&ft(R(t)),"isImplicitJavaScriptDependency"),Mt=c((t,r)=>Ie(t)||r&&!b(t),"resolvesTsExtensions"),Ee=c((t,r)=>{const e=nt(t),s=e===-1?t:t.slice(0,e);try{if(s.startsWith(y))return R(s);if(S.isAbsolute(s))return s;if(j(s)&&r?.startsWith(y))return R(new URL(s,r))}catch{}},"getProbeFilePath"),Nt=c((t,r)=>{const e=Ee(t,r);return e!==void 0&&!re(e)},"candidateDoesntExist"),X=c(async(t,r,e,s)=>{const n=ht(t);if(u(3,"resolveExtensions",{url:t,context:r,throwError:s,tryPaths:n}),!n)return;let a;for(const i of n)if(!Nt(i,r.parentURL))try{return await e(i,r)}catch(m){const{code:d}=m;if(!O(d)&&d!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw m;a=m}if(s){if(a===void 0)return e(n[0],r);throw a}},"resolveExtensions"),C=c((t,r,e,s)=>{const n=ht(t);if(u(3,"resolveExtensionsSync",{url:t,context:r,throwError:s,tryPaths:n}),!n)return;let a;for(const i of n)if(!Nt(i,r.parentURL))try{return e(i,r)}catch(m){const{code:d}=m;if(!O(d)&&d!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw m;a=m}if(s){if(a===void 0)return e(n[0],r);throw a}},"resolveExtensionsSync"),je=c(async(t,r,e,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,a=Mt(r.parentURL,n);if(u(3,"resolveBase",{specifier:t,context:r,specifierStartsWithFileUrl:t.startsWith(y),isRelativePath:j(t),resolveTsExtensions:a,allowJs:n}),(t.startsWith(y)||j(t))&&a){const i=await X(t,r,e,void 0);if(u(3,"resolveBase resolved",{specifier:t,context:r,resolved:i}),i)return i}try{return await e(t,r)}catch(i){if(u(3,"resolveBase error",{specifier:t,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const d=k(m);if(d){const l=await X(d,r,e,void 0);if(l)return l}}}throw i}},"resolveBase"),ot=c((t,r,e,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,a=Mt(r.parentURL,n);if(u(3,"resolveBaseSync",{specifier:t,context:r,specifierStartsWithFileUrl:t.startsWith(y),isRelativePath:j(t),resolveTsExtensions:a,allowJs:n}),(t.startsWith(y)||j(t))&&a){const i=C(t,r,e,void 0);if(u(3,"resolveBaseSync resolved",{specifier:t,context:r,resolved:i}),i)return i}try{return e(t,r)}catch(i){if(u(3,"resolveBaseSync error",{specifier:t,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const d=k(m);if(d){const l=C(d,r,e,void 0);if(l)return l}}}throw i}},"resolveBaseSync"),at=c(async(t,r,e,s)=>{if(u(3,"resolveDirectory",{specifier:t,context:r,isDirectory:B.test(t)}),(t==="."||t===".."||t.endsWith("/.."))&&(t+="/"),B.test(t)){const n=new URL(t,r.parentURL);return n.pathname=S.join(n.pathname,"index"),await X(n.toString(),r,e,!0)}try{return await je(t,r,e,s)}catch(n){if(n instanceof Error){u(3,"resolveDirectory error",{specifier:t,context:r,error:n});const a=n;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const i=k(a);if(i){if(t.startsWith("#"))throw n;const m=Wt(t,i);if(m?.kind==="root-exports")throw n;if(m?.mainUrl){try{return await e(m.mainUrl,r)}catch(o){if(!x(o))throw o}try{return await at(m.mainUrl,r,e,s)}catch(o){if(!x(o))throw o}}const d=`${i}/index`,l=await X(d,r,e);if(l)return l}}}throw n}},"resolveDirectory"),it=c((t,r,e,s)=>{if(u(3,"resolveDirectorySync",{specifier:t,context:r,isDirectory:B.test(t)}),(t==="."||t===".."||t.endsWith("/.."))&&(t+="/"),B.test(t)){const n=G(r);if(n&&!A(t))return ot(t,r,e,s);const a=new URL(t,r.parentURL);return a.pathname=S.join(a.pathname,"index"),n?C(R(a),r,e,!1)??ot(t,r,e,s):C(a.toString(),r,e,!0)}try{return ot(t,r,e,s)}catch(n){if(n instanceof Error){u(3,"resolveDirectorySync error",{specifier:t,context:r,error:n});const a=n;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const i=k(a);if(i){if(t.startsWith("#"))throw n;const m=Wt(t,i);if(m?.kind==="root-exports")throw n;if(m?.mainUrl){try{return e(m.mainUrl,r)}catch(o){if(!x(o))throw o}try{return it(m.mainUrl,r,e,s)}catch(o){if(!x(o))throw o}}const d=`${i}/index`,l=C(d,r,e);if(l)return l}}}throw n}},"resolveDirectorySync"),Le=c(async(t,r,e,s)=>{const n=bt(t);if(u(3,"resolveTsPaths",{specifier:t,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:b(r.parentURL)}),n&&s.parsedTsconfig&&!b(r.parentURL)){const a=pt(s.parsedTsconfig,t);u(3,"resolveTsPaths",{possiblePaths:a});for(const i of a)try{return await at(P(i).toString(),r,e,s)}catch{}}return at(t,r,e,s)},"resolveTsPaths"),Fe=c((t,r,e,s)=>{const n=bt(t);if(u(3,"resolveTsPathsSync",{specifier:t,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:b(r.parentURL)}),n&&s.parsedTsconfig&&!b(r.parentURL)){const a=pt(s.parsedTsconfig,t);u(3,"resolveTsPathsSync",{possiblePaths:a});for(const i of a)try{return it(P(i).toString(),r,e,s)}catch{}}return it(t,r,e,s)},"resolveTsPathsSync"),z="tsx://",V=c((t,r)=>{const e=t.indexOf("#"),s=e===-1?t:t.slice(0,e),n=e===-1?"":t.slice(e);return`${s}${s.includes("?")?"&":"?"}${r}${n}`},"addQuery"),_t=c((t,r)=>{const e=r.indexOf("#"),s=r[0]==="?"?r.slice(1,e===-1?void 0:e):"",n=e===-1?"":r.slice(e),a=t.indexOf("#"),i=a===-1?t:t.slice(0,a),m=a===-1?"":t.slice(a),d=s?V(i,s):i;return new URL(`${d}${n||m}`).toString()},"mergeUrlMetadata"),At=c((t,r,e)=>{if(r!=="commonjs"||!t.startsWith(y)||!Y.test(t))return t;const s=new URL(t),n=[et(s.search,[Q]),...e?[`namespace=${encodeURIComponent(e)}`]:[]].filter(Boolean).join("&");return n?(s.pathname+=`%3F${n}`,s.searchParams.set(F,"1"),s.toString()):t},"preserveCommonJsQueryIdentity"),We=c(t=>{const r=c(async(e,s,n)=>{if(!t.active||e.startsWith("node:"))return n(e,s);let a=U(e)??(s.parentURL&&U(s.parentURL));if(t.namespace){let p;if(e.startsWith(z)){try{p=JSON.parse(e.slice(z.length))}catch{}p?.namespace&&(a=p.namespace)}if(t.namespace!==a)return n(e,s);p&&(e=p.specifier,s.parentURL=p.parentURL)}const i=Ct(e,G(s)),m=i===-1?e:e.slice(0,i),d=i===-1?"":e.slice(i),l=await Le(m,s,n,t);if(u(2,"nextResolve",{resolved:l}),l.format==="builtin")return l;const o={...l};o.url.startsWith(y)&&(o.format==="module-typescript"?o.format="module":o.format==="commonjs-typescript"?o.format="commonjs":!o.format&&!$t(o.url)&&(o.format=await me(o.url),u(2,"getFormatFromFileUrl",{resolved:o,format:o.format}))),d&&(o.url=_t(o.url,d));const f=s.parentURL&&o.format==="commonjs"&&Y.test(o.url)&&(new URL(s.parentURL).searchParams.has(L)||pe(s.parentURL,e,Te));return a&&U(o.url)===void 0&&(o.url=V(o.url,`${Q}${a}`)),f&&(o.url=V(o.url,le)),(a||f)&&(o.url=At(o.url,o.format,a)),o},"resolve");return N?async(e,s,n)=>{u(2,"resolve",{specifier:e,context:s});const a=await r(e,s,n);return u(1,"resolved",{specifier:e,context:s,result:a}),a}:r},"createResolve"),Oe=c(t=>{const r=c((e,s,n)=>{if(!t.active||e.startsWith("node:")||G(s)&&Z())return n(e,s);let a=U(e)??(s.parentURL&&U(s.parentURL));if(t.namespace){let f;if(e.startsWith(z)){try{f=JSON.parse(e.slice(z.length))}catch{}f?.namespace&&(a=f.namespace)}if(t.namespace!==a)return n(e,s);f&&(e=f.specifier,s.parentURL=f.parentURL)}const i=Ct(e,G(s)),m=i===-1?e:e.slice(0,i),d=i===-1?"":e.slice(i),l=Fe(m,s,n,t);if(u(2,"nextResolve",{resolved:l}),l.format==="builtin")return l;const o={...l};return o.url.startsWith(y)&&(o.format==="module-typescript"?o.format="module":o.format==="commonjs-typescript"?o.format="commonjs":!o.format&&!$t(o.url)&&(o.format=de(o.url),u(2,"getFormatFromFileUrlSync",{resolved:o,format:o.format}))),d&&(o.url=_t(o.url,d)),a&&U(o.url)===void 0&&(o.url=V(o.url,`${Q}${a}`)),o.url=At(o.url,o.format,a),o},"resolve");return N?(e,s,n)=>{u(2,"resolveSync",{specifier:e,context:s});const a=r(e,s,n);return u(1,"resolvedSync",{specifier:e,context:s,result:a}),a}:r},"createResolveSync"),Bt=c(t=>(r,e)=>{if(!e)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=e.startsWith(y)?e:P(e).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:t})}`)},"createScopedImport");let qt=!1;const be=c(t=>{const r=[];for(let e=0;e<t.length;e+=1){const s=t[e];if(s==="--import"){const n=t[e+1];n&&r.push(n),e+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),Ce=c(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,t])=>t),"collectNodeOptionsImportSpecifiers"),Qt=[new URL("loader.mjs",import.meta.url).toString(),new URL("esm/index.mjs",import.meta.url).toString()],Je=new Set(["tsx","tsx/esm",...Qt,...Qt.map(t=>decodeURI(new URL(t).pathname))]),$e=c(t=>Je.has(t),"isTsxImport"),Dt=c(t=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(t),"isTypeScriptImport"),Me=c(()=>{const t=be(process.execArgv),r=t.findIndex($e);return r>0&&t.slice(0,r).some(Dt)},"hasCliTypeScriptPreload"),Ne=Ce().some(Dt)||Me(),Ht=typeof T.registerHooks=="function"&&E(zt)&&!Ne,_e=c(t=>{if(!T.register&&!Ht)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!qt){const{_resolveFilename:m}=T;T._resolveFilename=(d,...l)=>m(te(d),...l),qt=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),Ht){const m=vt({namespace:t?.namespace,onImport:t?.onImport,tsconfig:t?.tsconfig}),d=T.registerHooks({load:Ue(m),resolve:Oe(m)}),l=c(async()=>{m.active=!1,d.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return t?.namespace&&(l.import=Bt(t.namespace),l.unregister=l),l}const{port1:e,port2:s}=new Gt;T.register(`./esm/index.mjs?${xt.randomUUID()}`,{parentURL:import.meta.url,data:{port:s,namespace:t?.namespace,tsconfig:t?.tsconfig},transferList:[s]});const n=t?.onImport,a=n&&(m=>{m.type==="load"&&n(m.url)});a&&(e.on("message",a),e.unref());const i=c(()=>(r===!1&&process.setSourceMapsEnabled(!1),a&&e.off("message",a),e.postMessage("deactivate"),new Promise(m=>{const d=c(l=>{l.type==="deactivated"&&(m(),e.off("message",d))},"onDeactivated");e.on("message",d)})),"unregister");return t?.namespace&&(i.import=Bt(t.namespace),i.unregister=i),i},"register");export{ce as a,ve as b,ie as c,We as d,ae as e,_e as r}; |
| "use strict";var we=Object.defineProperty;var l=(e,r)=>we(e,"name",{value:r,configurable:!0});var Fe=require("node:crypto"),E=require("node:module"),Ie=require("node:worker_threads"),R=require("./node-features-CEjg7cMX.cjs"),o=require("./register-CRHZwkwo.cjs"),f=require("node:url"),Z=require("node:fs"),je=require("node:fs/promises"),P=require("./index-LWEOpzQe.cjs"),ee=require("./client-D3mGB526.cjs"),U=require("node:path"),T=typeof document<"u"?document.currentScript:null;const be=l(()=>({active:!0,parsedTsconfig:void 0}),"createDefaultData"),te=l(e=>{const r={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(r.parsedTsconfig=o.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),We=l(e=>async r=>{if(!r)throw new Error(`tsx must be loaded with --import instead of --loader | ||
| The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(e,te(r)),r.port&&r.port.on("message",t=>{t==="deactivate"&&(e.active=!1,r.port.postMessage({type:"deactivated"}))})},"createInitialize"),Me=l(e=>()=>(e.parsedTsconfig=o.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"createGlobalPreload"),Ce=l(e=>{const{pathname:r}=new URL(e),t=U.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||o.tsExtensions.includes(t))return o.getPackageType(e)},"getFormatFromFileUrl"),Oe=l(e=>{const{pathname:r}=new URL(e),t=U.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||o.tsExtensions.includes(t))return o.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),re="tsx-namespace",J=`${re}=`,w="tsx-commonjs-export-preparse",Je=`${w}=1`,F="tsx-commonjs-virtual-query",I=new Map,Q=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),_=l((e,r)=>{const t=Q(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),_e=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),$e=l(e=>{const r=_e(e);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const t=r.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(s=>{const n=s.trim().split(/\s+as\s+/)[0];return!!(n&&n!=="default")})?"named":void 0},"getCommonJsImportBinding"),qe=l((e,r,t)=>{const s=I.get(e);if(!s)return!1;try{const[n]=P.parseEsm(s);return n.some(i=>{if(i.d!==-1||i.n!==r)return!1;const c=$e(s.slice(i.ss,i.s));return c==="named"||t&&c==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),S=l(e=>{const r=e.indexOf("?"),t=e.indexOf("#");if(!(r===-1||t!==-1&&t<r))return new URLSearchParams(e.slice(r,t===-1?void 0:t)).get(re)??void 0},"getNamespace"),se=R.isFeatureSupported(R.importAttributes)?"importAttributes":"importAssertions",ne=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),oe=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Ne=R.isFeatureSupported(R.esmLoadReadFile),xe=[`${F}=`],$=[`${w}=`,`${F}=`],v=l((e,r)=>r.parsedTsconfig&&o.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),Ae=l(e=>{if(!e.searchParams.has(F))return;const{pathname:r}=e,t=r.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const s=new URL(e);return s.pathname=r.slice(0,t),s.search="",f.fileURLToPath(s)},"getFilePathFromVirtualQuery"),H=l(e=>{const r=e.startsWith(o.fileUrlPrefix)?new URL(e):void 0,t=r?f.fileURLToPath(r):e,s=r&&Ae(r),n=s||t,i=r&&s?f.pathToFileURL(n).toString()+_(r.search,xe):e;return{fileUrl:r,filePath:n,loadUrl:i}},"getFileLoadContext"),ae=l((e,r)=>{if(!r?.search)return e;const t=_(r.search,$);return t?f.pathToFileURL(e).toString()+t:e},"getTransformPath"),ie=l((e,r,t)=>{const s=[...r?Q(r.search,[J,...$]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),Be=new TextDecoder,ce=l(e=>typeof e=="string"?e:Be.decode(e),"decodeSource"),De=l((e,r)=>{const t=new URL(r),s=r.startsWith(o.fileUrlPrefix)?H(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(w),t.searchParams.delete(F),s&&(t.pathname=new URL(f.pathToFileURL(s)).pathname);const n=t.toString();return e.port&&e.port.postMessage({type:"load",url:n}),e.onImport?.(n),n},"notifyLoad"),le=l((e,r)=>{if(!e.active)return!1;const t=S(r);if(e.namespace!==t)return!1;const s=De(e,r);return ee.parent.send&&ee.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),me=l((e,r)=>{if(!o.isJsonPattern.test(e))return r;const t=r[se];return t?.type?r:{...r,[se]:{...t,type:"json"}}},"prepareJsonAttributes"),k=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Qe=l(e=>{const r=l(async(t,s,n)=>{if(!le(e,t))return n(t,s);const i=S(t),{fileUrl:c,filePath:m,loadUrl:d}=H(t),u=me(d,s),a=await n(d,u);o.logEsm(3,"loaded by next loader",{url:t,loadUrl:d,loaded:a});const p=c?.searchParams.has(w)===!0,h=a.format,L=c?new URL(f.pathToFileURL(m)):void 0;if(L&&c&&(L.search=_(c.search,$)),ne(h)&&c&&a.responseURL?.startsWith("file:")&&!m.endsWith(".cjs")){const g=await je.readFile(f.pathToFileURL(m),"utf8"),C=P.isESM(g);if(h==="commonjs-typescript"||!m.endsWith(".js")||C){if(!Ne){if(p&&C&&o.implicitTsExtensionsPattern.test(m)){const O=await P.transform(g,m,{define:{"import.meta.url":JSON.stringify(L.toString())},tsconfigRaw:v(m,e)});return I.set(t,O.code),{format:"module",source:o.inlineSourceMap(O)}}return a}if(!i&&!p&&!m.endsWith(".cts"))return a;const K=!!(i||p||_(c.search,$)),Y=P.transformSync(g,ae(m,c),{cjsBanner:K?`require = require("node:module").createRequire(${JSON.stringify(f.pathToFileURL(m).toString())});`:void 0,tsconfigRaw:v(m,e)});if(a.format="commonjs",a.source=o.inlineSourceMap(Y),K){const O=ie(m,c,i);a.responseURL=`data:text/javascript,${encodeURIComponent(Y.code)}?filePath=${encodeURIComponent(O)}`}return o.logEsm(3,"returning CJS export annotation",a),a}}if(!a.source)return a;const y=ce(a.source),M=h==="json"&&!k(s);if(h==="commonjs-typescript"){const g=P.transformSync(y,m,{tsconfigRaw:v(m,e)});return{...a,format:"commonjs",source:o.inlineSourceMap(g)}}if(M||oe(h)||o.tsExtensionsPattern.test(t)){const g=await P.transform(y,m,{tsconfigRaw:v(m,e)});return I.set(t,g.code),{format:"module",source:o.inlineSourceMap(g)}}if(a.format==="module"){const g=P.transformDynamicImport(m,y);g?(a.source=o.inlineSourceMap(g),I.set(t,g.code)):I.set(t,y)}return a},"load");return o.debugEnabled?async(t,s,n)=>{o.logEsm(2,"load",{url:t,context:s});const i=await r(t,s,n);return o.logEsm(1,"loaded",{url:t,result:i}),i}:r},"createLoad"),He=l(e=>{const r=l((t,s,n)=>{if(k(s)&&o.isGlobalCjsLoaderActive()||!le(e,t))return n(t,s);const i=S(t),{fileUrl:c,filePath:m,loadUrl:d}=H(t),u=me(d,s),a=n(d,u);o.logEsm(3,"loaded by next loader",{url:t,loadUrl:d,loaded:a});const p=a.format;if(ne(p)&&R.isFeatureSupported(R.esmLoadReadFile)&&a.responseURL?.startsWith("file:")&&!m.endsWith(".cjs")){const y=Z.readFileSync(f.pathToFileURL(m),"utf8");if(p==="commonjs-typescript"||!m.endsWith(".js")||P.isESM(y)){const M=P.transformSync(y,ae(m,c),{tsconfigRaw:v(m,e)}),g=!i&&o.isGlobalCjsLoaderActive(),C=ie(m,c,i);return a.format="commonjs",a.shouldBeReloadedByCJSLoader=g,a.source=o.inlineSourceMap(M),g||(a.responseURL=`data:text/javascript,${encodeURIComponent(M.code)}?filePath=${encodeURIComponent(C)}`),o.logEsm(3,"returning CJS export annotation",a),a}}if(!a.source)return a;const h=ce(a.source),L=p==="json"&&!k(s);if(p==="commonjs-typescript"){const y=P.transformSync(h,m,{tsconfigRaw:v(m,e)});return{...a,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:o.inlineSourceMap(y)}}if(L||oe(p)||o.tsExtensionsPattern.test(t)){const y=P.transformEsmSync(h,m,{tsconfigRaw:v(m,e)});return{format:"module",source:o.inlineSourceMap(y)}}if(a.format==="module"){const y=P.transformDynamicImport(m,h);y&&(a.source=o.inlineSourceMap(y))}return a},"load");return o.debugEnabled?(t,s,n)=>{o.logEsm(2,"loadSync",{url:t,context:s});const i=r(t,s,n);return o.logEsm(1,"loadedSync",{url:t,result:i}),i}:r},"createLoadSync"),ke=l(e=>{if(o.isFilePath(e)||e.startsWith("#")||e.includes(":"))return!1;const r=e.split("/"),t=r[0]?.startsWith("@")?2:1;return r.length>t&&r.slice(0,t).every(Boolean)},"isBarePackageSubpath"),Ge=l(e=>{const r=e.lastIndexOf(o.nodeModulesPath);if(r===-1)return;const s=e.slice(r+o.nodeModulesPath.length).split(U.sep),n=s[0]?.startsWith("@")?2:1;if(!(s.length<=n||!s[n-1]))return U.join(e.slice(0,r),"node_modules",...s.slice(0,n))},"getPackageDirectory"),de=l((e,r)=>{if(!ke(e)||!r.startsWith(o.fileUrlPrefix))return;const t=f.fileURLToPath(r),s=Ge(t);if(!s)return;const i=P.readJsonFile(U.join(s,"package.json"))?.exports;if(i!=null)return{kind:"root-exports"};const c=P.readJsonFile(U.join(t,"package.json"));return typeof c?.main!="string"||!c.main?{kind:"legacy-directory"}:{kind:"legacy-directory",mainUrl:f.pathToFileURL(U.resolve(t,c.main)).toString()}},"getPackageSubpathDirectoryInfo"),ze=R.isFeatureSupported(R.esmLoadReadFile),ue=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,fe=l(e=>!o.isFilePath(e)&&!ue.test(e),"isTsconfigPathAliasSpecifier"),q=l(e=>{if(e.url)return e.url;const r=e.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,s]=t;if(!U.isAbsolute(s))return;const n=f.pathToFileURL(s);if(n.pathname.endsWith("/")&&(n.pathname+="package.json"),n.pathname.endsWith("/package.json")){const i=P.readJsonFile(n);if(i?.main)return new URL(i.main,n).toString()}else return n.toString()}},"getMissingPathFromNotFound"),j=l(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),N=l(e=>e instanceof Error&&(j(e.code)||e.code==="ERR_UNSUPPORTED_DIR_IMPORT"),"isDirectoryEntryMiss"),x=l(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),G=l(e=>{const r=e.indexOf("?"),t=e.indexOf("#");return r===-1?t:t===-1?r:Math.min(r,t)},"getUrlMetadataIndex"),pe=l((e,r)=>r||!o.isFilePath(e)&&!ue.test(e)?e.indexOf("?"):G(e),"getSpecifierMetadataIndex"),he=l(e=>{if(e?.startsWith(o.fileUrlPrefix))return f.fileURLToPath(new URL(e))},"getParentFilePath"),Xe=l(e=>{if(!e)return!1;const r=he(e);if(r)return o.tsExtensionsPattern.test(r);const t=G(e);return o.tsExtensionsPattern.test(t===-1?e:e.slice(0,t))},"isTypeScriptParent"),b=l(e=>{const r=he(e);return r!==void 0&&o.isDependencyPath(r)},"isParentDependency"),ge=l(e=>U.extname(new URL(e).pathname)===".js"&&o.isDependencyPath(f.fileURLToPath(e)),"isImplicitJavaScriptDependency"),Pe=l((e,r)=>Xe(e)||r&&!b(e),"resolvesTsExtensions"),Ve=l((e,r)=>{const t=G(e),s=t===-1?e:e.slice(0,t);try{if(s.startsWith(o.fileUrlPrefix))return f.fileURLToPath(s);if(U.isAbsolute(s))return s;if(o.isRelativePath(s)&&r?.startsWith(o.fileUrlPrefix))return f.fileURLToPath(new URL(s,r))}catch{}},"getProbeFilePath"),ye=l((e,r)=>{const t=Ve(e,r);return t!==void 0&&!Z.existsSync(t)},"candidateDoesntExist"),A=l(async(e,r,t,s)=>{const n=o.getExtensionResolution(e);if(o.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:n}),!n)return;let i;for(const c of n)if(!ye(c,r.parentURL))try{return await t(c,r)}catch(m){const{code:d}=m;if(!j(d)&&d!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw m;i=m}if(s){if(i===void 0)return t(n[0],r);throw i}},"resolveExtensions"),W=l((e,r,t,s)=>{const n=o.getExtensionResolution(e);if(o.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:n}),!n)return;let i;for(const c of n)if(!ye(c,r.parentURL))try{return t(c,r)}catch(m){const{code:d}=m;if(!j(d)&&d!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw m;i=m}if(s){if(i===void 0)return t(n[0],r);throw i}},"resolveExtensionsSync"),Ke=l(async(e,r,t,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,i=Pe(r.parentURL,n);if(o.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(o.fileUrlPrefix),isRelativePath:o.isRelativePath(e),resolveTsExtensions:i,allowJs:n}),(e.startsWith(o.fileUrlPrefix)||o.isRelativePath(e))&&i){const c=await A(e,r,t,void 0);if(o.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:c}),c)return c}try{return await t(e,r)}catch(c){if(o.logEsm(3,"resolveBase error",{specifier:e,context:r,error:c}),c instanceof Error){const m=c;if(j(m.code)){const d=q(m);if(d){const u=await A(d,r,t,void 0);if(u)return u}}}throw c}},"resolveBase"),z=l((e,r,t,s)=>{const n=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1,i=Pe(r.parentURL,n);if(o.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(o.fileUrlPrefix),isRelativePath:o.isRelativePath(e),resolveTsExtensions:i,allowJs:n}),(e.startsWith(o.fileUrlPrefix)||o.isRelativePath(e))&&i){const c=W(e,r,t,void 0);if(o.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:c}),c)return c}try{return t(e,r)}catch(c){if(o.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:c}),c instanceof Error){const m=c;if(j(m.code)){const d=q(m);if(d){const u=W(d,r,t,void 0);if(u)return u}}}throw c}},"resolveBaseSync"),X=l(async(e,r,t,s)=>{if(o.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:o.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),o.isDirectoryPattern.test(e)){const n=new URL(e,r.parentURL);return n.pathname=U.join(n.pathname,"index"),await A(n.toString(),r,t,!0)}try{return await Ke(e,r,t,s)}catch(n){if(n instanceof Error){o.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:n});const i=n;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const c=q(i);if(c){if(e.startsWith("#"))throw n;const m=de(e,c);if(m?.kind==="root-exports")throw n;if(m?.mainUrl){try{return await t(m.mainUrl,r)}catch(a){if(!N(a))throw a}try{return await X(m.mainUrl,r,t,s)}catch(a){if(!N(a))throw a}}const d=`${c}/index`,u=await A(d,r,t);if(u)return u}}}throw n}},"resolveDirectory"),V=l((e,r,t,s)=>{if(o.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:o.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),o.isDirectoryPattern.test(e)){const n=x(r);if(n&&!o.isFilePath(e))return z(e,r,t,s);const i=new URL(e,r.parentURL);return i.pathname=U.join(i.pathname,"index"),n?W(f.fileURLToPath(i),r,t,!1)??z(e,r,t,s):W(i.toString(),r,t,!0)}try{return z(e,r,t,s)}catch(n){if(n instanceof Error){o.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:n});const i=n;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const c=q(i);if(c){if(e.startsWith("#"))throw n;const m=de(e,c);if(m?.kind==="root-exports")throw n;if(m?.mainUrl){try{return t(m.mainUrl,r)}catch(a){if(!N(a))throw a}try{return V(m.mainUrl,r,t,s)}catch(a){if(!N(a))throw a}}const d=`${c}/index`,u=W(d,r,t);if(u)return u}}}throw n}},"resolveDirectorySync"),Ye=l(async(e,r,t,s)=>{const n=fe(e);if(o.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:b(r.parentURL)}),n&&s.parsedTsconfig&&!b(r.parentURL)){const i=o.wt(s.parsedTsconfig,e);o.logEsm(3,"resolveTsPaths",{possiblePaths:i});for(const c of i)try{return await X(f.pathToFileURL(c).toString(),r,t,s)}catch{}}return X(e,r,t,s)},"resolveTsPaths"),Ze=l((e,r,t,s)=>{const n=fe(e);if(o.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:n,tsconfig:s.parsedTsconfig,fromNodeModules:b(r.parentURL)}),n&&s.parsedTsconfig&&!b(r.parentURL)){const i=o.wt(s.parsedTsconfig,e);o.logEsm(3,"resolveTsPathsSync",{possiblePaths:i});for(const c of i)try{return V(f.pathToFileURL(c).toString(),r,t,s)}catch{}}return V(e,r,t,s)},"resolveTsPathsSync"),B="tsx://",D=l((e,r)=>{const t=e.indexOf("#"),s=t===-1?e:e.slice(0,t),n=t===-1?"":e.slice(t);return`${s}${s.includes("?")?"&":"?"}${r}${n}`},"addQuery"),Ue=l((e,r)=>{const t=r.indexOf("#"),s=r[0]==="?"?r.slice(1,t===-1?void 0:t):"",n=t===-1?"":r.slice(t),i=e.indexOf("#"),c=i===-1?e:e.slice(0,i),m=i===-1?"":e.slice(i),d=s?D(c,s):c;return new URL(`${d}${n||m}`).toString()},"mergeUrlMetadata"),Re=l((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(o.fileUrlPrefix)||!o.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),n=[Q(s.search,[J]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return n?(s.pathname+=`%3F${n}`,s.searchParams.set(F,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),et=l(e=>{const r=l(async(t,s,n)=>{if(!e.active||t.startsWith("node:"))return n(t,s);let i=S(t)??(s.parentURL&&S(s.parentURL));if(e.namespace){let h;if(t.startsWith(B)){try{h=JSON.parse(t.slice(B.length))}catch{}h?.namespace&&(i=h.namespace)}if(e.namespace!==i)return n(t,s);h&&(t=h.specifier,s.parentURL=h.parentURL)}const c=pe(t,x(s)),m=c===-1?t:t.slice(0,c),d=c===-1?"":t.slice(c),u=await Ye(m,s,n,e);if(o.logEsm(2,"nextResolve",{resolved:u}),u.format==="builtin")return u;const a={...u};a.url.startsWith(o.fileUrlPrefix)&&(a.format==="module-typescript"?a.format="module":a.format==="commonjs-typescript"?a.format="commonjs":!a.format&&!ge(a.url)&&(a.format=await Ce(a.url),o.logEsm(2,"getFormatFromFileUrl",{resolved:a,format:a.format}))),d&&(a.url=Ue(a.url,d));const p=s.parentURL&&a.format==="commonjs"&&o.implicitTsExtensionsPattern.test(a.url)&&(new URL(s.parentURL).searchParams.has(w)||qe(s.parentURL,t,ze));return i&&S(a.url)===void 0&&(a.url=D(a.url,`${J}${i}`)),p&&(a.url=D(a.url,Je)),(i||p)&&(a.url=Re(a.url,a.format,i)),a},"resolve");return o.debugEnabled?async(t,s,n)=>{o.logEsm(2,"resolve",{specifier:t,context:s});const i=await r(t,s,n);return o.logEsm(1,"resolved",{specifier:t,context:s,result:i}),i}:r},"createResolve"),tt=l(e=>{const r=l((t,s,n)=>{if(!e.active||t.startsWith("node:")||x(s)&&o.isGlobalCjsLoaderActive())return n(t,s);let i=S(t)??(s.parentURL&&S(s.parentURL));if(e.namespace){let p;if(t.startsWith(B)){try{p=JSON.parse(t.slice(B.length))}catch{}p?.namespace&&(i=p.namespace)}if(e.namespace!==i)return n(t,s);p&&(t=p.specifier,s.parentURL=p.parentURL)}const c=pe(t,x(s)),m=c===-1?t:t.slice(0,c),d=c===-1?"":t.slice(c),u=Ze(m,s,n,e);if(o.logEsm(2,"nextResolve",{resolved:u}),u.format==="builtin")return u;const a={...u};return a.url.startsWith(o.fileUrlPrefix)&&(a.format==="module-typescript"?a.format="module":a.format==="commonjs-typescript"?a.format="commonjs":!a.format&&!ge(a.url)&&(a.format=Oe(a.url),o.logEsm(2,"getFormatFromFileUrlSync",{resolved:a,format:a.format}))),d&&(a.url=Ue(a.url,d)),i&&S(a.url)===void 0&&(a.url=D(a.url,`${J}${i}`)),a.url=Re(a.url,a.format,i),a},"resolve");return o.debugEnabled?(t,s,n)=>{o.logEsm(2,"resolveSync",{specifier:t,context:s});const i=r(t,s,n);return o.logEsm(1,"resolvedSync",{specifier:t,context:s,result:i}),i}:r},"createResolveSync"),Se=l(e=>(r,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=t.startsWith(o.fileUrlPrefix)?t:f.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let ve=!1;const rt=l(e=>{const r=[];for(let t=0;t<e.length;t+=1){const s=e[t];if(s==="--import"){const n=e[t+1];n&&r.push(n),t+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),st=l(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),Ee=[new URL("loader.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:T&&T.src||new URL("register-BYFLLcJ9.cjs",document.baseURI).href).toString(),new URL("esm/index.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:T&&T.src||new URL("register-BYFLLcJ9.cjs",document.baseURI).href).toString()],nt=new Set(["tsx","tsx/esm",...Ee,...Ee.map(e=>decodeURI(new URL(e).pathname))]),ot=l(e=>nt.has(e),"isTsxImport"),Te=l(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),at=l(()=>{const e=rt(process.execArgv),r=e.findIndex(ot);return r>0&&e.slice(0,r).some(Te)},"hasCliTypeScriptPreload"),it=st().some(Te)||at(),Le=typeof E.registerHooks=="function"&&R.isFeatureSupported(R.moduleRegisterHooksCjsReload)&&!it,ct=l(e=>{if(!E.register&&!Le)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!ve){const{_resolveFilename:m}=E;E._resolveFilename=(d,...u)=>m(o.interopCjsExports(d),...u),ve=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),Le){const m=te({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),d=E.registerHooks({load:He(m),resolve:tt(m)}),u=l(async()=>{m.active=!1,d.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=Se(e.namespace),u.unregister=u),u}const{port1:t,port2:s}=new Ie.MessageChannel;E.register(`./esm/index.mjs?${Fe.randomUUID()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:T&&T.src||new URL("register-BYFLLcJ9.cjs",document.baseURI).href,data:{port:s,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[s]});const n=e?.onImport,i=n&&(m=>{m.type==="load"&&n(m.url)});i&&(t.on("message",i),t.unref());const c=l(()=>(r===!1&&process.setSourceMapsEnabled(!1),i&&t.off("message",i),t.postMessage("deactivate"),new Promise(m=>{const d=l(u=>{u.type==="deactivated"&&(m(),t.off("message",d))},"onDeactivated");t.on("message",d)})),"unregister");return e?.namespace&&(c.import=Se(e.namespace),c.unregister=c),c},"register");exports.createDefaultData=be,exports.createGlobalPreload=Me,exports.createInitialize=We,exports.createLoad=Qe,exports.createResolve=et,exports.register=ct; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
533530
0.24%2136
0.23%96
1.05%