| "use strict";var r="4.22.3";exports.version=r; |
| var r="4.22.3";export{r as v}; |
| "use strict";var fe=Object.defineProperty;var l=(e,r)=>fe(e,"name",{value:r,configurable:!0});var T=require("node:module"),pe=require("node:worker_threads"),y=require("./node-features-CQLdkVE6.cjs"),n=require("./register-BOkp8V6j.cjs"),g=require("node:url"),ge=require("node:fs"),he=require("node:fs/promises"),h=require("./index-D9F1FXzN.cjs"),z=require("./client-D3mGB526.cjs"),S=require("node:path"),L=typeof document<"u"?document.currentScript:null;const F={active:!0,parsedTsconfig:void 0},X=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=n.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),ye=l(async e=>{if(!e)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(F,X(e)),e.port&&e.port.on("message",r=>{r==="deactivate"&&(F.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Pe=l(()=>(F.parsedTsconfig=n.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),Re=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"||n.tsExtensions.includes(t))return n.getPackageType(e)},"getFormatFromFileUrl"),Ue=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"||n.tsExtensions.includes(t))return n.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),U="tsx-namespace=",$="tsx-commonjs-export-preparse",V=`${$}=1`,j="tsx-commonjs-virtual-query",I=new Map,B=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),W=l((e,r)=>{const t=B(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),Se=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Ee=l(e=>{const r=Se(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 o=s.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),ve=l((e,r,t)=>{const s=I.get(e);if(!s)return!1;try{const[o]=h.parseEsm(s);return o.some(i=>{if(i.d!==-1||i.n!==r)return!1;const m=Ee(s.slice(i.ss,i.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),E=l(e=>{const r=e.indexOf(U);if(r===-1)return;const t=e[r-1];if(t!=="?"&&t!=="&")return;const s=r+U.length,o=e.indexOf("&",s);return o===-1?e.slice(s):e.slice(s,o)},"getNamespace"),K=y.isFeatureSupported(y.importAttributes)?"importAttributes":"importAssertions",Y=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),Z=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Te=y.isFeatureSupported(y.esmLoadReadFile),Le=[`${j}=`],J=[`${$}=`,`${j}=`],v=l((e,r)=>r.parsedTsconfig&&n.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),we=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="",g.fileURLToPath(s)},"getFilePathFromVirtualQuery"),x=l(e=>{const r=e.startsWith(n.fileUrlPrefix)?new URL(e):void 0,t=r?g.fileURLToPath(r):e,s=r&&we(r),o=s||t,i=r&&s?g.pathToFileURL(o).toString()+W(r.search,Le):e;return{fileUrl:r,filePath:o,loadUrl:i}},"getFileLoadContext"),k=l((e,r)=>{if(!r?.search)return e;const t=W(r.search,J);return t?g.pathToFileURL(e).toString()+t:e},"getTransformPath"),ee=l((e,r,t)=>{const s=[...r?B(r.search,[U,...J]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),Fe=new TextDecoder,te=l(e=>typeof e=="string"?e:Fe.decode(e),"decodeSource"),je=l((e,r)=>{const t=new URL(r),s=r.startsWith(n.fileUrlPrefix)?x(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete($),t.searchParams.delete(j),s&&(t.pathname=new URL(g.pathToFileURL(s)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),re=l((e,r)=>{if(!e.active)return!1;const t=E(r);if(e.namespace&&e.namespace!==t)return!1;const s=je(e,r);return z.parent.send&&z.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),se=l((e,r)=>{if(!n.isJsonPattern.test(e))return r;const t=r[K];return t?.type?r:{...r,[K]:{...t,type:"json"}}},"prepareJsonAttributes"),Q=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Ie=l(e=>{const r=l(async(t,s,o)=>{if(!re(e,t))return o(t,s);const i=E(t),{fileUrl:m,filePath:c,loadUrl:a}=x(t),u=se(a,s),d=await o(a,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const P=m?.searchParams.has($)===!0,R=d.format,w=m?new URL(g.pathToFileURL(c)):void 0;if(w&&m&&(w.search=W(m.search,J)),Y(R)&&m&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await he.readFile(g.pathToFileURL(c),"utf8"),b=h.isESM(f);if(R==="commonjs-typescript"||!c.endsWith(".js")||b){if(!Te){if(P&&b&&n.implicitTsExtensionsPattern.test(c)){const C=await h.transform(f,c,{define:{"import.meta.url":JSON.stringify(w.toString())},tsconfigRaw:v(c,e)});return I.set(t,C.code),{format:"module",source:n.inlineSourceMap(C)}}return d}if(!i&&!P&&!c.endsWith(".cts"))return d;const G=!!(i||P||W(m.search,J)),D=h.transformSync(f,k(c,m),{cjsBanner:G?`require = require("node:module").createRequire(${JSON.stringify(g.pathToFileURL(c).toString())});`:void 0,tsconfigRaw:v(c,e)});if(d.format="commonjs",d.source=n.inlineSourceMap(D),G){const C=ee(c,m,i);d.responseURL=`data:text/javascript,${encodeURIComponent(D.code)}?filePath=${encodeURIComponent(C)}`}return n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const p=te(d.source),_=R==="json"&&!Q(s);if(R==="commonjs-typescript"){const f=h.transformSync(p,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",source:n.inlineSourceMap(f)}}if(_||Z(R)||n.tsExtensionsPattern.test(t)){const f=await h.transform(p,c,{tsconfigRaw:v(c,e)});return I.set(t,f.code),{format:"module",source:n.inlineSourceMap(f)}}if(d.format==="module"){const f=h.transformDynamicImport(c,p);f?(d.source=n.inlineSourceMap(f),I.set(t,f.code)):I.set(t,p)}return d},"load2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"load",{url:t,context:s});const i=await r(t,s,o);return n.logEsm(1,"loaded",{url:t,result:i}),i}:r},"createLoad"),_e=l(e=>{const r=l((t,s,o)=>{if(Q(s)&&n.isGlobalCjsLoaderActive()||!re(e,t))return o(t,s);const i=E(t),{fileUrl:m,filePath:c,loadUrl:a}=x(t),u=se(a,s),d=o(a,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const P=d.format;if(Y(P)&&y.isFeatureSupported(y.esmLoadReadFile)&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=ge.readFileSync(g.pathToFileURL(c),"utf8");if(P==="commonjs-typescript"||!c.endsWith(".js")||h.isESM(p)){const _=h.transformSync(p,k(c,m),{tsconfigRaw:v(c,e)}),f=!i&&n.isGlobalCjsLoaderActive(),b=ee(c,m,i);return d.format="commonjs",d.shouldBeReloadedByCJSLoader=f,d.source=n.inlineSourceMap(_),f||(d.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent(b)}`),n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const R=te(d.source),w=P==="json"&&!Q(s);if(P==="commonjs-typescript"){const p=h.transformSync(R,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:n.inlineSourceMap(p)}}if(w||Z(P)||n.tsExtensionsPattern.test(t)){const p=h.transformEsmSync(R,c,{tsconfigRaw:v(c,e)});return{format:"module",source:n.inlineSourceMap(p)}}if(d.format==="module"){const p=h.transformDynamicImport(c,R);p&&(d.source=n.inlineSourceMap(p))}return d},"load2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"loadSync",{url:t,context:s});const i=r(t,s,o);return n.logEsm(1,"loadedSync",{url:t,result:i}),i}:r},"createLoadSync"),be=Ie(F),Ce=y.isFeatureSupported(y.esmLoadReadFile),$e=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,oe=l(e=>!n.isFilePath(e)&&!$e.test(e),"isTsconfigPathAliasSpecifier"),M=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 o=g.pathToFileURL(s);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const i=h.readJsonFile(o);if(i?.main)return new URL(i.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),O=l(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),N=l(async(e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let i;for(const m of o)try{return await t(m,r)}catch(c){const{code:a}=c;if(!O(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensions"),q=l((e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let i;for(const m of o)try{return t(m,r)}catch(c){const{code:a}=c;if(!O(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensionsSync"),We=l(async(e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const i=await N(e,r,t);if(n.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return await t(e,r)}catch(i){if(n.logEsm(3,"resolveBase error",{specifier:e,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const c=M(m);if(c){const a=await N(c,r,t);if(a)return a}}}throw i}},"resolveBase"),Je=l((e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const i=q(e,r,t);if(n.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return t(e,r)}catch(i){if(n.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const c=M(m);if(c){const a=q(c,r,t);if(a)return a}}}throw i}},"resolveBaseSync"),ne=l(async(e,r,t,s)=>{if(n.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=S.join(o.pathname,"index"),await N(o.toString(),r,t,!0)}try{return await We(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:o});const i=o;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(i);if(m)try{return await N(`${m}/index`,r,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectory"),ae=l((e,r,t,s)=>{if(n.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=S.join(o.pathname,"index"),q(o.toString(),r,t,!0)}try{return Je(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:o});const i=o;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(i);if(m)try{return q(`${m}/index`,r,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectorySync"),Me=l(async(e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPaths",{possiblePaths:i});for(const m of i)try{return await ne(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ne(e,r,t,s)},"resolveTsPaths"),Oe=l((e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPathsSync",{possiblePaths:i});for(const m of i)try{return ae(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ae(e,r,t,s)},"resolveTsPathsSync"),A="tsx://",Ne=l(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),H=l((e,r)=>`${e}${e.includes("?")?"&":"?"}${r}`,"addQuery"),ie=l((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(n.fileUrlPrefix)||!n.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),o=[B(s.search,[U]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(s.pathname+=`%3F${o}`,s.searchParams.set(j,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),qe=l(e=>{const r=l(async(t,s,o)=>{if(!e.active||t.startsWith("node:"))return o(t,s);let i=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let d;if(t.startsWith(A)){try{d=JSON.parse(t.slice(A.length))}catch{}d?.namespace&&(i=d.namespace)}if(e.namespace!==i)return o(t,s);d&&(t=d.specifier,s.parentURL=d.parentURL)}const[m,c]=t.split("?"),a=await Me(m,s,o,e);if(n.logEsm(2,"nextResolve",{resolved:a}),a.format==="builtin")return a;(!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(n.fileUrlPrefix)&&(a.format=await Re(a.url),n.logEsm(2,"getFormatFromFileUrl",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`);const u=s.parentURL&&a.format==="commonjs"&&n.implicitTsExtensionsPattern.test(a.url)&&(s.parentURL.includes(V)||ve(s.parentURL,t,Ce));return i&&!a.url.includes(U)&&(a.url=H(a.url,`${U}${i}`)),u&&(a.url=H(a.url,V)),(i||u)&&(a.url=ie(a.url,a.format,i)),a},"resolve2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"resolve",{specifier:t,context:s});const i=await r(t,s,o);return n.logEsm(1,"resolved",{specifier:t,context:s,result:i}),i}:r},"createResolve"),Ae=l(e=>{const r=l((t,s,o)=>{if(!e.active||t.startsWith("node:")||Ne(s)&&n.isGlobalCjsLoaderActive())return o(t,s);let i=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let u;if(t.startsWith(A)){try{u=JSON.parse(t.slice(A.length))}catch{}u?.namespace&&(i=u.namespace)}if(e.namespace!==i)return o(t,s);u&&(t=u.specifier,s.parentURL=u.parentURL)}const[m,c]=t.split("?"),a=Oe(m,s,o,e);return n.logEsm(2,"nextResolve",{resolved:a}),a.format==="builtin"||((!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(n.fileUrlPrefix)&&(a.format=Ue(a.url),n.logEsm(2,"getFormatFromFileUrlSync",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`),i&&!a.url.includes(U)&&(a.url=H(a.url,`${U}${i}`)),a.url=ie(a.url,a.format,i)),a},"resolve2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"resolveSync",{specifier:t,context:s});const i=r(t,s,o);return n.logEsm(1,"resolvedSync",{specifier:t,context:s,result:i}),i}:r},"createResolveSync"),Be=qe(F),ce=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(n.fileUrlPrefix)?t:g.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let le=!1;const xe=l(e=>{const r=[];for(let t=0;t<e.length;t+=1){const s=e[t];if(s==="--import"){const o=e[t+1];o&&r.push(o),t+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),Qe=l(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),me=[new URL("loader.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href).toString(),new URL("esm/index.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href).toString()],He=new Set(["tsx","tsx/esm",...me,...me.map(e=>decodeURI(new URL(e).pathname))]),Ge=l(e=>He.has(e),"isTsxImport"),de=l(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),De=l(()=>{const e=xe(process.execArgv),r=e.findIndex(Ge);return r>0&&e.slice(0,r).some(de)},"hasCliTypeScriptPreload"),ze=Qe().some(de)||De(),ue=typeof T.registerHooks=="function"&&y.isFeatureSupported(y.moduleRegisterHooksCjsReload)&&!ze,Xe=l(e=>{if(!T.register&&!ue)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(!le){const{_resolveFilename:c}=T;T._resolveFilename=(a,...u)=>c(n.interopCjsExports(a),...u),le=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),ue){const c=X({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),a=T.registerHooks({load:_e(c),resolve:Ae(c)}),u=l(async()=>{c.active=!1,a.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=ce(e.namespace),u.unregister=u),u}const{port1:t,port2:s}=new pe.MessageChannel;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href,data:{port:s,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[s]});const o=e?.onImport,i=o&&(c=>{c.type==="load"&&o(c.url)});i&&(t.on("message",i),t.unref());const m=l(()=>(r===!1&&process.setSourceMapsEnabled(!1),i&&t.off("message",i),t.postMessage("deactivate"),new Promise(c=>{const a=l(u=>{u.type==="deactivated"&&(c(),t.off("message",a))},"onDeactivated");t.on("message",a)})),"unregister");return e?.namespace&&(m.import=ce(e.namespace),m.unregister=m),m},"register");exports.globalPreload=Pe,exports.initialize=ye,exports.load=be,exports.register=Xe,exports.resolve=Be; |
| var Fe=Object.defineProperty;var i=(e,s)=>Fe(e,"name",{value:s,configurable:!0});import T from"node:module";import{MessageChannel as Ce}from"node:worker_threads";import{i as j,b as _e,e as z,m as $e}from"./node-features-B9BBLzwu.mjs";import{l as te,t as se,g as We,a as Je,d as J,b as d,e as V,f as S,h as L,j as K,k as be,m as g,n as Oe,w as re,o as Ne,p as b,q as oe,s as O,u as Ae}from"./register-BnTWPeIB.mjs";import{pathToFileURL as h,fileURLToPath as ne}from"node:url";import{readFileSync as Me}from"node:fs";import{readFile as Be}from"node:fs/promises";import{p as qe,i as ae,t as ce,a as N,b as ie,c as Qe,r as He}from"./index-XurvG3JN.mjs";import{p as me}from"./client-D_mPDF5S.mjs";import U from"node:path";const I={active:!0,parsedTsconfig:void 0},le=i(e=>{const s={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(s.parsedTsconfig=te(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),s},"createData"),Ge=i(async e=>{if(!e)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(I,le(e)),e.port&&e.port.on("message",s=>{s==="deactivate"&&(I.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Xe=i(()=>(I.parsedTsconfig=te(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),ze=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return We(e)},"getFormatFromFileUrl"),Ve=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return Je(e)},"getFormatFromFileUrlSync"),R="tsx-namespace=",A="tsx-commonjs-export-preparse",de=`${A}=1`,F="tsx-commonjs-virtual-query",C=new Map,D=i((e,s)=>e.slice(1).split("&").filter(t=>t&&s.every(r=>!t.startsWith(r))).join("&"),"getQueryWithoutParameters"),M=i((e,s)=>{const t=D(e,s);return t?`?${t}`:""},"getSearchWithoutParameters"),Ke=i(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),De=i(e=>{const s=Ke(e);if(/^\s*export\s*\*/.test(s))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(s))return"namespace";const t=s.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(r=>{const o=r.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),Ye=i((e,s,t)=>{const r=C.get(e);if(!r)return!1;try{const[o]=qe(r);return o.some(a=>{if(a.d!==-1||a.n!==s)return!1;const m=De(r.slice(a.ss,a.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),v=i(e=>{const s=e.indexOf(R);if(s===-1)return;const t=e[s-1];if(t!=="?"&&t!=="&")return;const r=s+R.length,o=e.indexOf("&",r);return o===-1?e.slice(r):e.slice(r,o)},"getNamespace"),ue=j(_e)?"importAttributes":"importAssertions",fe=i(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),pe=i(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Ze=j(z),xe=[`${F}=`],B=[`${A}=`,`${F}=`],w=i((e,s)=>s.parsedTsconfig&&be(s.parsedTsconfig,e)?s.parsedTsconfig.config:void 0,"getTsconfigRaw"),ke=i(e=>{if(!e.searchParams.has(F))return;const{pathname:s}=e,t=s.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const r=new URL(e);return r.pathname=s.slice(0,t),r.search="",ne(r)},"getFilePathFromVirtualQuery"),Y=i(e=>{const s=e.startsWith(g)?new URL(e):void 0,t=s?ne(s):e,r=s&&ke(s),o=r||t,a=s&&r?h(o).toString()+M(s.search,xe):e;return{fileUrl:s,filePath:o,loadUrl:a}},"getFileLoadContext"),he=i((e,s)=>{if(!s?.search)return e;const t=M(s.search,B);return t?h(e).toString()+t:e},"getTransformPath"),ge=i((e,s,t)=>{const r=[...s?D(s.search,[R,...B]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return r?`${e}?${r}`:e},"getFilePathWithQuery"),et=new TextDecoder,ye=i(e=>typeof e=="string"?e:et.decode(e),"decodeSource"),tt=i((e,s)=>{const t=new URL(s),r=s.startsWith(g)?Y(s).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(A),t.searchParams.delete(F),r&&(t.pathname=new URL(h(r)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),Pe=i((e,s)=>{if(!e.active)return!1;const t=v(s);if(e.namespace&&e.namespace!==t)return!1;const r=tt(e,s);return me.send&&me.send({type:"dependency",path:r}),!0},"prepareLoad"),Se=i((e,s)=>{if(!Oe.test(e))return s;const t=s[ue];return t?.type?s:{...s,[ue]:{...t,type:"json"}}},"prepareJsonAttributes"),Z=i(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),st=i(e=>{const s=i(async(t,r,o)=>{if(!Pe(e,t))return o(t,r);const a=v(t),{fileUrl:m,filePath:c,loadUrl:n}=Y(t),u=Se(n,r),l=await o(n,u);d(3,"loaded by next loader",{url:t,loadUrl:n,loaded:l});const y=m?.searchParams.has(A)===!0,P=l.format,E=m?new URL(h(c)):void 0;if(E&&m&&(E.search=M(m.search,B)),fe(P)&&m&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await Be(h(c),"utf8"),$=ae(f);if(P==="commonjs-typescript"||!c.endsWith(".js")||$){if(!Ze){if(y&&$&&V.test(c)){const W=await ce(f,c,{define:{"import.meta.url":JSON.stringify(E.toString())},tsconfigRaw:w(c,e)});return C.set(t,W.code),{format:"module",source:S(W)}}return l}if(!a&&!y&&!c.endsWith(".cts"))return l;const k=!!(a||y||M(m.search,B)),ee=N(f,he(c,m),{cjsBanner:k?`require = require("node:module").createRequire(${JSON.stringify(h(c).toString())});`:void 0,tsconfigRaw:w(c,e)});if(l.format="commonjs",l.source=S(ee),k){const W=ge(c,m,a);l.responseURL=`data:text/javascript,${encodeURIComponent(ee.code)}?filePath=${encodeURIComponent(W)}`}return d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const p=ye(l.source),_=P==="json"&&!Z(r);if(P==="commonjs-typescript"){const f=N(p,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",source:S(f)}}if(_||pe(P)||L.test(t)){const f=await ce(p,c,{tsconfigRaw:w(c,e)});return C.set(t,f.code),{format:"module",source:S(f)}}if(l.format==="module"){const f=ie(c,p);f?(l.source=S(f),C.set(t,f.code)):C.set(t,p)}return l},"load2");return J?async(t,r,o)=>{d(2,"load",{url:t,context:r});const a=await s(t,r,o);return d(1,"loaded",{url:t,result:a}),a}:s},"createLoad"),rt=i(e=>{const s=i((t,r,o)=>{if(Z(r)&&K()||!Pe(e,t))return o(t,r);const a=v(t),{fileUrl:m,filePath:c,loadUrl:n}=Y(t),u=Se(n,r),l=o(n,u);d(3,"loaded by next loader",{url:t,loadUrl:n,loaded:l});const y=l.format;if(fe(y)&&j(z)&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=Me(h(c),"utf8");if(y==="commonjs-typescript"||!c.endsWith(".js")||ae(p)){const _=N(p,he(c,m),{tsconfigRaw:w(c,e)}),f=!a&&K(),$=ge(c,m,a);return l.format="commonjs",l.shouldBeReloadedByCJSLoader=f,l.source=S(_),f||(l.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent($)}`),d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const P=ye(l.source),E=y==="json"&&!Z(r);if(y==="commonjs-typescript"){const p=N(P,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:S(p)}}if(E||pe(y)||L.test(t)){const p=Qe(P,c,{tsconfigRaw:w(c,e)});return{format:"module",source:S(p)}}if(l.format==="module"){const p=ie(c,P);p&&(l.source=S(p))}return l},"load2");return J?(t,r,o)=>{d(2,"loadSync",{url:t,context:r});const a=s(t,r,o);return d(1,"loadedSync",{url:t,result:a}),a}:s},"createLoadSync"),ot=st(I),nt=j(z),at=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,Re=i(e=>!Ne(e)&&!at.test(e),"isTsconfigPathAliasSpecifier"),q=i(e=>{if(e.url)return e.url;const s=e.message.match(/^Cannot find module '([^']+)'/);if(s){const[,r]=s;return r}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,r]=t;if(!U.isAbsolute(r))return;const o=h(r);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const a=He(o);if(a?.main)return new URL(a.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),Q=i(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),H=i(async(e,s,t,r)=>{const o=oe(e);if(d(3,"resolveExtensions",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let a;for(const m of o)try{return await t(m,s)}catch(c){const{code:n}=c;if(!Q(n)&&n!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensions"),G=i((e,s,t,r)=>{const o=oe(e);if(d(3,"resolveExtensionsSync",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let a;for(const m of o)try{return t(m,s)}catch(c){const{code:n}=c;if(!Q(n)&&n!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensionsSync"),ct=i(async(e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBase",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:O(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||O(e))&&(L.test(s.parentURL)||o)){const a=await H(e,s,t);if(d(3,"resolveBase resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return await t(e,s)}catch(a){if(d(3,"resolveBase error",{specifier:e,context:s,error:a}),a instanceof Error){const m=a;if(Q(m.code)){const c=q(m);if(c){const n=await H(c,s,t);if(n)return n}}}throw a}},"resolveBase"),it=i((e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBaseSync",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:O(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||O(e))&&(L.test(s.parentURL)||o)){const a=G(e,s,t);if(d(3,"resolveBaseSync resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return t(e,s)}catch(a){if(d(3,"resolveBaseSync error",{specifier:e,context:s,error:a}),a instanceof Error){const m=a;if(Q(m.code)){const c=q(m);if(c){const n=G(c,s,t);if(n)return n}}}throw a}},"resolveBaseSync"),Ue=i(async(e,s,t,r)=>{if(d(3,"resolveDirectory",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const o=new URL(e,s.parentURL);return o.pathname=U.join(o.pathname,"index"),await H(o.toString(),s,t,!0)}try{return await ct(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectory error",{specifier:e,context:s,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=q(a);if(m)try{return await H(`${m}/index`,s,t,!0)}catch(c){const n=c,{message:u}=n;throw n.message=n.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),n.stack=n.stack.replace(u,n.message),n}}}throw o}},"resolveDirectory"),ve=i((e,s,t,r)=>{if(d(3,"resolveDirectorySync",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const o=new URL(e,s.parentURL);return o.pathname=U.join(o.pathname,"index"),G(o.toString(),s,t,!0)}try{return it(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectorySync error",{specifier:e,context:s,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=q(a);if(m)try{return G(`${m}/index`,s,t,!0)}catch(c){const n=c,{message:u}=n;throw n.message=n.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),n.stack=n.stack.replace(u,n.message),n}}}throw o}},"resolveDirectorySync"),mt=i(async(e,s,t,r)=>{const o=Re(e);if(d(3,"resolveTsPaths",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPaths",{possiblePaths:a});for(const m of a)try{return await Ue(h(m).toString(),s,t,r)}catch{}}return Ue(e,s,t,r)},"resolveTsPaths"),lt=i((e,s,t,r)=>{const o=Re(e);if(d(3,"resolveTsPathsSync",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPathsSync",{possiblePaths:a});for(const m of a)try{return ve(h(m).toString(),s,t,r)}catch{}}return ve(e,s,t,r)},"resolveTsPathsSync"),X="tsx://",dt=i(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),x=i((e,s)=>`${e}${e.includes("?")?"&":"?"}${s}`,"addQuery"),we=i((e,s,t)=>{if(s!=="commonjs"||!e.startsWith(g)||!V.test(e))return e;const r=new URL(e),o=[D(r.search,[R]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(r.pathname+=`%3F${o}`,r.searchParams.set(F,"1"),r.toString()):e},"preserveCommonJsQueryIdentity"),ut=i(e=>{const s=i(async(t,r,o)=>{if(!e.active||t.startsWith("node:"))return o(t,r);let a=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let l;if(t.startsWith(X)){try{l=JSON.parse(t.slice(X.length))}catch{}l?.namespace&&(a=l.namespace)}if(e.namespace!==a)return o(t,r);l&&(t=l.specifier,r.parentURL=l.parentURL)}const[m,c]=t.split("?"),n=await mt(m,r,o,e);if(d(2,"nextResolve",{resolved:n}),n.format==="builtin")return n;(!n.format||n.format==="commonjs-typescript"||n.format==="module-typescript")&&n.url.startsWith(g)&&(n.format=await ze(n.url),d(2,"getFormatFromFileUrl",{resolved:n,format:n.format})),c&&(n.url+=`?${c}`);const u=r.parentURL&&n.format==="commonjs"&&V.test(n.url)&&(r.parentURL.includes(de)||Ye(r.parentURL,t,nt));return a&&!n.url.includes(R)&&(n.url=x(n.url,`${R}${a}`)),u&&(n.url=x(n.url,de)),(a||u)&&(n.url=we(n.url,n.format,a)),n},"resolve2");return J?async(t,r,o)=>{d(2,"resolve",{specifier:t,context:r});const a=await s(t,r,o);return d(1,"resolved",{specifier:t,context:r,result:a}),a}:s},"createResolve"),ft=i(e=>{const s=i((t,r,o)=>{if(!e.active||t.startsWith("node:")||dt(r)&&K())return o(t,r);let a=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let u;if(t.startsWith(X)){try{u=JSON.parse(t.slice(X.length))}catch{}u?.namespace&&(a=u.namespace)}if(e.namespace!==a)return o(t,r);u&&(t=u.specifier,r.parentURL=u.parentURL)}const[m,c]=t.split("?"),n=lt(m,r,o,e);return d(2,"nextResolve",{resolved:n}),n.format==="builtin"||((!n.format||n.format==="commonjs-typescript"||n.format==="module-typescript")&&n.url.startsWith(g)&&(n.format=Ve(n.url),d(2,"getFormatFromFileUrlSync",{resolved:n,format:n.format})),c&&(n.url+=`?${c}`),a&&!n.url.includes(R)&&(n.url=x(n.url,`${R}${a}`)),n.url=we(n.url,n.format,a)),n},"resolve2");return J?(t,r,o)=>{d(2,"resolveSync",{specifier:t,context:r});const a=s(t,r,o);return d(1,"resolvedSync",{specifier:t,context:r,result:a}),a}:s},"createResolveSync"),pt=ut(I),Te=i(e=>(s,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const r=t.startsWith(g)?t:h(t).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:r,namespace:e})}`)},"createScopedImport");let Le=!1;const ht=i(e=>{const s=[];for(let t=0;t<e.length;t+=1){const r=e[t];if(r==="--import"){const o=e[t+1];o&&s.push(o),t+=1}else r.startsWith("--import=")&&s.push(r.slice(9))}return s},"collectImportSpecifiers"),gt=i(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),Ee=[new URL("loader.mjs",import.meta.url).toString(),new URL("esm/index.mjs",import.meta.url).toString()],yt=new Set(["tsx","tsx/esm",...Ee,...Ee.map(e=>decodeURI(new URL(e).pathname))]),Pt=i(e=>yt.has(e),"isTsxImport"),je=i(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),St=i(()=>{const e=ht(process.execArgv),s=e.findIndex(Pt);return s>0&&e.slice(0,s).some(je)},"hasCliTypeScriptPreload"),Rt=gt().some(je)||St(),Ie=typeof T.registerHooks=="function"&&j($e)&&!Rt,Ut=i(e=>{if(!T.register&&!Ie)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(!Le){const{_resolveFilename:c}=T;T._resolveFilename=(n,...u)=>c(Ae(n),...u),Le=!0}const{sourceMapsEnabled:s}=process;if(process.setSourceMapsEnabled(!0),Ie){const c=le({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),n=T.registerHooks({load:rt(c),resolve:ft(c)}),u=i(async()=>{c.active=!1,n.deregister(),s===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=Te(e.namespace),u.unregister=u),u}const{port1:t,port2:r}=new Ce;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:r,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[r]});const o=e?.onImport,a=o&&(c=>{c.type==="load"&&o(c.url)});a&&(t.on("message",a),t.unref());const m=i(()=>(s===!1&&process.setSourceMapsEnabled(!1),a&&t.off("message",a),t.postMessage("deactivate"),new Promise(c=>{const n=i(u=>{u.type==="deactivated"&&(c(),t.off("message",n))},"onDeactivated");t.on("message",n)})),"unregister");return e?.namespace&&(m.import=Te(e.namespace),m.unregister=m),m},"register");export{Ut as a,Xe as g,Ge as i,ot as l,pt as r}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var m=Object.defineProperty;var s=(r,e)=>m(r,"name",{value:e,configurable:!0});var a=require("../../register-DS7J8l_a.cjs");require("../../get-pipe-path-D4YM6rQt.cjs");var t=require("../../register-BOkp8V6j.cjs");require("../../require-CjvaJWEr.cjs");var n=require("../../node-features-CQLdkVE6.cjs");require("node:module"),require("node:worker_threads"),require("node:url"),require("node:fs"),require("node:fs/promises"),require("../../index-D9F1FXzN.cjs"),require("node:path"),require("esbuild"),require("node:crypto"),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 c=s((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,q=Date.now().toString(),o=t.register({namespace:q});return!n.isFeatureSupported(n.esmLoadReadFile)&&!t.isBarePackageNamePattern.test(r)&&t.cjsExtensionPattern.test(r)?Promise.resolve(o.require(r,u)):a.register({namespace:q,...i?{}:e}).import(r,u)},"tsImport");exports.register=a.register,exports.tsImport=c; | ||
| "use strict";var m=Object.defineProperty;var s=(r,e)=>m(r,"name",{value:e,configurable:!0});var a=require("../../register-CHVGxKtC.cjs");require("../../get-pipe-path-D4YM6rQt.cjs");var t=require("../../register-BOkp8V6j.cjs");require("../../require-CjvaJWEr.cjs");var n=require("../../node-features-CQLdkVE6.cjs");require("node:module"),require("node:worker_threads"),require("node:url"),require("node:fs"),require("node:fs/promises"),require("../../index-D9F1FXzN.cjs"),require("node:path"),require("esbuild"),require("node:crypto"),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 c=s((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,q=Date.now().toString(),o=t.register({namespace:q});return!n.isFeatureSupported(n.esmLoadReadFile)&&!t.isBarePackageNamePattern.test(r)&&t.cjsExtensionPattern.test(r)?Promise.resolve(o.require(r,u)):a.register({namespace:q,...i?{}:e}).import(r,u)},"tsImport");exports.register=a.register,exports.tsImport=c; |
@@ -1,1 +0,1 @@ | ||
| var s=Object.defineProperty;var i=(r,t)=>s(r,"name",{value:t,configurable:!0});import{a as p}from"../../register-Ddio2Vih.mjs";import"../../get-pipe-path-_tAJyU_v.mjs";import{r as n,i as c,c as u}from"../../register-BnTWPeIB.mjs";import"../../require-DzmC1hVr.mjs";import{i as g,e as d}from"../../node-features-B9BBLzwu.mjs";import"node:module";import"node:worker_threads";import"node:url";import"node:fs";import"node:fs/promises";import"../../index-XurvG3JN.mjs";import"node:path";import"esbuild";import"node:crypto";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 f=i((r,t)=>{if(!t||typeof t=="object"&&!t.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const e=typeof t=="string",o=e?t:t.parentURL,m=Date.now().toString(),a=n({namespace:m});return!g(d)&&!c.test(r)&&u.test(r)?Promise.resolve(a.require(r,o)):p({namespace:m,...e?{}:t}).import(r,o)},"tsImport");export{p as register,f as tsImport}; | ||
| var s=Object.defineProperty;var i=(r,t)=>s(r,"name",{value:t,configurable:!0});import{a as p}from"../../register-D_B8UL5H.mjs";import"../../get-pipe-path-_tAJyU_v.mjs";import{r as n,i as c,c as u}from"../../register-BnTWPeIB.mjs";import"../../require-DzmC1hVr.mjs";import{i as g,e as d}from"../../node-features-B9BBLzwu.mjs";import"node:module";import"node:worker_threads";import"node:url";import"node:fs";import"node:fs/promises";import"../../index-XurvG3JN.mjs";import"node:path";import"esbuild";import"node:crypto";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 f=i((r,t)=>{if(!t||typeof t=="object"&&!t.parentURL)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const e=typeof t=="string",o=e?t:t.parentURL,m=Date.now().toString(),a=n({namespace:m});return!g(d)&&!c.test(r)&&u.test(r)?Promise.resolve(a.require(r,o)):p({namespace:m,...e?{}:t}).import(r,o)},"tsImport");export{p as register,f as tsImport}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var i=require("node:worker_threads"),r=require("../node-features-CQLdkVE6.cjs"),e=require("../register-DS7J8l_a.cjs");require("../get-pipe-path-D4YM6rQt.cjs"),require("node:module"),require("node:path"),require("node:url"),require("../register-BOkp8V6j.cjs"),require("node:fs"),require("esbuild"),require("node:crypto"),require("../index-D9F1FXzN.cjs"),require("../client-D3mGB526.cjs"),require("../require-CjvaJWEr.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"),(r.isFeatureSupported(r.moduleRegisterHooksCjsReload)||r.isFeatureSupported(r.moduleRegister)&&i.isMainThread)&&e.register(),exports.globalPreload=e.globalPreload,exports.initialize=e.initialize,exports.load=e.load,exports.resolve=e.resolve; | ||
| "use strict";var l=Object.defineProperty;var a=(e,r)=>l(e,"name",{value:r,configurable:!0});var n=require("node:worker_threads"),t=require("../node-features-CQLdkVE6.cjs"),i=require("../register-CHVGxKtC.cjs");require("../get-pipe-path-D4YM6rQt.cjs"),require("node:module"),require("node:path"),require("node:url"),require("../register-BOkp8V6j.cjs"),require("node:fs"),require("esbuild"),require("node:crypto"),require("../index-D9F1FXzN.cjs"),require("../client-D3mGB526.cjs"),require("../require-CjvaJWEr.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 s(e){var r=Object.create(null);return e&&Object.keys(e).forEach(function(u){if(u!=="default"){var o=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(r,u,o.get?o:{enumerable:!0,get:a(function(){return e[u]},"get")})}}),r.default=e,Object.freeze(r)}a(s,"_interopNamespaceDefault");var q=s(n);(t.isFeatureSupported(t.moduleRegisterHooksCjsReload)&&!q.isInternalThread||t.isFeatureSupported(t.moduleRegister)&&q.isMainThread)&&i.register(),exports.globalPreload=i.globalPreload,exports.initialize=i.initialize,exports.load=i.load,exports.resolve=i.resolve; |
@@ -1,1 +0,1 @@ | ||
| import{isMainThread as r}from"node:worker_threads";import{i as o,m as i,a as m}from"../node-features-B9BBLzwu.mjs";import{a as t}from"../register-Ddio2Vih.mjs";import{g as q,i as w,l as y,r as A}from"../register-Ddio2Vih.mjs";import"../get-pipe-path-_tAJyU_v.mjs";import"node:module";import"node:path";import"node:url";import"../register-BnTWPeIB.mjs";import"node:fs";import"esbuild";import"node:crypto";import"../index-XurvG3JN.mjs";import"../client-D_mPDF5S.mjs";import"../require-DzmC1hVr.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";(o(i)||o(m)&&r)&&t();export{q as globalPreload,w as initialize,y as load,A as resolve}; | ||
| import*as r from"node:worker_threads";import{i as o,m as i,a as t}from"../node-features-B9BBLzwu.mjs";import{a as m}from"../register-D_B8UL5H.mjs";import{g as P,i as S,l as c,r as q}from"../register-D_B8UL5H.mjs";import"../get-pipe-path-_tAJyU_v.mjs";import"node:module";import"node:path";import"node:url";import"../register-BnTWPeIB.mjs";import"node:fs";import"esbuild";import"node:crypto";import"../index-XurvG3JN.mjs";import"../client-D_mPDF5S.mjs";import"../require-DzmC1hVr.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";(o(i)&&!r.isInternalThread||o(t)&&r.isMainThread)&&m();export{P as globalPreload,S as initialize,c as load,q as resolve}; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";var r=require("./get-pipe-path-D4YM6rQt.cjs");require("./esm/index.cjs");var e=require("./register-DS7J8l_a.cjs");require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:worker_threads"),require("./node-features-CQLdkVE6.cjs"),require("node:module"),require("node:url"),require("./register-BOkp8V6j.cjs"),require("node:fs"),require("fs"),require("os"),require("path"),require("./index-D9F1FXzN.cjs"),require("esbuild"),require("node:crypto"),require("./client-D3mGB526.cjs"),require("node:net"),require("node:util"),require("./index-BWFBUo6r.cjs"),require("./require-CjvaJWEr.cjs"),require("node:fs/promises"),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");require("./esm/index.cjs");var e=require("./register-CHVGxKtC.cjs");require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:os"),require("node:worker_threads"),require("./node-features-CQLdkVE6.cjs"),require("node:module"),require("node:url"),require("./register-BOkp8V6j.cjs"),require("node:fs"),require("fs"),require("os"),require("path"),require("./index-D9F1FXzN.cjs"),require("esbuild"),require("node:crypto"),require("./client-D3mGB526.cjs"),require("node:net"),require("node:util"),require("./index-BWFBUo6r.cjs"),require("./require-CjvaJWEr.cjs"),require("node:fs/promises"),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"./esm/index.mjs";import{g as A,i as B,l as C,r as D}from"./register-Ddio2Vih.mjs";import"module";import"node:path";import"./temporary-directory-BDDVQOvU.mjs";import"node:os";import"node:worker_threads";import"./node-features-B9BBLzwu.mjs";import"node:module";import"node:url";import"./register-BnTWPeIB.mjs";import"node:fs";import"fs";import"os";import"path";import"./index-XurvG3JN.mjs";import"esbuild";import"node:crypto";import"./client-D_mPDF5S.mjs";import"node:net";import"node:util";import"./index-gbaejti9.mjs";import"./require-DzmC1hVr.mjs";import"node:fs/promises";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"./esm/index.mjs";import{g as A,i as B,l as C,r as D}from"./register-D_B8UL5H.mjs";import"module";import"node:path";import"./temporary-directory-BDDVQOvU.mjs";import"node:os";import"node:worker_threads";import"./node-features-B9BBLzwu.mjs";import"node:module";import"node:url";import"./register-BnTWPeIB.mjs";import"node:fs";import"fs";import"os";import"path";import"./index-XurvG3JN.mjs";import"esbuild";import"node:crypto";import"./client-D_mPDF5S.mjs";import"node:net";import"node:util";import"./index-gbaejti9.mjs";import"./require-DzmC1hVr.mjs";import"node:fs/promises";r("./cjs/index.cjs");export{A as globalPreload,B as initialize,C as load,D as resolve}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var a=Object.defineProperty;var i=(r,s)=>a(r,"name",{value:s,configurable:!0});var l=require("./get-pipe-path-D4YM6rQt.cjs"),d=require("node:os"),p=require("node:worker_threads"),f=require("./client-D3mGB526.cjs");require("./suppress-warnings.cjs"),require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:net");const q=i((r,s)=>{const o=new Map;for(const e of r){const n=i(t=>{s(t),process.listenerCount(e)===0&&process.exit(128+d.constants.signals[e])},"hiddenHandler");process.on(e,n),o.set(e,n)}const{listenerCount:c,listeners:u}=process;process.listenerCount=function(e){let n=Reflect.apply(c,this,arguments);return r.includes(e)&&(n-=1),n},process.listeners=function(e){const n=Reflect.apply(u,this,arguments);return r.includes(e)?n.filter(t=>t!==o.get(e)):n}},"bindHiddenSignalsHandler");p.isMainThread&&(l.require("./cjs/index.cjs"),(async()=>{const r=await f.connectingToServer;r&&q(["SIGINT","SIGTERM"],s=>{r({type:"signal",signal:s})})})()); | ||
| "use strict";var a=Object.defineProperty;var i=(r,s)=>a(r,"name",{value:s,configurable:!0});var l=require("./get-pipe-path-D4YM6rQt.cjs"),d=require("node:os"),p=require("node:worker_threads"),f=require("./client-D3mGB526.cjs");require("./suppress-warnings.cjs"),require("module"),require("node:path"),require("./temporary-directory-B83uKxJF.cjs"),require("node:net");const q=i((r,s)=>{const c=new Map;for(const e of r){const n=i(t=>{s(t),process.listenerCount(e)===0&&process.exit(128+d.constants.signals[e])},"hiddenHandler");process.on(e,n),c.set(e,n)}const{listenerCount:o,listeners:u}=process;process.listenerCount=function(e){let n=Reflect.apply(o,this,arguments);return r.includes(e)&&(n-=1),n},process.listeners=function(e){const n=Reflect.apply(u,this,arguments);return r.includes(e)?n.filter(t=>t!==c.get(e)):n}},"bindHiddenSignalsHandler");p.isMainThread&&(l.require("./cjs/index.cjs"),(async()=>{const r=await f.connectingToServer;r&&q(["SIGINT","SIGTERM"],s=>{r({type:"signal",signal:s})})})()); |
+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-Dc6DLSoP.cjs"),q=require("./index-D9F1FXzN.cjs");require("node:path"),require("node:url"),require("esbuild"),require("node:crypto"),require("./node-features-CQLdkVE6.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-CGdS2_oX.cjs"),q=require("./index-D9F1FXzN.cjs");require("node:path"),require("node:url"),require("esbuild"),require("node:crypto"),require("./node-features-CQLdkVE6.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-B1Rq-_ee.mjs";import{t as c}from"./index-XurvG3JN.mjs";import"node:path";import"node:url";import"esbuild";import"node:crypto";import"./node-features-B9BBLzwu.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-DyJMwVU5.mjs";import{t as c}from"./index-XurvG3JN.mjs";import"node:path";import"node:url";import"esbuild";import"node:crypto";import"./node-features-B9BBLzwu.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.22.2", | ||
| "version": "4.22.3", | ||
| "description": "TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
| var r="4.22.2";export{r as v}; |
| "use strict";var r="4.22.2";exports.version=r; |
| var Le=Object.defineProperty;var m=(e,s)=>Le(e,"name",{value:s,configurable:!0});import T from"node:module";import{MessageChannel as Ee}from"node:worker_threads";import{i as j,b as je,e as z,m as Fe}from"./node-features-B9BBLzwu.mjs";import{l as te,t as se,g as Ce,a as Ie,d as W,b as d,e as V,f as R,h as L,j as K,k as _e,m as h,n as $e,w as re,o as Je,p as b,q as oe,s as N,u as We}from"./register-BnTWPeIB.mjs";import{pathToFileURL as g,fileURLToPath as ne}from"node:url";import{readFileSync as be}from"node:fs";import{readFile as Ne}from"node:fs/promises";import{p as Oe,i as ae,t as ce,a as O,b as ie,c as Me,r as Be}from"./index-XurvG3JN.mjs";import{p as me}from"./client-D_mPDF5S.mjs";import v from"node:path";const F={active:!0,parsedTsconfig:void 0},le=m(e=>{const s={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(s.parsedTsconfig=te(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),s},"createData"),Ae=m(async e=>{if(!e)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(F,le(e)),e.port&&e.port.on("message",s=>{s==="deactivate"&&(F.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),qe=m(()=>(F.parsedTsconfig=te(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),Qe=m(e=>{const{pathname:s}=new URL(e),t=v.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return Ce(e)},"getFormatFromFileUrl"),He=m(e=>{const{pathname:s}=new URL(e),t=v.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return Ie(e)},"getFormatFromFileUrlSync"),S="tsx-namespace=",M="tsx-commonjs-export-preparse",de=`${M}=1`,C="tsx-commonjs-virtual-query",I=new Map,Y=m((e,s)=>e.slice(1).split("&").filter(t=>t&&s.every(r=>!t.startsWith(r))).join("&"),"getQueryWithoutParameters"),B=m((e,s)=>{const t=Y(e,s);return t?`?${t}`:""},"getSearchWithoutParameters"),Ge=m(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Xe=m(e=>{const s=Ge(e);if(/^\s*export\s*\*/.test(s))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(s))return"namespace";const t=s.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(r=>{const n=r.trim().split(/\s+as\s+/)[0];return!!(n&&n!=="default")})?"named":void 0},"getCommonJsImportBinding"),ze=m((e,s,t)=>{const r=I.get(e);if(!r)return!1;try{const[n]=Oe(r);return n.some(a=>{if(a.d!==-1||a.n!==s)return!1;const l=Xe(r.slice(a.ss,a.s));return l==="named"||t&&l==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),U=m(e=>{const s=e.indexOf(S);if(s===-1)return;const t=e[s-1];if(t!=="?"&&t!=="&")return;const r=s+S.length,n=e.indexOf("&",r);return n===-1?e.slice(r):e.slice(r,n)},"getNamespace"),ue=j(je)?"importAttributes":"importAssertions",fe=m(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),pe=m(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Ve=j(z),Ke=[`${C}=`],A=[`${M}=`,`${C}=`],w=m((e,s)=>s.parsedTsconfig&&_e(s.parsedTsconfig,e)?s.parsedTsconfig.config:void 0,"getTsconfigRaw"),Ye=m(e=>{if(!e.searchParams.has(C))return;const{pathname:s}=e,t=s.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const r=new URL(e);return r.pathname=s.slice(0,t),r.search="",ne(r)},"getFilePathFromVirtualQuery"),Z=m(e=>{const s=e.startsWith(h)?new URL(e):void 0,t=s?ne(s):e,r=s&&Ye(s),n=r||t,a=s&&r?g(n).toString()+B(s.search,Ke):e;return{fileUrl:s,filePath:n,loadUrl:a}},"getFileLoadContext"),ge=m((e,s)=>{if(!s?.search)return e;const t=B(s.search,A);return t?g(e).toString()+t:e},"getTransformPath"),he=m((e,s,t)=>{const r=[...s?Y(s.search,[S,...A]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return r?`${e}?${r}`:e},"getFilePathWithQuery"),Ze=m((e,s)=>{const t=new URL(s),r=s.startsWith(h)?Z(s).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(M),t.searchParams.delete(C),r&&(t.pathname=new URL(g(r)).pathname);const n=t.toString();return e.port&&e.port.postMessage({type:"load",url:n}),e.onImport?.(n),n},"notifyLoad"),ye=m((e,s)=>{if(!e.active)return!1;const t=U(s);if(e.namespace&&e.namespace!==t)return!1;const r=Ze(e,s);return me.send&&me.send({type:"dependency",path:r}),!0},"prepareLoad"),Pe=m((e,s)=>{if(!$e.test(e))return s;const t=s[ue];return t?.type?s:{...s,[ue]:{...t,type:"json"}}},"prepareJsonAttributes"),D=m(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),De=m(e=>{const s=m(async(t,r,n)=>{if(!ye(e,t))return n(t,r);const a=U(t),{fileUrl:l,filePath:c,loadUrl:o}=Z(t),u=Pe(o,r),i=await n(o,u);d(3,"loaded by next loader",{url:t,loadUrl:o,loaded:i});const y=l?.searchParams.has(M)===!0,P=i.format,E=l?new URL(g(c)):void 0;if(E&&l&&(E.search=B(l.search,A)),fe(P)&&l&&i.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await Ne(g(c),"utf8"),$=ae(f);if(P==="commonjs-typescript"||!c.endsWith(".js")||$){if(!Ve){if(y&&$&&V.test(c)){const J=await ce(f,c,{define:{"import.meta.url":JSON.stringify(E.toString())},tsconfigRaw:w(c,e)});return I.set(t,J.code),{format:"module",source:R(J)}}return i}if(!a&&!y&&!c.endsWith(".cts"))return i;const x=!!(a||y||B(l.search,A)),ee=O(f,ge(c,l),{cjsBanner:x?`require = require("node:module").createRequire(${JSON.stringify(g(c).toString())});`:void 0,tsconfigRaw:w(c,e)});if(i.format="commonjs",i.source=R(ee),x){const J=he(c,l,a);i.responseURL=`data:text/javascript,${encodeURIComponent(ee.code)}?filePath=${encodeURIComponent(J)}`}return d(3,"returning CJS export annotation",i),i}}if(!i.source)return i;const p=i.source.toString(),_=P==="json"&&!D(r);if(P==="commonjs-typescript"){const f=O(p,c,{tsconfigRaw:w(c,e)});return{...i,format:"commonjs",source:R(f)}}if(_||pe(P)||L.test(t)){const f=await ce(p,c,{tsconfigRaw:w(c,e)});return I.set(t,f.code),{format:"module",source:R(f)}}if(i.format==="module"){const f=ie(c,p);f?(i.source=R(f),I.set(t,f.code)):I.set(t,p)}return i},"load2");return W?async(t,r,n)=>{d(2,"load",{url:t,context:r});const a=await s(t,r,n);return d(1,"loaded",{url:t,result:a}),a}:s},"createLoad"),ke=m(e=>{const s=m((t,r,n)=>{if(D(r)&&K()||!ye(e,t))return n(t,r);const a=U(t),{fileUrl:l,filePath:c,loadUrl:o}=Z(t),u=Pe(o,r),i=n(o,u);d(3,"loaded by next loader",{url:t,loadUrl:o,loaded:i});const y=i.format;if(fe(y)&&j(z)&&i.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=be(g(c),"utf8");if(y==="commonjs-typescript"||!c.endsWith(".js")||ae(p)){const _=O(p,ge(c,l),{tsconfigRaw:w(c,e)}),f=!a&&K(),$=he(c,l,a);return i.format="commonjs",i.shouldBeReloadedByCJSLoader=f,i.source=R(_),f||(i.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent($)}`),d(3,"returning CJS export annotation",i),i}}if(!i.source)return i;const P=i.source.toString(),E=y==="json"&&!D(r);if(y==="commonjs-typescript"){const p=O(P,c,{tsconfigRaw:w(c,e)});return{...i,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:R(p)}}if(E||pe(y)||L.test(t)){const p=Me(P,c,{tsconfigRaw:w(c,e)});return{format:"module",source:R(p)}}if(i.format==="module"){const p=ie(c,P);p&&(i.source=R(p))}return i},"load2");return W?(t,r,n)=>{d(2,"loadSync",{url:t,context:r});const a=s(t,r,n);return d(1,"loadedSync",{url:t,result:a}),a}:s},"createLoadSync"),xe=De(F),et=j(z),tt=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,Re=m(e=>!Je(e)&&!tt.test(e),"isTsconfigPathAliasSpecifier"),q=m(e=>{if(e.url)return e.url;const s=e.message.match(/^Cannot find module '([^']+)'/);if(s){const[,r]=s;return r}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,r]=t;if(!v.isAbsolute(r))return;const n=g(r);if(n.pathname.endsWith("/")&&(n.pathname+="package.json"),n.pathname.endsWith("/package.json")){const a=Be(n);if(a?.main)return new URL(a.main,n).toString()}else return n.toString()}},"getMissingPathFromNotFound"),Q=m(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),H=m(async(e,s,t,r)=>{const n=oe(e);if(d(3,"resolveExtensions",{url:e,context:s,throwError:r,tryPaths:n}),!n)return;let a;for(const l of n)try{return await t(l,s)}catch(c){const{code:o}=c;if(!Q(o)&&o!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensions"),G=m((e,s,t,r)=>{const n=oe(e);if(d(3,"resolveExtensionsSync",{url:e,context:s,throwError:r,tryPaths:n}),!n)return;let a;for(const l of n)try{return t(l,s)}catch(c){const{code:o}=c;if(!Q(o)&&o!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensionsSync"),st=m(async(e,s,t,r)=>{const n=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBase",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(h),isRelativePath:N(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:n}),(e.startsWith(h)||N(e))&&(L.test(s.parentURL)||n)){const a=await H(e,s,t);if(d(3,"resolveBase resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return await t(e,s)}catch(a){if(d(3,"resolveBase error",{specifier:e,context:s,error:a}),a instanceof Error){const l=a;if(Q(l.code)){const c=q(l);if(c){const o=await H(c,s,t);if(o)return o}}}throw a}},"resolveBase"),rt=m((e,s,t,r)=>{const n=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBaseSync",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(h),isRelativePath:N(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:n}),(e.startsWith(h)||N(e))&&(L.test(s.parentURL)||n)){const a=G(e,s,t);if(d(3,"resolveBaseSync resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return t(e,s)}catch(a){if(d(3,"resolveBaseSync error",{specifier:e,context:s,error:a}),a instanceof Error){const l=a;if(Q(l.code)){const c=q(l);if(c){const o=G(c,s,t);if(o)return o}}}throw a}},"resolveBaseSync"),Se=m(async(e,s,t,r)=>{if(d(3,"resolveDirectory",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const n=new URL(e,s.parentURL);return n.pathname=v.join(n.pathname,"index"),await H(n.toString(),s,t,!0)}try{return await st(e,s,t,r)}catch(n){if(n instanceof Error){d(3,"resolveDirectory error",{specifier:e,context:s,error:n});const a=n;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const l=q(a);if(l)try{return await H(`${l}/index`,s,t,!0)}catch(c){const o=c,{message:u}=o;throw o.message=o.message.replace(`${"/index".replace("/",v.sep)}'`,"'"),o.stack=o.stack.replace(u,o.message),o}}}throw n}},"resolveDirectory"),ve=m((e,s,t,r)=>{if(d(3,"resolveDirectorySync",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const n=new URL(e,s.parentURL);return n.pathname=v.join(n.pathname,"index"),G(n.toString(),s,t,!0)}try{return rt(e,s,t,r)}catch(n){if(n instanceof Error){d(3,"resolveDirectorySync error",{specifier:e,context:s,error:n});const a=n;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const l=q(a);if(l)try{return G(`${l}/index`,s,t,!0)}catch(c){const o=c,{message:u}=o;throw o.message=o.message.replace(`${"/index".replace("/",v.sep)}'`,"'"),o.stack=o.stack.replace(u,o.message),o}}}throw n}},"resolveDirectorySync"),ot=m(async(e,s,t,r)=>{const n=Re(e);if(d(3,"resolveTsPaths",{specifier:e,context:s,tsconfigPathAliasSpecifier:n,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),n&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPaths",{possiblePaths:a});for(const l of a)try{return await Se(g(l).toString(),s,t,r)}catch{}}return Se(e,s,t,r)},"resolveTsPaths"),nt=m((e,s,t,r)=>{const n=Re(e);if(d(3,"resolveTsPathsSync",{specifier:e,context:s,tsconfigPathAliasSpecifier:n,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),n&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPathsSync",{possiblePaths:a});for(const l of a)try{return ve(g(l).toString(),s,t,r)}catch{}}return ve(e,s,t,r)},"resolveTsPathsSync"),X="tsx://",at=m(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),k=m((e,s)=>`${e}${e.includes("?")?"&":"?"}${s}`,"addQuery"),Ue=m((e,s,t)=>{if(s!=="commonjs"||!e.startsWith(h)||!V.test(e))return e;const r=new URL(e),n=[Y(r.search,[S]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return n?(r.pathname+=`%3F${n}`,r.searchParams.set(C,"1"),r.toString()):e},"preserveCommonJsQueryIdentity"),ct=m(e=>{const s=m(async(t,r,n)=>{if(!e.active||t.startsWith("node:"))return n(t,r);let a=U(t)??(r.parentURL&&U(r.parentURL));if(e.namespace){let i;if(t.startsWith(X)){try{i=JSON.parse(t.slice(X.length))}catch{}i?.namespace&&(a=i.namespace)}if(e.namespace!==a)return n(t,r);i&&(t=i.specifier,r.parentURL=i.parentURL)}const[l,c]=t.split("?"),o=await ot(l,r,n,e);if(d(2,"nextResolve",{resolved:o}),o.format==="builtin")return o;(!o.format||o.format==="commonjs-typescript"||o.format==="module-typescript")&&o.url.startsWith(h)&&(o.format=await Qe(o.url),d(2,"getFormatFromFileUrl",{resolved:o,format:o.format})),c&&(o.url+=`?${c}`);const u=r.parentURL&&o.format==="commonjs"&&V.test(o.url)&&(r.parentURL.includes(de)||ze(r.parentURL,t,et));return a&&!o.url.includes(S)&&(o.url=k(o.url,`${S}${a}`)),u&&(o.url=k(o.url,de)),(a||u)&&(o.url=Ue(o.url,o.format,a)),o},"resolve2");return W?async(t,r,n)=>{d(2,"resolve",{specifier:t,context:r});const a=await s(t,r,n);return d(1,"resolved",{specifier:t,context:r,result:a}),a}:s},"createResolve"),it=m(e=>{const s=m((t,r,n)=>{if(!e.active||t.startsWith("node:")||at(r)&&K())return n(t,r);let a=U(t)??(r.parentURL&&U(r.parentURL));if(e.namespace){let u;if(t.startsWith(X)){try{u=JSON.parse(t.slice(X.length))}catch{}u?.namespace&&(a=u.namespace)}if(e.namespace!==a)return n(t,r);u&&(t=u.specifier,r.parentURL=u.parentURL)}const[l,c]=t.split("?"),o=nt(l,r,n,e);return d(2,"nextResolve",{resolved:o}),o.format==="builtin"||((!o.format||o.format==="commonjs-typescript"||o.format==="module-typescript")&&o.url.startsWith(h)&&(o.format=He(o.url),d(2,"getFormatFromFileUrlSync",{resolved:o,format:o.format})),c&&(o.url+=`?${c}`),a&&!o.url.includes(S)&&(o.url=k(o.url,`${S}${a}`)),o.url=Ue(o.url,o.format,a)),o},"resolve2");return W?(t,r,n)=>{d(2,"resolveSync",{specifier:t,context:r});const a=s(t,r,n);return d(1,"resolvedSync",{specifier:t,context:r,result:a}),a}:s},"createResolveSync"),mt=ct(F),we=m(e=>(s,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const r=t.startsWith(h)?t:g(t).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:r,namespace:e})}`)},"createScopedImport");let Te=!1;const lt=m(e=>{const s=typeof T.registerHooks=="function"&&j(Fe);if(!T.register&&!s)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:o}=T;T._resolveFilename=(u,...i)=>o(We(u),...i),Te=!0}const{sourceMapsEnabled:t}=process;if(process.setSourceMapsEnabled(!0),s){const o=le({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),u=T.registerHooks({load:ke(o),resolve:it(o)}),i=m(async()=>{o.active=!1,u.deregister(),t===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(i.import=we(e.namespace),i.unregister=i),i}const{port1:r,port2:n}=new Ee;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:n,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[n]});const a=e?.onImport,l=a&&(o=>{o.type==="load"&&a(o.url)});l&&(r.on("message",l),r.unref());const c=m(()=>(t===!1&&process.setSourceMapsEnabled(!1),l&&r.off("message",l),r.postMessage("deactivate"),new Promise(o=>{const u=m(i=>{i.type==="deactivated"&&(o(),r.off("message",u))},"onDeactivated");r.on("message",u)})),"unregister");return e?.namespace&&(c.import=we(e.namespace),c.unregister=c),c},"register");export{lt as a,qe as g,Ae as i,xe as l,mt as r}; |
| "use strict";var le=Object.defineProperty;var m=(e,r)=>le(e,"name",{value:r,configurable:!0});var T=require("node:module"),me=require("node:worker_threads"),y=require("./node-features-CQLdkVE6.cjs"),n=require("./register-BOkp8V6j.cjs"),g=require("node:url"),de=require("node:fs"),ue=require("node:fs/promises"),h=require("./index-D9F1FXzN.cjs"),X=require("./client-D3mGB526.cjs"),U=require("node:path"),V=typeof document<"u"?document.currentScript:null;const w={active:!0,parsedTsconfig:void 0},D=m(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=n.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),fe=m(async e=>{if(!e)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(w,D(e)),e.port&&e.port.on("message",r=>{r==="deactivate"&&(w.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),pe=m(()=>(w.parsedTsconfig=n.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),ge=m(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"||n.tsExtensions.includes(t))return n.getPackageType(e)},"getFormatFromFileUrl"),he=m(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"||n.tsExtensions.includes(t))return n.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),E="tsx-namespace=",I="tsx-commonjs-export-preparse",K=`${I}=1`,F="tsx-commonjs-virtual-query",j=new Map,A=m((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),$=m((e,r)=>{const t=A(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),ye=m(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Pe=m(e=>{const r=ye(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 a=s.trim().split(/\s+as\s+/)[0];return!!(a&&a!=="default")})?"named":void 0},"getCommonJsImportBinding"),Re=m((e,r,t)=>{const s=j.get(e);if(!s)return!1;try{const[a]=h.parseEsm(s);return a.some(i=>{if(i.d!==-1||i.n!==r)return!1;const d=Pe(s.slice(i.ss,i.s));return d==="named"||t&&d==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),S=m(e=>{const r=e.indexOf(E);if(r===-1)return;const t=e[r-1];if(t!=="?"&&t!=="&")return;const s=r+E.length,a=e.indexOf("&",s);return a===-1?e.slice(s):e.slice(s,a)},"getNamespace"),x=y.isFeatureSupported(y.importAttributes)?"importAttributes":"importAssertions",Y=m(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),Z=m(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Ee=y.isFeatureSupported(y.esmLoadReadFile),Ue=[`${F}=`],J=[`${I}=`,`${F}=`],v=m((e,r)=>r.parsedTsconfig&&n.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),Se=m(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="",g.fileURLToPath(s)},"getFilePathFromVirtualQuery"),B=m(e=>{const r=e.startsWith(n.fileUrlPrefix)?new URL(e):void 0,t=r?g.fileURLToPath(r):e,s=r&&Se(r),a=s||t,i=r&&s?g.pathToFileURL(a).toString()+$(r.search,Ue):e;return{fileUrl:r,filePath:a,loadUrl:i}},"getFileLoadContext"),k=m((e,r)=>{if(!r?.search)return e;const t=$(r.search,J);return t?g.pathToFileURL(e).toString()+t:e},"getTransformPath"),ee=m((e,r,t)=>{const s=[...r?A(r.search,[E,...J]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),ve=m((e,r)=>{const t=new URL(r),s=r.startsWith(n.fileUrlPrefix)?B(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(I),t.searchParams.delete(F),s&&(t.pathname=new URL(g.pathToFileURL(s)).pathname);const a=t.toString();return e.port&&e.port.postMessage({type:"load",url:a}),e.onImport?.(a),a},"notifyLoad"),te=m((e,r)=>{if(!e.active)return!1;const t=S(r);if(e.namespace&&e.namespace!==t)return!1;const s=ve(e,r);return X.parent.send&&X.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),re=m((e,r)=>{if(!n.isJsonPattern.test(e))return r;const t=r[x];return t?.type?r:{...r,[x]:{...t,type:"json"}}},"prepareJsonAttributes"),Q=m(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Te=m(e=>{const r=m(async(t,s,a)=>{if(!te(e,t))return a(t,s);const i=S(t),{fileUrl:d,filePath:c,loadUrl:o}=B(t),u=re(o,s),l=await a(o,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:o,loaded:l});const P=d?.searchParams.has(I)===!0,R=l.format,L=d?new URL(g.pathToFileURL(c)):void 0;if(L&&d&&(L.search=$(d.search,J)),Y(R)&&d&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await ue.readFile(g.pathToFileURL(c),"utf8"),C=h.isESM(f);if(R==="commonjs-typescript"||!c.endsWith(".js")||C){if(!Ee){if(P&&C&&n.implicitTsExtensionsPattern.test(c)){const b=await h.transform(f,c,{define:{"import.meta.url":JSON.stringify(L.toString())},tsconfigRaw:v(c,e)});return j.set(t,b.code),{format:"module",source:n.inlineSourceMap(b)}}return l}if(!i&&!P&&!c.endsWith(".cts"))return l;const G=!!(i||P||$(d.search,J)),z=h.transformSync(f,k(c,d),{cjsBanner:G?`require = require("node:module").createRequire(${JSON.stringify(g.pathToFileURL(c).toString())});`:void 0,tsconfigRaw:v(c,e)});if(l.format="commonjs",l.source=n.inlineSourceMap(z),G){const b=ee(c,d,i);l.responseURL=`data:text/javascript,${encodeURIComponent(z.code)}?filePath=${encodeURIComponent(b)}`}return n.logEsm(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const p=l.source.toString(),_=R==="json"&&!Q(s);if(R==="commonjs-typescript"){const f=h.transformSync(p,c,{tsconfigRaw:v(c,e)});return{...l,format:"commonjs",source:n.inlineSourceMap(f)}}if(_||Z(R)||n.tsExtensionsPattern.test(t)){const f=await h.transform(p,c,{tsconfigRaw:v(c,e)});return j.set(t,f.code),{format:"module",source:n.inlineSourceMap(f)}}if(l.format==="module"){const f=h.transformDynamicImport(c,p);f?(l.source=n.inlineSourceMap(f),j.set(t,f.code)):j.set(t,p)}return l},"load2");return n.debugEnabled?async(t,s,a)=>{n.logEsm(2,"load",{url:t,context:s});const i=await r(t,s,a);return n.logEsm(1,"loaded",{url:t,result:i}),i}:r},"createLoad"),Le=m(e=>{const r=m((t,s,a)=>{if(Q(s)&&n.isGlobalCjsLoaderActive()||!te(e,t))return a(t,s);const i=S(t),{fileUrl:d,filePath:c,loadUrl:o}=B(t),u=re(o,s),l=a(o,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:o,loaded:l});const P=l.format;if(Y(P)&&y.isFeatureSupported(y.esmLoadReadFile)&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=de.readFileSync(g.pathToFileURL(c),"utf8");if(P==="commonjs-typescript"||!c.endsWith(".js")||h.isESM(p)){const _=h.transformSync(p,k(c,d),{tsconfigRaw:v(c,e)}),f=!i&&n.isGlobalCjsLoaderActive(),C=ee(c,d,i);return l.format="commonjs",l.shouldBeReloadedByCJSLoader=f,l.source=n.inlineSourceMap(_),f||(l.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent(C)}`),n.logEsm(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const R=l.source.toString(),L=P==="json"&&!Q(s);if(P==="commonjs-typescript"){const p=h.transformSync(R,c,{tsconfigRaw:v(c,e)});return{...l,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:n.inlineSourceMap(p)}}if(L||Z(P)||n.tsExtensionsPattern.test(t)){const p=h.transformEsmSync(R,c,{tsconfigRaw:v(c,e)});return{format:"module",source:n.inlineSourceMap(p)}}if(l.format==="module"){const p=h.transformDynamicImport(c,R);p&&(l.source=n.inlineSourceMap(p))}return l},"load2");return n.debugEnabled?(t,s,a)=>{n.logEsm(2,"loadSync",{url:t,context:s});const i=r(t,s,a);return n.logEsm(1,"loadedSync",{url:t,result:i}),i}:r},"createLoadSync"),we=Te(w),Fe=y.isFeatureSupported(y.esmLoadReadFile),je=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,se=m(e=>!n.isFilePath(e)&&!je.test(e),"isTsconfigPathAliasSpecifier"),W=m(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 a=g.pathToFileURL(s);if(a.pathname.endsWith("/")&&(a.pathname+="package.json"),a.pathname.endsWith("/package.json")){const i=h.readJsonFile(a);if(i?.main)return new URL(i.main,a).toString()}else return a.toString()}},"getMissingPathFromNotFound"),M=m(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),q=m(async(e,r,t,s)=>{const a=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:a}),!a)return;let i;for(const d of a)try{return await t(d,r)}catch(c){const{code:o}=c;if(!M(o)&&o!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensions"),N=m((e,r,t,s)=>{const a=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:a}),!a)return;let i;for(const d of a)try{return t(d,r)}catch(c){const{code:o}=c;if(!M(o)&&o!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensionsSync"),_e=m(async(e,r,t,s)=>{const a=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:a}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||a)){const i=await q(e,r,t);if(n.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return await t(e,r)}catch(i){if(n.logEsm(3,"resolveBase error",{specifier:e,context:r,error:i}),i instanceof Error){const d=i;if(M(d.code)){const c=W(d);if(c){const o=await q(c,r,t);if(o)return o}}}throw i}},"resolveBase"),Ce=m((e,r,t,s)=>{const a=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:a}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||a)){const i=N(e,r,t);if(n.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return t(e,r)}catch(i){if(n.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:i}),i instanceof Error){const d=i;if(M(d.code)){const c=W(d);if(c){const o=N(c,r,t);if(o)return o}}}throw i}},"resolveBaseSync"),oe=m(async(e,r,t,s)=>{if(n.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const a=new URL(e,r.parentURL);return a.pathname=U.join(a.pathname,"index"),await q(a.toString(),r,t,!0)}try{return await _e(e,r,t,s)}catch(a){if(a instanceof Error){n.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:a});const i=a;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const d=W(i);if(d)try{return await q(`${d}/index`,r,t,!0)}catch(c){const o=c,{message:u}=o;throw o.message=o.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),o.stack=o.stack.replace(u,o.message),o}}}throw a}},"resolveDirectory"),ne=m((e,r,t,s)=>{if(n.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const a=new URL(e,r.parentURL);return a.pathname=U.join(a.pathname,"index"),N(a.toString(),r,t,!0)}try{return Ce(e,r,t,s)}catch(a){if(a instanceof Error){n.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:a});const i=a;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const d=W(i);if(d)try{return N(`${d}/index`,r,t,!0)}catch(c){const o=c,{message:u}=o;throw o.message=o.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),o.stack=o.stack.replace(u,o.message),o}}}throw a}},"resolveDirectorySync"),be=m(async(e,r,t,s)=>{const a=se(e);if(n.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:a,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),a&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPaths",{possiblePaths:i});for(const d of i)try{return await oe(g.pathToFileURL(d).toString(),r,t,s)}catch{}}return oe(e,r,t,s)},"resolveTsPaths"),Ie=m((e,r,t,s)=>{const a=se(e);if(n.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:a,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),a&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPathsSync",{possiblePaths:i});for(const d of i)try{return ne(g.pathToFileURL(d).toString(),r,t,s)}catch{}}return ne(e,r,t,s)},"resolveTsPathsSync"),O="tsx://",$e=m(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),H=m((e,r)=>`${e}${e.includes("?")?"&":"?"}${r}`,"addQuery"),ae=m((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(n.fileUrlPrefix)||!n.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),a=[A(s.search,[E]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return a?(s.pathname+=`%3F${a}`,s.searchParams.set(F,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),Je=m(e=>{const r=m(async(t,s,a)=>{if(!e.active||t.startsWith("node:"))return a(t,s);let i=S(t)??(s.parentURL&&S(s.parentURL));if(e.namespace){let l;if(t.startsWith(O)){try{l=JSON.parse(t.slice(O.length))}catch{}l?.namespace&&(i=l.namespace)}if(e.namespace!==i)return a(t,s);l&&(t=l.specifier,s.parentURL=l.parentURL)}const[d,c]=t.split("?"),o=await be(d,s,a,e);if(n.logEsm(2,"nextResolve",{resolved:o}),o.format==="builtin")return o;(!o.format||o.format==="commonjs-typescript"||o.format==="module-typescript")&&o.url.startsWith(n.fileUrlPrefix)&&(o.format=await ge(o.url),n.logEsm(2,"getFormatFromFileUrl",{resolved:o,format:o.format})),c&&(o.url+=`?${c}`);const u=s.parentURL&&o.format==="commonjs"&&n.implicitTsExtensionsPattern.test(o.url)&&(s.parentURL.includes(K)||Re(s.parentURL,t,Fe));return i&&!o.url.includes(E)&&(o.url=H(o.url,`${E}${i}`)),u&&(o.url=H(o.url,K)),(i||u)&&(o.url=ae(o.url,o.format,i)),o},"resolve2");return n.debugEnabled?async(t,s,a)=>{n.logEsm(2,"resolve",{specifier:t,context:s});const i=await r(t,s,a);return n.logEsm(1,"resolved",{specifier:t,context:s,result:i}),i}:r},"createResolve"),We=m(e=>{const r=m((t,s,a)=>{if(!e.active||t.startsWith("node:")||$e(s)&&n.isGlobalCjsLoaderActive())return a(t,s);let i=S(t)??(s.parentURL&&S(s.parentURL));if(e.namespace){let u;if(t.startsWith(O)){try{u=JSON.parse(t.slice(O.length))}catch{}u?.namespace&&(i=u.namespace)}if(e.namespace!==i)return a(t,s);u&&(t=u.specifier,s.parentURL=u.parentURL)}const[d,c]=t.split("?"),o=Ie(d,s,a,e);return n.logEsm(2,"nextResolve",{resolved:o}),o.format==="builtin"||((!o.format||o.format==="commonjs-typescript"||o.format==="module-typescript")&&o.url.startsWith(n.fileUrlPrefix)&&(o.format=he(o.url),n.logEsm(2,"getFormatFromFileUrlSync",{resolved:o,format:o.format})),c&&(o.url+=`?${c}`),i&&!o.url.includes(E)&&(o.url=H(o.url,`${E}${i}`)),o.url=ae(o.url,o.format,i)),o},"resolve2");return n.debugEnabled?(t,s,a)=>{n.logEsm(2,"resolveSync",{specifier:t,context:s});const i=r(t,s,a);return n.logEsm(1,"resolvedSync",{specifier:t,context:s,result:i}),i}:r},"createResolveSync"),Me=Je(w),ie=m(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(n.fileUrlPrefix)?t:g.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let ce=!1;const qe=m(e=>{const r=typeof T.registerHooks=="function"&&y.isFeatureSupported(y.moduleRegisterHooksCjsReload);if(!T.register&&!r)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(!ce){const{_resolveFilename:o}=T;T._resolveFilename=(u,...l)=>o(n.interopCjsExports(u),...l),ce=!0}const{sourceMapsEnabled:t}=process;if(process.setSourceMapsEnabled(!0),r){const o=D({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),u=T.registerHooks({load:Le(o),resolve:We(o)}),l=m(async()=>{o.active=!1,u.deregister(),t===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(l.import=ie(e.namespace),l.unregister=l),l}const{port1:s,port2:a}=new me.MessageChannel;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:V&&V.src||new URL("register-DS7J8l_a.cjs",document.baseURI).href,data:{port:a,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[a]});const i=e?.onImport,d=i&&(o=>{o.type==="load"&&i(o.url)});d&&(s.on("message",d),s.unref());const c=m(()=>(t===!1&&process.setSourceMapsEnabled(!1),d&&s.off("message",d),s.postMessage("deactivate"),new Promise(o=>{const u=m(l=>{l.type==="deactivated"&&(o(),s.off("message",u))},"onDeactivated");s.on("message",u)})),"unregister");return e?.namespace&&(c.import=ie(e.namespace),c.unregister=c),c},"register");exports.globalPreload=pe,exports.initialize=fe,exports.load=we,exports.register=qe,exports.resolve=Me; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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.
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.
Found 2 instances
518243
0.45%2077
0.48%72
2.86%