eslint-cli-bundle 1.0.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +1525 -0
- package/dist/api.js +7 -0
- package/dist/eslint-BTrx12MV.js +256 -0
- package/dist/eslint.js +11 -280
- package/dist/{jiti-xhrF4nV-.js → jiti-BvM1NyiB.js} +1 -1
- package/dist/types-CXey2reC.d.ts +1299 -0
- package/package.json +21 -11
|
@@ -6,4 +6,4 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
6
6
|
`;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},R.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(x.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
|
|
7
7
|
`&&++this.pos;case`
|
|
8
8
|
`:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},R.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
9
|
-
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return E(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),r===`0`&&t!==56&&t!==57||!this.strict&&!e||this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return ne(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},R.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},R.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(h(i,r))this.pos+=i<=65535?1:2;else{if(i!==92)break;this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?m:h)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=E(o),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},R.readWord=function(){var e=this.readWord1(),t=x.name;return this.keywords.test(e)&&(t=ee[e]),this.finishToken(t,e)},D.acorn={Parser:D,version:`8.15.0`,defaultOptions:me,Position:de,SourceLocation:fe,getLineInfo:pe,Node:Fe,TokenType:g,tokTypes:x,keywordTypes:ee,TokContext:M,tokContexts:N,isIdentifierChar:h,isIdentifierStart:m,Token:ut,isNewLine:ne,lineBreak:S,lineBreakG:te,nonASCIIwhitespace:ie};let pt=n(`node:module`),z=n(`node:fs`);String.fromCharCode;let mt=/\/$|\/\?|\/#/,ht=/^\.?\//;function gt(e=``,t){return t?mt.test(e):e.endsWith(`/`)}function _t(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(gt(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function vt(e){return e&&e!==`/`}function yt(e,...t){let n=e||``;for(let e of t.filter(e=>vt(e)))if(n){let t=e.replace(ht,``);n=_t(n)+t}else n=e;return n}let bt=/^[A-Za-z]:\//;function xt(e=``){return e&&e.replace(/\\/g,`/`).replace(bt,e=>e.toUpperCase())}let St=/^[/\\]{2}/,Ct=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,wt=/^[A-Za-z]:$/,Tt=/.(\.[^./]+|\.)$/,Et=function(e){if(e.length===0)return`.`;let t=(e=xt(e)).match(St),n=V(e),r=e[e.length-1]===`/`;return(e=kt(e,!n)).length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),wt.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!V(e)?`/${e}`:e)},B=function(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n;return Et(t)};function Dt(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}let Ot=function(...e){let t=``,n=!1;for(let r=(e=e.map(e=>xt(e))).length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:Dt();i&&i.length!==0&&(t=`${i}/${t}`,n=V(i))}return t=kt(t,!n),n&&!V(t)?`/${t}`:t.length>0?t:`.`};function kt(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o===`/`)break;o=`/`}if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}let V=function(e){return Ct.test(e)},At=function(e){if(e===`..`)return``;let t=Tt.exec(xt(e));return t&&t[1]||``},jt=function(e){let t=xt(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&wt.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(V(e)?`/`:`.`)},Mt=function(e,t){let n=xt(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},H=n(`node:url`),U=n(`node:assert`),W=n(`node:process`),Nt=n(`node:path`),Pt=n(`node:v8`),Ft=n(`node:util`),It=new Set(pt.builtinModules);function Lt(e){return e.replace(/\\/g,`/`)}let Rt={}.hasOwnProperty,zt=/^([A-Z][a-z\d]*)+$/,Bt=new Set([`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`]),G={};function Vt(e,t=`and`){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(`, `)}, ${t} ${e[e.length-1]}`}let Ht=new Map,Ut;function K(e,t,n){return Ht.set(e,t),function(e,t){return n;function n(...n){let r=Error.stackTraceLimit;Wt()&&(Error.stackTraceLimit=0);let i=new e;Wt()&&(Error.stackTraceLimit=r);let a=function(e,t,n){let r=Ht.get(e);if(U(r!==void 0,"expected `message` to be found"),typeof r==`function`)return U(r.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${r.length}).`),Reflect.apply(r,n,t);let i=/%[dfijoOs]/g,a=0;for(;i.exec(r)!==null;)a++;return U(a===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${a}).`),t.length===0?r:(t.unshift(r),Reflect.apply(Ft.format,null,t))}(t,n,i);return Object.defineProperties(i,{message:{value:a,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),Gt(i),i.code=t,i}}(n,e)}function Wt(){try{if(Pt.startupSnapshot.isBuildingSnapshot())return!1}catch{}let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Rt.call(e,`writable`)&&e.writable!==void 0?e.writable:e.set!==void 0}G.ERR_INVALID_ARG_TYPE=K(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{U(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let r=`The `;if(e.endsWith(` argument`))r+=`${e} `;else{let t=e.includes(`.`)?`property`:`argument`;r+=`"${e}" ${t} `}r+=`must be `;let i=[],a=[],o=[];for(let e of t)U(typeof e==`string`,`All expected entries have to be of type string`),Bt.has(e)?i.push(e.toLowerCase()):zt.exec(e)===null?(U(e!==`object`,`The value "object" should be written as "Object"`),o.push(e)):a.push(e);if(a.length>0){let e=i.indexOf(`object`);e!==-1&&(i.slice(e,1),a.push(`Object`))}return i.length>0&&(r+=`${i.length>1?`one of type`:`of type`} ${Vt(i,`or`)}`,(a.length>0||o.length>0)&&(r+=` or `)),a.length>0&&(r+=`an instance of ${Vt(a,`or`)}`,o.length>0&&(r+=` or `)),o.length>0&&(o.length>1?r+=`one of ${Vt(o,`or`)}`:(o[0].toLowerCase()!==o[0]&&(r+=`an `),r+=`${o[0]}`)),r+=`. Received ${function(e){if(e==null)return String(e);if(typeof e==`function`&&e.name)return`function ${e.name}`;if(typeof e==`object`)return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${(0,Ft.inspect)(e,{depth:-1})}`;let t=(0,Ft.inspect)(e,{colors:!1});return t.length>28&&(t=`${t.slice(0,25)}...`),`type ${typeof e} (${t})`}(n)}`,r},TypeError),G.ERR_INVALID_MODULE_SPECIFIER=K(`ERR_INVALID_MODULE_SPECIFIER`,(e,t,n=void 0)=>`Invalid module "${e}" ${t}${n?` imported from ${n}`:``}`,TypeError),G.ERR_INVALID_PACKAGE_CONFIG=K(`ERR_INVALID_PACKAGE_CONFIG`,(e,t,n)=>`Invalid package config ${e}${t?` while importing ${t}`:``}${n?`. ${n}`:``}`,Error),G.ERR_INVALID_PACKAGE_TARGET=K(`ERR_INVALID_PACKAGE_TARGET`,(e,t,n,r=!1,i=void 0)=>{let a=typeof n==`string`&&!r&&n.length>0&&!n.startsWith(`./`);return t===`.`?(U(!1===r),`Invalid "exports" main target ${JSON.stringify(n)} defined in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`):`Invalid "${r?`imports`:`exports`}" target ${JSON.stringify(n)} defined for '${t}' in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`},Error),G.ERR_MODULE_NOT_FOUND=K(`ERR_MODULE_NOT_FOUND`,(e,t,n=!1)=>`Cannot find ${n?`module`:`package`} '${e}' imported from ${t}`,Error),G.ERR_NETWORK_IMPORT_DISALLOWED=K(`ERR_NETWORK_IMPORT_DISALLOWED`,`import of '%s' by %s is not supported: %s`,Error),G.ERR_PACKAGE_IMPORT_NOT_DEFINED=K(`ERR_PACKAGE_IMPORT_NOT_DEFINED`,(e,t,n)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:``} imported from ${n}`,TypeError),G.ERR_PACKAGE_PATH_NOT_EXPORTED=K(`ERR_PACKAGE_PATH_NOT_EXPORTED`,(e,t,n=void 0)=>t===`.`?`No "exports" main defined in ${e}package.json${n?` imported from ${n}`:``}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${n?` imported from ${n}`:``}`,Error),G.ERR_UNSUPPORTED_DIR_IMPORT=K(`ERR_UNSUPPORTED_DIR_IMPORT`,`Directory import '%s' is not supported resolving ES modules imported from %s`,Error),G.ERR_UNSUPPORTED_RESOLVE_REQUEST=K(`ERR_UNSUPPORTED_RESOLVE_REQUEST`,`Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.`,TypeError),G.ERR_UNKNOWN_FILE_EXTENSION=K(`ERR_UNKNOWN_FILE_EXTENSION`,(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError),G.ERR_INVALID_ARG_VALUE=K(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let r=(0,Ft.inspect)(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${r}`},TypeError);let Gt=function(e){let t=`__node_internal_`+e.name;return Object.defineProperty(e,`name`,{value:t}),e}(function(e){let t=Wt();return t&&(Ut=Error.stackTraceLimit,Error.stackTraceLimit=1/0),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=Ut),e}),Kt={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:qt}=G,Jt=new Map;function Yt(e,{base:t,specifier:n}){let r=Jt.get(e);if(r)return r;let i;try{i=z.readFileSync(Nt.toNamespacedPath(e),`utf8`)}catch(e){let t=e;if(t.code!==`ENOENT`)throw t}let a={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:`none`,exports:void 0,imports:void 0};if(i!==void 0){let r;try{r=JSON.parse(i)}catch(r){let i=r,a=new qt(e,(t?`"${n}" from `:``)+(0,H.fileURLToPath)(t||n),i.message);throw a.cause=i,a}a.exists=!0,Kt.call(r,`name`)&&typeof r.name==`string`&&(a.name=r.name),Kt.call(r,`main`)&&typeof r.main==`string`&&(a.main=r.main),Kt.call(r,`exports`)&&(a.exports=r.exports),Kt.call(r,`imports`)&&(a.imports=r.imports),!Kt.call(r,`type`)||r.type!==`commonjs`&&r.type!==`module`||(a.type=r.type)}return Jt.set(e,a),a}function Xt(e){let t=new URL(`package.json`,e);for(;!t.pathname.endsWith(`node_modules/package.json`);){let n=Yt((0,H.fileURLToPath)(t),{specifier:e});if(n.exists)return n;let r=t;if(t=new URL(`../package.json`,t),t.pathname===r.pathname)break}return{pjsonPath:(0,H.fileURLToPath)(t),exists:!1,type:`none`}}function Zt(e){return Xt(e).type}let{ERR_UNKNOWN_FILE_EXTENSION:Qt}=G,$t={}.hasOwnProperty,en={__proto__:null,".cjs":`commonjs`,".js":`module`,".json":`json`,".mjs":`module`},tn={__proto__:null,"data:":function(e){let{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return function(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?`module`:e===`application/json`?`json`:null}(t)},"file:":function(e,t,n){let r=function(e){let t=e.pathname,n=t.length;for(;n--;){let e=t.codePointAt(n);if(e===47)return``;if(e===46)return t.codePointAt(n-1)===47?``:t.slice(n)}return``}(e);if(r===`.js`){let t=Zt(e);return t===`none`?`commonjs`:t}if(r===``){let t=Zt(e);return t===`none`||t===`commonjs`?`commonjs`:`module`}let i=en[r];if(i)return i;if(!n)throw new Qt(r,(0,H.fileURLToPath)(e))},"http:":nn,"https:":nn,"node:":()=>`builtin`};function nn(){}let rn=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:an,ERR_INVALID_PACKAGE_CONFIG:on,ERR_INVALID_PACKAGE_TARGET:sn,ERR_MODULE_NOT_FOUND:cn,ERR_PACKAGE_IMPORT_NOT_DEFINED:ln,ERR_PACKAGE_PATH_NOT_EXPORTED:un,ERR_UNSUPPORTED_DIR_IMPORT:dn,ERR_UNSUPPORTED_RESOLVE_REQUEST:fn}=G,pn={}.hasOwnProperty,mn=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,hn=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,gn=/^\.|%|\\/,_n=/\*/g,vn=/%2f|%5c/i,yn=new Set,bn=/[/\\]{2}/;function xn(e,t,n,r,i,a,o){if(W.noDeprecation)return;let s=(0,H.fileURLToPath)(r),c=bn.exec(o?e:t)!==null;W.emitWarning(`Use of deprecated ${c?`double slash`:`leading or trailing slash matching`} resolving "${e}" for module request "${t}" ${t===n?``:`matched to "${n}" `}in the "${i?`imports`:`exports`}" field module resolution of the package at ${s}${a?` imported from ${(0,H.fileURLToPath)(a)}`:``}.`,`DeprecationWarning`,`DEP0166`)}function Sn(e,t,n,r){if(W.noDeprecation||function(e,t){let n=e.protocol;return $t.call(tn,n)&&tn[n](e,t,!0)||null}(e,{parentURL:n.href})!==`module`)return;let i=(0,H.fileURLToPath)(e.href),a=(0,H.fileURLToPath)(new H.URL(`.`,t)),o=(0,H.fileURLToPath)(n);r?Nt.resolve(a,r)!==i&&W.emitWarning(`Package ${a} has a "main" field set to "${r}", excluding the full filename and extension to the resolved file at "${i.slice(a.length)}", imported from ${o}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`):W.emitWarning(`No "main" or "exports" field defined in the package.json for ${a} resolving the main entry point "${i.slice(a.length)}", imported from ${o}.\nDefault "index" lookups for the main are deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`)}function Cn(e){try{return(0,z.statSync)(e)}catch{}}function wn(e){let t=(0,z.statSync)(e,{throwIfNoEntry:!1}),n=t?t.isFile():void 0;return n!=null&&n}function Tn(e,t,n){let r;if(t.main!==void 0){if(r=new H.URL(t.main,e),wn(r))return r;let i=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],a=-1;for(;++a<i.length&&(r=new H.URL(i[a],e),!wn(r));)r=void 0;if(r)return Sn(r,e,n,t.main),r}let i=[`./index.js`,`./index.json`,`./index.node`],a=-1;for(;++a<i.length&&(r=new H.URL(i[a],e),!wn(r));)r=void 0;if(r)return Sn(r,e,n,t.main),r;throw new cn((0,H.fileURLToPath)(new H.URL(`.`,e)),(0,H.fileURLToPath)(n))}function En(e,t,n){return new un((0,H.fileURLToPath)(new H.URL(`.`,t)),e,n&&(0,H.fileURLToPath)(n))}function Dn(e,t,n,r,i){return t=typeof t==`object`&&t?JSON.stringify(t,null,``):`${t}`,new sn((0,H.fileURLToPath)(new H.URL(`.`,n)),e,t,r,i&&(0,H.fileURLToPath)(i))}function On(e,t,n,r,i,a,o,s,c){if(t!==``&&!a&&e[e.length-1]!==`/`)throw Dn(n,e,r,o,i);if(!e.startsWith(`./`)){if(o&&!e.startsWith(`../`)&&!e.startsWith(`/`)){let n=!1;try{new H.URL(e),n=!0}catch{}if(!n)return Fn(a?rn.call(_n,e,()=>t):e+t,r,c)}throw Dn(n,e,r,o,i)}if(mn.exec(e.slice(2))!==null){if(hn.exec(e.slice(2))!==null)throw Dn(n,e,r,o,i);if(!s){let s=a?n.replace(`*`,()=>t):n+t;xn(a?rn.call(_n,e,()=>t):e,s,n,r,o,i,!0)}}let l=new H.URL(e,r),u=l.pathname,d=new H.URL(`.`,r).pathname;if(!u.startsWith(d))throw Dn(n,e,r,o,i);if(t===``)return l;if(mn.exec(t)!==null){let c=a?n.replace(`*`,()=>t):n+t;hn.exec(t)===null?s||xn(a?rn.call(_n,e,()=>t):e,c,n,r,o,i,!1):(function(e,t,n,r,i){throw new an(e,`request is not a valid match in pattern "${t}" for the "${r?`imports`:`exports`}" resolution of ${(0,H.fileURLToPath)(n)}`,i&&(0,H.fileURLToPath)(i))})(c,n,r,o,i)}return a?new H.URL(rn.call(_n,l.href,()=>t)):new H.URL(t,l)}function kn(e){let t=Number(e);return`${t}`===e&&t>=0&&t<4294967295}function An(e,t,n,r,i,a,o,s,c){if(typeof t==`string`)return On(t,n,r,e,i,a,o,s,c);if(Array.isArray(t)){let l=t;if(l.length===0)return null;let u,d=-1;for(;++d<l.length;){let t=l[d],f;try{f=An(e,t,n,r,i,a,o,s,c)}catch(e){if(u=e,e.code===`ERR_INVALID_PACKAGE_TARGET`)continue;throw e}if(f!==void 0){if(f!==null)return f;u=null}}if(u==null)return null;throw u}if(typeof t==`object`&&t){let l=Object.getOwnPropertyNames(t),u=-1;for(;++u<l.length;)if(kn(l[u]))throw new on((0,H.fileURLToPath)(e),i,`"exports" cannot contain numeric property keys.`);for(u=-1;++u<l.length;){let d=l[u];if(d===`default`||c&&c.has(d)){let l=An(e,t[d],n,r,i,a,o,s,c);if(l===void 0)continue;return l}}return null}if(t===null)return null;throw Dn(r,t,e,o,i)}function jn(e,t,n){if(W.noDeprecation)return;let r=(0,H.fileURLToPath)(t);yn.has(r+`|`+e)||(yn.add(r+`|`+e),W.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${r}${n?` imported from ${(0,H.fileURLToPath)(n)}`:``}. Mapping specifiers ending in "/" is no longer supported.`,`DeprecationWarning`,`DEP0155`))}function Mn(e,t,n,r,i){let a=n.exports;if(function(e,t,n){if(typeof e==`string`||Array.isArray(e))return!0;if(typeof e!=`object`||!e)return!1;let r=Object.getOwnPropertyNames(e),i=!1,a=0,o=-1;for(;++o<r.length;){let e=r[o],s=e===``||e[0]!==`.`;if(a++===0)i=s;else if(i!==s)throw new on((0,H.fileURLToPath)(t),n,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return i}(a,e,r)&&(a={".":a}),pn.call(a,t)&&!t.includes(`*`)&&!t.endsWith(`/`)){let n=An(e,a[t],``,t,r,!1,!1,!1,i);if(n==null)throw En(t,e,r);return n}let o=``,s=``,c=Object.getOwnPropertyNames(a),l=-1;for(;++l<c.length;){let n=c[l],i=n.indexOf(`*`);if(i!==-1&&t.startsWith(n.slice(0,i))){t.endsWith(`/`)&&jn(t,e,r);let a=n.slice(i+1);t.length>=n.length&&t.endsWith(a)&&Nn(o,n)===1&&n.lastIndexOf(`*`)===i&&(o=n,s=t.slice(i,t.length-a.length))}}if(o){let n=An(e,a[o],s,o,r,!0,!1,t.endsWith(`/`),i);if(n==null)throw En(t,e,r);return n}throw En(t,e,r)}function Nn(e,t){let n=e.indexOf(`*`),r=t.indexOf(`*`),i=n===-1?e.length:n+1,a=r===-1?t.length:r+1;return i>a?-1:a>i||n===-1?1:r===-1||e.length>t.length?-1:t.length>e.length?1:0}function Pn(e,t,n){if(e===`#`||e.startsWith(`#/`)||e.endsWith(`/`))throw new an(e,`is not a valid internal imports specifier name`,(0,H.fileURLToPath)(t));let r,i=Xt(t);if(i.exists){r=(0,H.pathToFileURL)(i.pjsonPath);let a=i.imports;if(a)if(pn.call(a,e)&&!e.includes(`*`)){let i=An(r,a[e],``,e,t,!1,!0,!1,n);if(i!=null)return i}else{let i=``,o=``,s=Object.getOwnPropertyNames(a),c=-1;for(;++c<s.length;){let t=s[c],n=t.indexOf(`*`);if(n!==-1&&e.startsWith(t.slice(0,-1))){let r=t.slice(n+1);e.length>=t.length&&e.endsWith(r)&&Nn(i,t)===1&&t.lastIndexOf(`*`)===n&&(i=t,o=e.slice(n,e.length-r.length))}}if(i){let e=An(r,a[i],o,i,t,!0,!0,!1,n);if(e!=null)return e}}}throw function(e,t,n){return new ln(e,t&&(0,H.fileURLToPath)(new H.URL(`.`,t)),(0,H.fileURLToPath)(n))}(e,r,t)}function Fn(e,t,n){if(pt.builtinModules.includes(e))return new H.URL(`node:`+e);let{packageName:r,packageSubpath:i,isScoped:a}=function(e,t){let n=e.indexOf(`/`),r=!0,i=!1;e[0]===`@`&&(i=!0,n===-1||e.length===0?r=!1:n=e.indexOf(`/`,n+1));let a=n===-1?e:e.slice(0,n);if(gn.exec(a)!==null&&(r=!1),!r)throw new an(e,`is not a valid package name`,(0,H.fileURLToPath)(t));return{packageName:a,packageSubpath:`.`+(n===-1?``:e.slice(n)),isScoped:i}}(e,t),o=Xt(t);if(o.exists){let e=(0,H.pathToFileURL)(o.pjsonPath);if(o.name===r&&o.exports!==void 0&&o.exports!==null)return Mn(e,i,o,t,n)}let s,c=new H.URL(`./node_modules/`+r+`/package.json`,t),l=(0,H.fileURLToPath)(c);do{let o=Cn(l.slice(0,-13));if(!o||!o.isDirectory()){s=l,c=new H.URL((a?`../../../../node_modules/`:`../../../node_modules/`)+r+`/package.json`,c),l=(0,H.fileURLToPath)(c);continue}let u=Yt(l,{base:t,specifier:e});return u.exports!==void 0&&u.exports!==null?Mn(c,i,u,t,n):i===`.`?Tn(c,u,t):new H.URL(i,c)}while(l.length!==s.length);throw new cn(r,(0,H.fileURLToPath)(t),!1)}function In(e,t,n,r){let i=t.protocol,a=i===`data:`||i===`http:`||i===`https:`,o;if(function(e){return e!==``&&(e[0]===`/`||function(e){return e[0]===`.`&&(e.length===1||e[1]===`/`||e[1]===`.`&&(e.length===2||e[2]===`/`))}(e))}(e))try{o=new H.URL(e,t)}catch(n){let r=new fn(e,t);throw r.cause=n,r}else if(i===`file:`&&e[0]===`#`)o=Pn(e,t,n);else try{o=new H.URL(e)}catch(r){if(a&&!pt.builtinModules.includes(e)){let n=new fn(e,t);throw n.cause=r,n}o=Fn(e,t,n)}return U(o!==void 0,`expected to be defined`),o.protocol===`file:`?function(e,t){if(vn.exec(e.pathname)!==null)throw new an(e.pathname,`must not include encoded "/" or "\\" characters`,(0,H.fileURLToPath)(t));let n;try{n=(0,H.fileURLToPath)(e)}catch(n){let r=n;throw Object.defineProperty(r,`input`,{value:String(e)}),Object.defineProperty(r,`module`,{value:String(t)}),r}let r=Cn(n.endsWith(`/`)?n.slice(-1):n);if(r&&r.isDirectory()){let r=new dn(n,(0,H.fileURLToPath)(t));throw r.url=String(e),r}if(!r||!r.isFile()){let r=new cn(n||e.pathname,t&&(0,H.fileURLToPath)(t),!0);throw r.url=String(e),r}{let t=(0,z.realpathSync)(n),{search:r,hash:i}=e;(e=(0,H.pathToFileURL)(t+(n.endsWith(Nt.sep)?`/`:``))).search=r,e.hash=i}return e}(o,t):o}function Ln(e){return typeof e!=`string`||e.startsWith(`file://`)?Lt((0,H.fileURLToPath)(e)):Lt(e)}function Rn(e){return(0,H.pathToFileURL)(Ln(e)).toString()}let zn=new Set([`node`,`import`]),Bn=[`.mjs`,`.cjs`,`.js`,`.json`],Vn=new Set([`ERR_MODULE_NOT_FOUND`,`ERR_UNSUPPORTED_DIR_IMPORT`,`MODULE_NOT_FOUND`,`ERR_PACKAGE_PATH_NOT_EXPORTED`]);function Hn(e,t,n){try{return In(e,t,n)}catch(e){if(!Vn.has(e?.code))throw e}}function Un(e,t={}){if(typeof e!=`string`){if(!(e instanceof URL))throw TypeError("input must be a `string` or `URL`");e=Ln(e)}if(/(?:node|data|http|https):/.test(e))return e;if(It.has(e))return`node:`+e;if(e.startsWith(`file://`)&&(e=Ln(e)),V(e))try{if((0,z.statSync)(e).isFile())return Rn(e)}catch(e){if(e?.code!==`ENOENT`)throw e}let n=t.conditions?new Set(t.conditions):zn,r=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(e=>new URL(function(e){return typeof e!=`string`&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:It.has(e)?`node:`+e:`file://`+encodeURI(Lt(e))}(e.toString())));r.length===0&&r.push(new URL(Rn(process.cwd())));let i=[...r];for(let e of r)e.protocol===`file:`&&i.push(new URL(`./`,e),new URL(yt(e.pathname,`_index.js`),e),new URL(`node_modules`,e));let a;for(let r of i){if(a=Hn(e,r,n),a)break;for(let i of[``,`/index`]){for(let o of t.extensions||Bn)if(a=Hn(yt(e,i)+o,r,n),a)break;if(a)break}if(a)break}if(!a){let t=Error(`Cannot find module ${e} imported from ${i.join(`, `)}`);throw t.code=`ERR_MODULE_NOT_FOUND`,t}return Rn(a)}function Wn(e,t){return Un(e,t)}function Gn(e,t){return Ln(Wn(e,t))}let Kn=/(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m,qn=/\/\*.+?\*\/|\/\/.*(?=[nr])/g;function Jn(e,t={}){return t.stripComments&&(e=e.replace(qn,``)),Kn.test(e)}function Yn(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}let Xn=new Set([`/`,`\\`,void 0]),Zn=Symbol.for(`pathe:normalizedAlias`),Qn=/[/\\]/;function $n(e){if(e[Zn])return e;let t=Object.fromEntries(Object.entries(e).sort(([e],[t])=>function(e,t){return t.split(`/`).length-e.split(`/`).length}(e,t)));for(let e in t)for(let n in t)n===e||e.startsWith(n)||t[e]?.startsWith(n)&&Xn.has(t[e][n.length])&&(t[e]=t[n]+t[e].slice(n.length));return Object.defineProperty(t,Zn,{value:!0,enumerable:!1}),t}function er(e=`/`){let t=e[e.length-1];return t===`/`||t===`\\`}var tr={rE:`2.6.1`};let nr=n(`node:crypto`);var rr=i.n(nr);let ir=Object.create(null),ar=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?ir:globalThis),q=new Proxy(ir,{get:(e,t)=>ar()[t]??ir[t],has:(e,t)=>t in ar()||t in ir,set:(e,t,n)=>(ar(!0)[t]=n,!0),deleteProperty(e,t){return t?(delete ar(!0)[t],!0):!1},ownKeys(){let e=ar(!0);return Object.keys(e)}}),or=typeof process<`u`&&process.env&&process.env.NODE_ENV||``,sr=[[`APPVEYOR`],[`AWS_AMPLIFY`,`AWS_APP_ID`,{ci:!0}],[`AZURE_PIPELINES`,`SYSTEM_TEAMFOUNDATIONCOLLECTIONURI`],[`AZURE_STATIC`,`INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN`],[`APPCIRCLE`,`AC_APPCIRCLE`],[`BAMBOO`,`bamboo_planKey`],[`BITBUCKET`,`BITBUCKET_COMMIT`],[`BITRISE`,`BITRISE_IO`],[`BUDDY`,`BUDDY_WORKSPACE_ID`],[`BUILDKITE`],[`CIRCLE`,`CIRCLECI`],[`CIRRUS`,`CIRRUS_CI`],[`CLOUDFLARE_PAGES`,`CF_PAGES`,{ci:!0}],[`CLOUDFLARE_WORKERS`,`WORKERS_CI`,{ci:!0}],[`CODEBUILD`,`CODEBUILD_BUILD_ARN`],[`CODEFRESH`,`CF_BUILD_ID`],[`DRONE`],[`DRONE`,`DRONE_BUILD_EVENT`],[`DSARI`],[`GITHUB_ACTIONS`],[`GITLAB`,`GITLAB_CI`],[`GITLAB`,`CI_MERGE_REQUEST_ID`],[`GOCD`,`GO_PIPELINE_LABEL`],[`LAYERCI`],[`HUDSON`,`HUDSON_URL`],[`JENKINS`,`JENKINS_URL`],[`MAGNUM`],[`NETLIFY`],[`NETLIFY`,`NETLIFY_LOCAL`,{ci:!1}],[`NEVERCODE`],[`RENDER`],[`SAIL`,`SAILCI`],[`SEMAPHORE`],[`SCREWDRIVER`],[`SHIPPABLE`],[`SOLANO`,`TDDIUM`],[`STRIDER`],[`TEAMCITY`,`TEAMCITY_VERSION`],[`TRAVIS`],[`VERCEL`,`NOW_BUILDER`],[`VERCEL`,`VERCEL`,{ci:!1}],[`VERCEL`,`VERCEL_ENV`,{ci:!1}],[`APPCENTER`,`APPCENTER_BUILD_ID`],[`CODESANDBOX`,`CODESANDBOX_SSE`,{ci:!1}],[`CODESANDBOX`,`CODESANDBOX_HOST`,{ci:!1}],[`STACKBLITZ`],[`STORMKIT`],[`CLEAVR`],[`ZEABUR`],[`CODESPHERE`,`CODESPHERE_APP_ID`,{ci:!0}],[`RAILWAY`,`RAILWAY_PROJECT_ID`],[`RAILWAY`,`RAILWAY_SERVICE_ID`],[`DENO-DEPLOY`,`DENO_DEPLOYMENT_ID`],[`FIREBASE_APP_HOSTING`,`FIREBASE_APP_HOSTING`,{ci:!0}]],cr=function(){if(globalThis.process?.env)for(let e of sr){let t=e[1]||e[0];if(globalThis.process?.env[t])return{name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL===`/bin/jsh`&&globalThis.process?.versions?.webcontainer?{name:`stackblitz`,ci:!1}:{name:``,ci:!1}}();cr.name;function lr(e){return!!e&&e!==`false`}let ur=globalThis.process?.platform||``;lr(q.CI)||cr.ci;let dr=lr(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);q.DEBUG,or===`test`||q.TEST;let fr=(q.MINIMAL,/^win/i.test(ur)),pr=(/^linux/i.test(ur),/^darwin/i.test(ur),!lr(q.NO_COLOR)&&(lr(q.FORCE_COLOR)||(dr||fr)&&q.TERM),(globalThis.process?.versions?.node||``).replace(/^v/,``)||null),mr=(Number(pr?.split(`.`)[0]),globalThis.process||Object.create(null)),hr={versions:{}},gr=(new Proxy(mr,{get:(e,t)=>t===`env`?q:t in e?e[t]:t in hr?hr[t]:void 0}),globalThis.process?.release?.name===`node`),_r=!!globalThis.Bun||!!globalThis.process?.versions?.bun,vr=!!globalThis.Deno,yr=!!globalThis.fastly,br=[[!!globalThis.Netlify,`netlify`],[!!globalThis.EdgeRuntime,`edge-light`],[globalThis.navigator?.userAgent===`Cloudflare-Workers`,`workerd`],[yr,`fastly`],[vr,`deno`],[_r,`bun`],[gr,`node`]];(function(){let e=br.find(e=>e[0]);e&&e[1]})();let xr=n(`node:tty`)?.WriteStream?.prototype?.hasColors?.()??!1,J=(e,t)=>{if(!xr)return e=>e;let n=`[${e}m`,r=`[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}},Sr=(J(0,0),J(1,22),J(2,22),J(3,23),J(4,24),J(53,55),J(7,27),J(8,28),J(9,29),J(30,39),J(31,39)),Cr=J(32,39),wr=J(33,39),Tr=J(34,39),Er=(J(35,39),J(36,39)),Dr=(J(37,39),J(90,39));J(40,49),J(41,49),J(42,49),J(43,49),J(44,49),J(45,49),J(46,49),J(47,49),J(100,49),J(91,39),J(92,39),J(93,39),J(94,39),J(95,39),J(96,39),J(97,39),J(101,49),J(102,49),J(103,49),J(104,49),J(105,49),J(106,49),J(107,49);function Or(e){if(typeof e!=`string`||e.startsWith(`file://`))return!1;try{return(0,z.lstatSync)(e).isDirectory()}catch{return!1}}function kr(e,t=8){return(function(){if(jr!==void 0)return jr;try{return jr=!!rr().getFips?.(),jr}catch{return jr=!1,jr}}()?rr().createHash(`sha256`):rr().createHash(`md5`)).update(e).digest(`hex`).slice(0,t)}let Ar={true:Cr(`true`),false:wr(`false`),"[rebuild]":wr(`[rebuild]`),"[esm]":Tr(`[esm]`),"[cjs]":Cr(`[cjs]`),"[import]":Tr(`[import]`),"[require]":Cr(`[require]`),"[native]":Er(`[native]`),"[transpile]":wr(`[transpile]`),"[fallback]":Sr(`[fallback]`),"[unknown]":Sr(`[unknown]`),"[hit]":Cr(`[hit]`),"[miss]":wr(`[miss]`),"[json]":Cr(`[json]`),"[data]":Cr(`[data]`)};function Y(e,...t){if(!e.opts.debug)return;let n=process.cwd();console.log(Dr([`[jiti]`,...t.map(e=>e in Ar?Ar[e]:typeof e==`string`?e.replace(n,`.`):JSON.stringify(e))].join(` `)))}function X(e,t){return e.opts.interopDefault?function(e){let t=typeof e;if(e===null||t!==`object`&&t!==`function`)return e;let n=e.default,r=typeof n,i=n==null,a=r===`object`||r===`function`;return i&&e instanceof Promise?e:new Proxy(e,{get(t,r,o){if(r===`__esModule`)return!0;if(r===`default`)return i?e:typeof n?.default==`function`&&e.__esModule?n.default:n;if(Reflect.has(t,r))return Reflect.get(t,r,o);if(a&&!(n instanceof Promise)){let e=Reflect.get(n,r,o);return typeof e==`function`&&(e=e.bind(n)),e}},apply:(e,t,i)=>typeof e==`function`?Reflect.apply(e,t,i):r===`function`?Reflect.apply(n,t,i):void 0})}(t):t}let jr;function Z(e,t){return!!Q(e,t)}function Q(e,t){let n=process.env[e];if(!(e in process.env))return t;try{return JSON.parse(n)}catch{return t}}let Mr=/\.(c|m)?j(sx?)$/,Nr=/\.(c|m)?t(sx?)$/;function Pr(e,t,n){let r,i;if(e.isNativeRe.test(t))return t;e.alias&&(t=function(e,t){let n=xt(e);t=$n(t);for(let[e,r]of Object.entries(t))if(n.startsWith(e)&&er(n[(er(e)?e.slice(0,-1):e).length]))return B(r,n.slice(e.length));return n}(t,e.alias));let a=n?.parentURL||e.url;Or(a)&&(a=B(a,`_index.js`));let o=(n?.async?[n?.conditions,[`node`,`import`],[`node`,`require`]]:[n?.conditions,[`node`,`require`],[`node`,`import`]]).filter(Boolean);for(let n of o){try{r=Gn(t,{url:a,conditions:n,extensions:e.opts.extensions})}catch(e){i=e}if(r)return r}try{return e.nativeRequire.resolve(t,{paths:n.paths})}catch(e){i=e}for(let i of e.additionalExts)if(r=Fr(e,t+i,a,n)||Fr(e,t+`/index`+i,a,n),r||(Nr.test(e.filename)||Nr.test(e.parentModule?.filename||``)||Mr.test(t))&&(r=Fr(e,t.replace(Mr,`.$1t$2`),a,n),r))return r;if(!n?.try)throw i}function Fr(e,t,n,r){try{return e.nativeRequire.resolve(t,{...r,paths:[jt(Ln(n)),...r?.paths||[]]})}catch{}}let Ir=n(`node:perf_hooks`),Lr=n(`node:vm`);var Rr=i.n(Lr);function zr(e,t,n){let r=e.parentCache||{};if(t.startsWith(`node:`))return $(e,t,n.async);if(t.startsWith(`file:`))t=(0,H.fileURLToPath)(t);else if(t.startsWith(`data:`)){if(!n.async)throw Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");return Y(e,`[native]`,`[data]`,`[import]`,t),$(e,t,!0)}if(pt.builtinModules.includes(t)||t===`.pnp.js`)return $(e,t,n.async);if(e.opts.tryNative&&!e.opts.transformOptions)try{if(!(t=Pr(e,t,n))&&n.try)return;if(Y(e,`[try-native]`,n.async&&e.nativeImport?`[import]`:`[require]`,t),n.async&&e.nativeImport)return e.nativeImport(t).then(n=>(!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],X(e,n)));{let n=e.nativeRequire(t);return!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],X(e,n)}}catch(n){Y(e,`[try-native] Using fallback for ${t} because of an error:`,n)}let i=Pr(e,t,n);if(!i&&n.try)return;let a=At(i);if(a===`.json`){Y(e,`[json]`,i);let t=e.nativeRequire(i);return t&&!(`default`in t)&&Object.defineProperty(t,`default`,{value:t,enumerable:!1}),t}if(a&&!e.opts.extensions.includes(a))return Y(e,`[native]`,`[unknown]`,n.async?`[import]`:`[require]`,i),$(e,i,n.async);if(e.isNativeRe.test(i))return Y(e,`[native]`,n.async?`[import]`:`[require]`,i),$(e,i,n.async);if(r[i])return X(e,r[i]?.exports);if(e.opts.moduleCache){let t=e.nativeRequire.cache[i];if(t?.loaded)return X(e,t.exports)}return Ur(e,(0,z.readFileSync)(i,`utf8`),{id:t,filename:i,ext:a,cache:r,async:n.async})}function $(e,t,n){return n&&e.nativeImport?e.nativeImport(function(e){return fr&&V(e)?Rn(e):e}(t)).then(t=>X(e,t)):X(e,e.nativeRequire(t))}function Br(e,t,n){if(!e.opts.fsCache||!t.filename)return n();let r=` /* v9-${kr(t.source,16)} */\n`,i=`${Mt(jt(t.filename))}-${function(e){let t=e.split(Qn).pop();if(!t)return;let n=t.lastIndexOf(`.`);return n<=0?t:t.slice(0,n)}(t.filename)}`+(e.opts.sourceMaps?`+map`:``)+(t.interopDefault?`.i`:``)+`.${kr(t.filename)}`+(t.async?`.mjs`:`.cjs`);t.jsx&&t.filename.endsWith(`x`)&&(i+=`x`);let a=e.opts.fsCache,o=B(a,i);if(!e.opts.rebuildFsCache&&(0,z.existsSync)(o)){let n=(0,z.readFileSync)(o,`utf8`);if(n.endsWith(r))return Y(e,`[cache]`,`[hit]`,t.filename,`~>`,o),n}Y(e,`[cache]`,`[miss]`,t.filename);let s=n();return s.includes(`__JITI_ERROR__`)||((0,z.writeFileSync)(o,s+r,`utf8`),Y(e,`[cache]`,`[store]`,t.filename,`~>`,o)),s}function Vr(t){if(!0===t.opts.fsCache&&(t.opts.fsCache=function(t){let n=t.filename&&Ot(t.filename,`../node_modules`);if(n&&(0,z.existsSync)(n))return B(n,`.cache/jiti`);let r=(0,e.tmpdir)();if(process.env.TMPDIR&&r===process.cwd()&&!process.env.JITI_RESPECT_TMPDIR_ENV){let t=process.env.TMPDIR;delete process.env.TMPDIR,r=(0,e.tmpdir)(),process.env.TMPDIR=t}return B(r,`jiti`)}(t)),t.opts.fsCache)try{if((0,z.mkdirSync)(t.opts.fsCache,{recursive:!0}),!function(e){try{return(0,z.accessSync)(e,z.constants.W_OK),!0}catch{return!1}}(t.opts.fsCache))throw Error(`directory is not writable!`)}catch(e){Y(t,`Error creating cache directory at `,t.opts.fsCache,e),t.opts.fsCache=!1}}function Hr(e,t){let n=Br(e,t,()=>{let n=e.opts.transform({...e.opts.transformOptions,babel:{...e.opts.sourceMaps?{sourceFileName:t.filename,sourceMaps:`inline`}:{},...e.opts.transformOptions?.babel},interopDefault:e.opts.interopDefault,...t});return n.error&&e.opts.debug&&Y(e,n.error),n.code});return n.startsWith(`#!`)&&(n=`// `+n),n}function Ur(e,t,n={}){let r=n.id||(n.filename?Mt(n.filename):`_jitiEval.${n.ext||(n.async?`mjs`:`js`)}`),i=n.filename||Pr(e,r,{async:n.async}),a=n.ext||At(i),o=n.cache||e.parentCache||{},s=/\.[cm]?tsx?$/.test(a),c=a===`.mjs`||a===`.js`&&function(e){for(;e&&e!==`.`&&e!==`/`;){e=B(e,`..`);try{let t=(0,z.readFileSync)(B(e,`package.json`),`utf8`);try{return JSON.parse(t)}catch{}break}catch{}}}(i)?.type===`module`,l=a===`.cjs`,u=n.forceTranspile??(!l&&!(c&&n.async)&&(s||c||e.isTransformRe.test(i)||Jn(t))),d=Ir.performance.now();if(u){t=Hr(e,{filename:i,source:t,ts:s,async:n.async??!1,jsx:e.opts.jsx});let r=Math.round(1e3*(Ir.performance.now()-d))/1e3;Y(e,`[transpile]`,n.async?`[esm]`:`[cjs]`,i,`(${r}ms)`)}else{if(Y(e,`[native]`,n.async?`[import]`:`[require]`,i),n.async)return Promise.resolve($(e,i,n.async)).catch(r=>(Y(e,`Native import error:`,r),Y(e,`[fallback]`,i),Ur(e,t,{...n,forceTranspile:!0})));try{return $(e,i,n.async)}catch(r){Y(e,`Native require error:`,r),Y(e,`[fallback]`,i),t=Hr(e,{filename:i,source:t,ts:s,async:n.async??!1,jsx:e.opts.jsx})}}let f=new pt.Module(i);f.filename=i,e.parentModule&&(f.parent=e.parentModule,Array.isArray(e.parentModule.children)&&!e.parentModule.children.includes(f)&&e.parentModule.children.push(f));let p=Gr(i,e.opts,{parentModule:f,parentCache:o,nativeImport:e.nativeImport,onError:e.onError,createRequire:e.createRequire},!0),m;f.require=p,f.path=jt(i),f.paths=pt.Module._nodeModulePaths(f.path),o[i]=f,e.opts.moduleCache&&(e.nativeRequire.cache[i]=f);let h=function(e,t){return`(${t?.async?`async `:``}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e}\n});`}(t,{async:n.async});try{m=Rr().runInThisContext(h,{filename:i,lineOffset:0,displayErrors:!1})}catch(t){t.name===`SyntaxError`&&n.async&&e.nativeImport?(Y(e,`[esm]`,`[import]`,`[fallback]`,i),m=function(e,t){let n=`data:text/javascript;base64,${Buffer.from(`export default ${e}`).toString(`base64`)}`;return(...e)=>t(n).then(t=>t.default(...e))}(h,e.nativeImport)):(e.opts.moduleCache&&delete e.nativeRequire.cache[i],e.onError(t))}let g;try{g=m(f.exports,f.require,f,f.filename,jt(f.filename),p.import,p.esmResolve)}catch(t){e.opts.moduleCache&&delete e.nativeRequire.cache[i],e.onError(t)}function _(){if(f.exports&&f.exports.__JITI_ERROR__){let{filename:t,line:n,column:r,code:i,message:a}=f.exports.__JITI_ERROR__,o=Error(`${i}: ${a} \n ${`${t}:${n}:${r}`}`);Error.captureStackTrace(o,zr),e.onError(o)}return f.loaded=!0,X(e,f.exports)}return n.async?Promise.resolve(g).then(_):_()}let Wr=(0,e.platform)()===`win32`;function Gr(e,t={},n,r=!1){let i=r?t:function(e){let t={fsCache:Z(`JITI_FS_CACHE`,Z(`JITI_CACHE`,!0)),rebuildFsCache:Z(`JITI_REBUILD_FS_CACHE`,!1),moduleCache:Z(`JITI_MODULE_CACHE`,Z(`JITI_REQUIRE_CACHE`,!0)),debug:Z(`JITI_DEBUG`,!1),sourceMaps:Z(`JITI_SOURCE_MAPS`,!1),interopDefault:Z(`JITI_INTEROP_DEFAULT`,!0),extensions:Q(`JITI_EXTENSIONS`,[`.js`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`,`.mtsx`,`.ctsx`]),alias:Q(`JITI_ALIAS`,{}),nativeModules:Q(`JITI_NATIVE_MODULES`,[]),transformModules:Q(`JITI_TRANSFORM_MODULES`,[]),tryNative:Q(`JITI_TRY_NATIVE`,`Bun`in globalThis),jsx:Z(`JITI_JSX`,!1)};t.jsx&&t.extensions.push(`.jsx`,`.tsx`);let n={};return e.cache!==void 0&&(n.fsCache=e.cache),e.requireCache!==void 0&&(n.moduleCache=e.requireCache),{...t,...n,...e}}(t),a=i.alias&&Object.keys(i.alias).length>0?$n(i.alias||{}):void 0,o=[`typescript`,`jiti`,...i.nativeModules||[]],s=RegExp(`node_modules/(${o.map(e=>Yn(e)).join(`|`)})/`),c=[...i.transformModules||[]],l=RegExp(`node_modules/(${c.map(e=>Yn(e)).join(`|`)})/`);e||=process.cwd(),!r&&Or(e)&&(e=B(e,`_index.js`));let u=Rn(e),d=[...i.extensions].filter(e=>e!==`.js`),f=n.createRequire(Wr?e.replace(/\//g,`\\`):e),p={filename:e,url:u,opts:i,alias:a,nativeModules:o,transformModules:c,isNativeRe:s,isTransformRe:l,additionalExts:d,nativeRequire:f,onError:n.onError,parentModule:n.parentModule,parentCache:n.parentCache,nativeImport:n.nativeImport,createRequire:n.createRequire};return r||Y(p,`[init]`,...[[`version:`,tr.rE],[`module-cache:`,i.moduleCache],[`fs-cache:`,i.fsCache],[`rebuild-fs-cache:`,i.rebuildFsCache],[`interop-defaults:`,i.interopDefault]].flat()),r||Vr(p),Object.assign(function(e){return zr(p,e,{async:!1})},{cache:i.moduleCache?f.cache:Object.create(null),extensions:f.extensions,main:f.main,options:i,resolve:Object.assign(function(e){return Pr(p,e,{async:!1})},{paths:f.resolve.paths}),transform:e=>Hr(p,e),evalModule:(e,t)=>Ur(p,e,t),async import(e,t){let n=await zr(p,e,{...t,async:!0});return t?.default?n?.default??n:n},esmResolve(e,t){typeof t==`string`&&(t={parentURL:t});let n=Pr(p,e,{parentURL:u,...t,async:!0});return!n||typeof n!=`string`||n.startsWith(`file://`)?n:Rn(n)}})}})(),t.exports=a.default})()}));function o(e){throw e}function s(...e){return d||=i(import.meta.url)(`../dist/babel.cjs`),d(...e)}function c(e,t={}){return t.transform||(t={...t,transform:s}),(0,l.default)(e,t,{onError:o,nativeImport:u,createRequire:i})}var l,u,d;t((()=>{l=e(a(),1),u=e=>import(e)}))();export{c as createJiti};
|
|
9
|
+
`;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return E(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),r===`0`&&t!==56&&t!==57||!this.strict&&!e||this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return ne(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},R.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},R.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(h(i,r))this.pos+=i<=65535?1:2;else{if(i!==92)break;this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?m:h)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=E(o),n=this.pos}t=!1}return e+this.input.slice(n,this.pos)},R.readWord=function(){var e=this.readWord1(),t=x.name;return this.keywords.test(e)&&(t=ee[e]),this.finishToken(t,e)},D.acorn={Parser:D,version:`8.15.0`,defaultOptions:me,Position:de,SourceLocation:fe,getLineInfo:pe,Node:Fe,TokenType:g,tokTypes:x,keywordTypes:ee,TokContext:M,tokContexts:N,isIdentifierChar:h,isIdentifierStart:m,Token:ut,isNewLine:ne,lineBreak:S,lineBreakG:te,nonASCIIwhitespace:ie};let pt=n(`node:module`),z=n(`node:fs`);String.fromCharCode;let mt=/\/$|\/\?|\/#/,ht=/^\.?\//;function gt(e=``,t){return t?mt.test(e):e.endsWith(`/`)}function _t(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(gt(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function vt(e){return e&&e!==`/`}function yt(e,...t){let n=e||``;for(let e of t.filter(e=>vt(e)))if(n){let t=e.replace(ht,``);n=_t(n)+t}else n=e;return n}let bt=/^[A-Za-z]:\//;function xt(e=``){return e&&e.replace(/\\/g,`/`).replace(bt,e=>e.toUpperCase())}let St=/^[/\\]{2}/,Ct=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,wt=/^[A-Za-z]:$/,Tt=/.(\.[^./]+|\.)$/,Et=function(e){if(e.length===0)return`.`;let t=(e=xt(e)).match(St),n=V(e),r=e[e.length-1]===`/`;return(e=kt(e,!n)).length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),wt.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!V(e)?`/${e}`:e)},B=function(...e){let t=``;for(let n of e)if(n)if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n;return Et(t)};function Dt(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}let Ot=function(...e){let t=``,n=!1;for(let r=(e=e.map(e=>xt(e))).length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:Dt();i&&i.length!==0&&(t=`${i}/${t}`,n=V(i))}return t=kt(t,!n),n&&!V(t)?`/${t}`:t.length>0?t:`.`};function kt(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else{if(o===`/`)break;o=`/`}if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}let V=function(e){return Ct.test(e)},At=function(e){if(e===`..`)return``;let t=Tt.exec(xt(e));return t&&t[1]||``},jt=function(e){let t=xt(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&wt.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(V(e)?`/`:`.`)},Mt=function(e,t){let n=xt(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},H=n(`node:url`),U=n(`node:assert`),W=n(`node:process`),Nt=n(`node:path`),Pt=n(`node:v8`),Ft=n(`node:util`),It=new Set(pt.builtinModules);function Lt(e){return e.replace(/\\/g,`/`)}let Rt={}.hasOwnProperty,zt=/^([A-Z][a-z\d]*)+$/,Bt=new Set([`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`]),G={};function Vt(e,t=`and`){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(`, `)}, ${t} ${e[e.length-1]}`}let Ht=new Map,Ut;function K(e,t,n){return Ht.set(e,t),function(e,t){return n;function n(...n){let r=Error.stackTraceLimit;Wt()&&(Error.stackTraceLimit=0);let i=new e;Wt()&&(Error.stackTraceLimit=r);let a=function(e,t,n){let r=Ht.get(e);if(U(r!==void 0,"expected `message` to be found"),typeof r==`function`)return U(r.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${r.length}).`),Reflect.apply(r,n,t);let i=/%[dfijoOs]/g,a=0;for(;i.exec(r)!==null;)a++;return U(a===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${a}).`),t.length===0?r:(t.unshift(r),Reflect.apply(Ft.format,null,t))}(t,n,i);return Object.defineProperties(i,{message:{value:a,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),Gt(i),i.code=t,i}}(n,e)}function Wt(){try{if(Pt.startupSnapshot.isBuildingSnapshot())return!1}catch{}let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Rt.call(e,`writable`)&&e.writable!==void 0?e.writable:e.set!==void 0}G.ERR_INVALID_ARG_TYPE=K(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{U(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let r=`The `;if(e.endsWith(` argument`))r+=`${e} `;else{let t=e.includes(`.`)?`property`:`argument`;r+=`"${e}" ${t} `}r+=`must be `;let i=[],a=[],o=[];for(let e of t)U(typeof e==`string`,`All expected entries have to be of type string`),Bt.has(e)?i.push(e.toLowerCase()):zt.exec(e)===null?(U(e!==`object`,`The value "object" should be written as "Object"`),o.push(e)):a.push(e);if(a.length>0){let e=i.indexOf(`object`);e!==-1&&(i.slice(e,1),a.push(`Object`))}return i.length>0&&(r+=`${i.length>1?`one of type`:`of type`} ${Vt(i,`or`)}`,(a.length>0||o.length>0)&&(r+=` or `)),a.length>0&&(r+=`an instance of ${Vt(a,`or`)}`,o.length>0&&(r+=` or `)),o.length>0&&(o.length>1?r+=`one of ${Vt(o,`or`)}`:(o[0].toLowerCase()!==o[0]&&(r+=`an `),r+=`${o[0]}`)),r+=`. Received ${function(e){if(e==null)return String(e);if(typeof e==`function`&&e.name)return`function ${e.name}`;if(typeof e==`object`)return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${(0,Ft.inspect)(e,{depth:-1})}`;let t=(0,Ft.inspect)(e,{colors:!1});return t.length>28&&(t=`${t.slice(0,25)}...`),`type ${typeof e} (${t})`}(n)}`,r},TypeError),G.ERR_INVALID_MODULE_SPECIFIER=K(`ERR_INVALID_MODULE_SPECIFIER`,(e,t,n=void 0)=>`Invalid module "${e}" ${t}${n?` imported from ${n}`:``}`,TypeError),G.ERR_INVALID_PACKAGE_CONFIG=K(`ERR_INVALID_PACKAGE_CONFIG`,(e,t,n)=>`Invalid package config ${e}${t?` while importing ${t}`:``}${n?`. ${n}`:``}`,Error),G.ERR_INVALID_PACKAGE_TARGET=K(`ERR_INVALID_PACKAGE_TARGET`,(e,t,n,r=!1,i=void 0)=>{let a=typeof n==`string`&&!r&&n.length>0&&!n.startsWith(`./`);return t===`.`?(U(!1===r),`Invalid "exports" main target ${JSON.stringify(n)} defined in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`):`Invalid "${r?`imports`:`exports`}" target ${JSON.stringify(n)} defined for '${t}' in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`},Error),G.ERR_MODULE_NOT_FOUND=K(`ERR_MODULE_NOT_FOUND`,(e,t,n=!1)=>`Cannot find ${n?`module`:`package`} '${e}' imported from ${t}`,Error),G.ERR_NETWORK_IMPORT_DISALLOWED=K(`ERR_NETWORK_IMPORT_DISALLOWED`,`import of '%s' by %s is not supported: %s`,Error),G.ERR_PACKAGE_IMPORT_NOT_DEFINED=K(`ERR_PACKAGE_IMPORT_NOT_DEFINED`,(e,t,n)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:``} imported from ${n}`,TypeError),G.ERR_PACKAGE_PATH_NOT_EXPORTED=K(`ERR_PACKAGE_PATH_NOT_EXPORTED`,(e,t,n=void 0)=>t===`.`?`No "exports" main defined in ${e}package.json${n?` imported from ${n}`:``}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${n?` imported from ${n}`:``}`,Error),G.ERR_UNSUPPORTED_DIR_IMPORT=K(`ERR_UNSUPPORTED_DIR_IMPORT`,`Directory import '%s' is not supported resolving ES modules imported from %s`,Error),G.ERR_UNSUPPORTED_RESOLVE_REQUEST=K(`ERR_UNSUPPORTED_RESOLVE_REQUEST`,`Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.`,TypeError),G.ERR_UNKNOWN_FILE_EXTENSION=K(`ERR_UNKNOWN_FILE_EXTENSION`,(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError),G.ERR_INVALID_ARG_VALUE=K(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let r=(0,Ft.inspect)(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${r}`},TypeError);let Gt=function(e){let t=`__node_internal_`+e.name;return Object.defineProperty(e,`name`,{value:t}),e}(function(e){let t=Wt();return t&&(Ut=Error.stackTraceLimit,Error.stackTraceLimit=1/0),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=Ut),e}),Kt={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:qt}=G,Jt=new Map;function Yt(e,{base:t,specifier:n}){let r=Jt.get(e);if(r)return r;let i;try{i=z.readFileSync(Nt.toNamespacedPath(e),`utf8`)}catch(e){let t=e;if(t.code!==`ENOENT`)throw t}let a={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:`none`,exports:void 0,imports:void 0};if(i!==void 0){let r;try{r=JSON.parse(i)}catch(r){let i=r,a=new qt(e,(t?`"${n}" from `:``)+(0,H.fileURLToPath)(t||n),i.message);throw a.cause=i,a}a.exists=!0,Kt.call(r,`name`)&&typeof r.name==`string`&&(a.name=r.name),Kt.call(r,`main`)&&typeof r.main==`string`&&(a.main=r.main),Kt.call(r,`exports`)&&(a.exports=r.exports),Kt.call(r,`imports`)&&(a.imports=r.imports),!Kt.call(r,`type`)||r.type!==`commonjs`&&r.type!==`module`||(a.type=r.type)}return Jt.set(e,a),a}function Xt(e){let t=new URL(`package.json`,e);for(;!t.pathname.endsWith(`node_modules/package.json`);){let n=Yt((0,H.fileURLToPath)(t),{specifier:e});if(n.exists)return n;let r=t;if(t=new URL(`../package.json`,t),t.pathname===r.pathname)break}return{pjsonPath:(0,H.fileURLToPath)(t),exists:!1,type:`none`}}function Zt(e){return Xt(e).type}let{ERR_UNKNOWN_FILE_EXTENSION:Qt}=G,$t={}.hasOwnProperty,en={__proto__:null,".cjs":`commonjs`,".js":`module`,".json":`json`,".mjs":`module`},tn={__proto__:null,"data:":function(e){let{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return function(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?`module`:e===`application/json`?`json`:null}(t)},"file:":function(e,t,n){let r=function(e){let t=e.pathname,n=t.length;for(;n--;){let e=t.codePointAt(n);if(e===47)return``;if(e===46)return t.codePointAt(n-1)===47?``:t.slice(n)}return``}(e);if(r===`.js`){let t=Zt(e);return t===`none`?`commonjs`:t}if(r===``){let t=Zt(e);return t===`none`||t===`commonjs`?`commonjs`:`module`}let i=en[r];if(i)return i;if(!n)throw new Qt(r,(0,H.fileURLToPath)(e))},"http:":nn,"https:":nn,"node:":()=>`builtin`};function nn(){}let rn=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:an,ERR_INVALID_PACKAGE_CONFIG:on,ERR_INVALID_PACKAGE_TARGET:sn,ERR_MODULE_NOT_FOUND:cn,ERR_PACKAGE_IMPORT_NOT_DEFINED:ln,ERR_PACKAGE_PATH_NOT_EXPORTED:un,ERR_UNSUPPORTED_DIR_IMPORT:dn,ERR_UNSUPPORTED_RESOLVE_REQUEST:fn}=G,pn={}.hasOwnProperty,mn=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,hn=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,gn=/^\.|%|\\/,_n=/\*/g,vn=/%2f|%5c/i,yn=new Set,bn=/[/\\]{2}/;function xn(e,t,n,r,i,a,o){if(W.noDeprecation)return;let s=(0,H.fileURLToPath)(r),c=bn.exec(o?e:t)!==null;W.emitWarning(`Use of deprecated ${c?`double slash`:`leading or trailing slash matching`} resolving "${e}" for module request "${t}" ${t===n?``:`matched to "${n}" `}in the "${i?`imports`:`exports`}" field module resolution of the package at ${s}${a?` imported from ${(0,H.fileURLToPath)(a)}`:``}.`,`DeprecationWarning`,`DEP0166`)}function Sn(e,t,n,r){if(W.noDeprecation||function(e,t){let n=e.protocol;return $t.call(tn,n)&&tn[n](e,t,!0)||null}(e,{parentURL:n.href})!==`module`)return;let i=(0,H.fileURLToPath)(e.href),a=(0,H.fileURLToPath)(new H.URL(`.`,t)),o=(0,H.fileURLToPath)(n);r?Nt.resolve(a,r)!==i&&W.emitWarning(`Package ${a} has a "main" field set to "${r}", excluding the full filename and extension to the resolved file at "${i.slice(a.length)}", imported from ${o}.\n Automatic extension resolution of the "main" field is deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`):W.emitWarning(`No "main" or "exports" field defined in the package.json for ${a} resolving the main entry point "${i.slice(a.length)}", imported from ${o}.\nDefault "index" lookups for the main are deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`)}function Cn(e){try{return(0,z.statSync)(e)}catch{}}function wn(e){let t=(0,z.statSync)(e,{throwIfNoEntry:!1}),n=t?t.isFile():void 0;return n!=null&&n}function Tn(e,t,n){let r;if(t.main!==void 0){if(r=new H.URL(t.main,e),wn(r))return r;let i=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],a=-1;for(;++a<i.length&&(r=new H.URL(i[a],e),!wn(r));)r=void 0;if(r)return Sn(r,e,n,t.main),r}let i=[`./index.js`,`./index.json`,`./index.node`],a=-1;for(;++a<i.length&&(r=new H.URL(i[a],e),!wn(r));)r=void 0;if(r)return Sn(r,e,n,t.main),r;throw new cn((0,H.fileURLToPath)(new H.URL(`.`,e)),(0,H.fileURLToPath)(n))}function En(e,t,n){return new un((0,H.fileURLToPath)(new H.URL(`.`,t)),e,n&&(0,H.fileURLToPath)(n))}function Dn(e,t,n,r,i){return t=typeof t==`object`&&t?JSON.stringify(t,null,``):`${t}`,new sn((0,H.fileURLToPath)(new H.URL(`.`,n)),e,t,r,i&&(0,H.fileURLToPath)(i))}function On(e,t,n,r,i,a,o,s,c){if(t!==``&&!a&&e[e.length-1]!==`/`)throw Dn(n,e,r,o,i);if(!e.startsWith(`./`)){if(o&&!e.startsWith(`../`)&&!e.startsWith(`/`)){let n=!1;try{new H.URL(e),n=!0}catch{}if(!n)return Fn(a?rn.call(_n,e,()=>t):e+t,r,c)}throw Dn(n,e,r,o,i)}if(mn.exec(e.slice(2))!==null){if(hn.exec(e.slice(2))!==null)throw Dn(n,e,r,o,i);if(!s){let s=a?n.replace(`*`,()=>t):n+t;xn(a?rn.call(_n,e,()=>t):e,s,n,r,o,i,!0)}}let l=new H.URL(e,r),u=l.pathname,d=new H.URL(`.`,r).pathname;if(!u.startsWith(d))throw Dn(n,e,r,o,i);if(t===``)return l;if(mn.exec(t)!==null){let c=a?n.replace(`*`,()=>t):n+t;hn.exec(t)===null?s||xn(a?rn.call(_n,e,()=>t):e,c,n,r,o,i,!1):(function(e,t,n,r,i){throw new an(e,`request is not a valid match in pattern "${t}" for the "${r?`imports`:`exports`}" resolution of ${(0,H.fileURLToPath)(n)}`,i&&(0,H.fileURLToPath)(i))})(c,n,r,o,i)}return a?new H.URL(rn.call(_n,l.href,()=>t)):new H.URL(t,l)}function kn(e){let t=Number(e);return`${t}`===e&&t>=0&&t<4294967295}function An(e,t,n,r,i,a,o,s,c){if(typeof t==`string`)return On(t,n,r,e,i,a,o,s,c);if(Array.isArray(t)){let l=t;if(l.length===0)return null;let u,d=-1;for(;++d<l.length;){let t=l[d],f;try{f=An(e,t,n,r,i,a,o,s,c)}catch(e){if(u=e,e.code===`ERR_INVALID_PACKAGE_TARGET`)continue;throw e}if(f!==void 0){if(f!==null)return f;u=null}}if(u==null)return null;throw u}if(typeof t==`object`&&t){let l=Object.getOwnPropertyNames(t),u=-1;for(;++u<l.length;)if(kn(l[u]))throw new on((0,H.fileURLToPath)(e),i,`"exports" cannot contain numeric property keys.`);for(u=-1;++u<l.length;){let d=l[u];if(d===`default`||c&&c.has(d)){let l=An(e,t[d],n,r,i,a,o,s,c);if(l===void 0)continue;return l}}return null}if(t===null)return null;throw Dn(r,t,e,o,i)}function jn(e,t,n){if(W.noDeprecation)return;let r=(0,H.fileURLToPath)(t);yn.has(r+`|`+e)||(yn.add(r+`|`+e),W.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${r}${n?` imported from ${(0,H.fileURLToPath)(n)}`:``}. Mapping specifiers ending in "/" is no longer supported.`,`DeprecationWarning`,`DEP0155`))}function Mn(e,t,n,r,i){let a=n.exports;if(function(e,t,n){if(typeof e==`string`||Array.isArray(e))return!0;if(typeof e!=`object`||!e)return!1;let r=Object.getOwnPropertyNames(e),i=!1,a=0,o=-1;for(;++o<r.length;){let e=r[o],s=e===``||e[0]!==`.`;if(a++===0)i=s;else if(i!==s)throw new on((0,H.fileURLToPath)(t),n,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return i}(a,e,r)&&(a={".":a}),pn.call(a,t)&&!t.includes(`*`)&&!t.endsWith(`/`)){let n=An(e,a[t],``,t,r,!1,!1,!1,i);if(n==null)throw En(t,e,r);return n}let o=``,s=``,c=Object.getOwnPropertyNames(a),l=-1;for(;++l<c.length;){let n=c[l],i=n.indexOf(`*`);if(i!==-1&&t.startsWith(n.slice(0,i))){t.endsWith(`/`)&&jn(t,e,r);let a=n.slice(i+1);t.length>=n.length&&t.endsWith(a)&&Nn(o,n)===1&&n.lastIndexOf(`*`)===i&&(o=n,s=t.slice(i,t.length-a.length))}}if(o){let n=An(e,a[o],s,o,r,!0,!1,t.endsWith(`/`),i);if(n==null)throw En(t,e,r);return n}throw En(t,e,r)}function Nn(e,t){let n=e.indexOf(`*`),r=t.indexOf(`*`),i=n===-1?e.length:n+1,a=r===-1?t.length:r+1;return i>a?-1:a>i||n===-1?1:r===-1||e.length>t.length?-1:t.length>e.length?1:0}function Pn(e,t,n){if(e===`#`||e.startsWith(`#/`)||e.endsWith(`/`))throw new an(e,`is not a valid internal imports specifier name`,(0,H.fileURLToPath)(t));let r,i=Xt(t);if(i.exists){r=(0,H.pathToFileURL)(i.pjsonPath);let a=i.imports;if(a)if(pn.call(a,e)&&!e.includes(`*`)){let i=An(r,a[e],``,e,t,!1,!0,!1,n);if(i!=null)return i}else{let i=``,o=``,s=Object.getOwnPropertyNames(a),c=-1;for(;++c<s.length;){let t=s[c],n=t.indexOf(`*`);if(n!==-1&&e.startsWith(t.slice(0,-1))){let r=t.slice(n+1);e.length>=t.length&&e.endsWith(r)&&Nn(i,t)===1&&t.lastIndexOf(`*`)===n&&(i=t,o=e.slice(n,e.length-r.length))}}if(i){let e=An(r,a[i],o,i,t,!0,!0,!1,n);if(e!=null)return e}}}throw function(e,t,n){return new ln(e,t&&(0,H.fileURLToPath)(new H.URL(`.`,t)),(0,H.fileURLToPath)(n))}(e,r,t)}function Fn(e,t,n){if(pt.builtinModules.includes(e))return new H.URL(`node:`+e);let{packageName:r,packageSubpath:i,isScoped:a}=function(e,t){let n=e.indexOf(`/`),r=!0,i=!1;e[0]===`@`&&(i=!0,n===-1||e.length===0?r=!1:n=e.indexOf(`/`,n+1));let a=n===-1?e:e.slice(0,n);if(gn.exec(a)!==null&&(r=!1),!r)throw new an(e,`is not a valid package name`,(0,H.fileURLToPath)(t));return{packageName:a,packageSubpath:`.`+(n===-1?``:e.slice(n)),isScoped:i}}(e,t),o=Xt(t);if(o.exists){let e=(0,H.pathToFileURL)(o.pjsonPath);if(o.name===r&&o.exports!==void 0&&o.exports!==null)return Mn(e,i,o,t,n)}let s,c=new H.URL(`./node_modules/`+r+`/package.json`,t),l=(0,H.fileURLToPath)(c);do{let o=Cn(l.slice(0,-13));if(!o||!o.isDirectory()){s=l,c=new H.URL((a?`../../../../node_modules/`:`../../../node_modules/`)+r+`/package.json`,c),l=(0,H.fileURLToPath)(c);continue}let u=Yt(l,{base:t,specifier:e});return u.exports!==void 0&&u.exports!==null?Mn(c,i,u,t,n):i===`.`?Tn(c,u,t):new H.URL(i,c)}while(l.length!==s.length);throw new cn(r,(0,H.fileURLToPath)(t),!1)}function In(e,t,n,r){let i=t.protocol,a=i===`data:`||i===`http:`||i===`https:`,o;if(function(e){return e!==``&&(e[0]===`/`||function(e){return e[0]===`.`&&(e.length===1||e[1]===`/`||e[1]===`.`&&(e.length===2||e[2]===`/`))}(e))}(e))try{o=new H.URL(e,t)}catch(n){let r=new fn(e,t);throw r.cause=n,r}else if(i===`file:`&&e[0]===`#`)o=Pn(e,t,n);else try{o=new H.URL(e)}catch(r){if(a&&!pt.builtinModules.includes(e)){let n=new fn(e,t);throw n.cause=r,n}o=Fn(e,t,n)}return U(o!==void 0,`expected to be defined`),o.protocol===`file:`?function(e,t){if(vn.exec(e.pathname)!==null)throw new an(e.pathname,`must not include encoded "/" or "\\" characters`,(0,H.fileURLToPath)(t));let n;try{n=(0,H.fileURLToPath)(e)}catch(n){let r=n;throw Object.defineProperty(r,`input`,{value:String(e)}),Object.defineProperty(r,`module`,{value:String(t)}),r}let r=Cn(n.endsWith(`/`)?n.slice(-1):n);if(r&&r.isDirectory()){let r=new dn(n,(0,H.fileURLToPath)(t));throw r.url=String(e),r}if(!r||!r.isFile()){let r=new cn(n||e.pathname,t&&(0,H.fileURLToPath)(t),!0);throw r.url=String(e),r}{let t=(0,z.realpathSync)(n),{search:r,hash:i}=e;(e=(0,H.pathToFileURL)(t+(n.endsWith(Nt.sep)?`/`:``))).search=r,e.hash=i}return e}(o,t):o}function Ln(e){return typeof e!=`string`||e.startsWith(`file://`)?Lt((0,H.fileURLToPath)(e)):Lt(e)}function Rn(e){return(0,H.pathToFileURL)(Ln(e)).toString()}let zn=new Set([`node`,`import`]),Bn=[`.mjs`,`.cjs`,`.js`,`.json`],Vn=new Set([`ERR_MODULE_NOT_FOUND`,`ERR_UNSUPPORTED_DIR_IMPORT`,`MODULE_NOT_FOUND`,`ERR_PACKAGE_PATH_NOT_EXPORTED`]);function Hn(e,t,n){try{return In(e,t,n)}catch(e){if(!Vn.has(e?.code))throw e}}function Un(e,t={}){if(typeof e!=`string`){if(!(e instanceof URL))throw TypeError("input must be a `string` or `URL`");e=Ln(e)}if(/(?:node|data|http|https):/.test(e))return e;if(It.has(e))return`node:`+e;if(e.startsWith(`file://`)&&(e=Ln(e)),V(e))try{if((0,z.statSync)(e).isFile())return Rn(e)}catch(e){if(e?.code!==`ENOENT`)throw e}let n=t.conditions?new Set(t.conditions):zn,r=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(e=>new URL(function(e){return typeof e!=`string`&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:It.has(e)?`node:`+e:`file://`+encodeURI(Lt(e))}(e.toString())));r.length===0&&r.push(new URL(Rn(process.cwd())));let i=[...r];for(let e of r)e.protocol===`file:`&&i.push(new URL(`./`,e),new URL(yt(e.pathname,`_index.js`),e),new URL(`node_modules`,e));let a;for(let r of i){if(a=Hn(e,r,n),a)break;for(let i of[``,`/index`]){for(let o of t.extensions||Bn)if(a=Hn(yt(e,i)+o,r,n),a)break;if(a)break}if(a)break}if(!a){let t=Error(`Cannot find module ${e} imported from ${i.join(`, `)}`);throw t.code=`ERR_MODULE_NOT_FOUND`,t}return Rn(a)}function Wn(e,t){return Un(e,t)}function Gn(e,t){return Ln(Wn(e,t))}let Kn=/(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m,qn=/\/\*.+?\*\/|\/\/.*(?=[nr])/g;function Jn(e,t={}){return t.stripComments&&(e=e.replace(qn,``)),Kn.test(e)}function Yn(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}let Xn=new Set([`/`,`\\`,void 0]),Zn=Symbol.for(`pathe:normalizedAlias`),Qn=/[/\\]/;function $n(e){if(e[Zn])return e;let t=Object.fromEntries(Object.entries(e).sort(([e],[t])=>function(e,t){return t.split(`/`).length-e.split(`/`).length}(e,t)));for(let e in t)for(let n in t)n===e||e.startsWith(n)||t[e]?.startsWith(n)&&Xn.has(t[e][n.length])&&(t[e]=t[n]+t[e].slice(n.length));return Object.defineProperty(t,Zn,{value:!0,enumerable:!1}),t}function er(e=`/`){let t=e[e.length-1];return t===`/`||t===`\\`}var tr={rE:`2.6.1`};let nr=n(`node:crypto`);var rr=i.n(nr);let ir=Object.create(null),ar=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?ir:globalThis),q=new Proxy(ir,{get:(e,t)=>ar()[t]??ir[t],has:(e,t)=>t in ar()||t in ir,set:(e,t,n)=>(ar(!0)[t]=n,!0),deleteProperty(e,t){return t?(delete ar(!0)[t],!0):!1},ownKeys(){let e=ar(!0);return Object.keys(e)}}),or=typeof process<`u`&&process.env&&process.env.NODE_ENV||``,sr=[[`APPVEYOR`],[`AWS_AMPLIFY`,`AWS_APP_ID`,{ci:!0}],[`AZURE_PIPELINES`,`SYSTEM_TEAMFOUNDATIONCOLLECTIONURI`],[`AZURE_STATIC`,`INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN`],[`APPCIRCLE`,`AC_APPCIRCLE`],[`BAMBOO`,`bamboo_planKey`],[`BITBUCKET`,`BITBUCKET_COMMIT`],[`BITRISE`,`BITRISE_IO`],[`BUDDY`,`BUDDY_WORKSPACE_ID`],[`BUILDKITE`],[`CIRCLE`,`CIRCLECI`],[`CIRRUS`,`CIRRUS_CI`],[`CLOUDFLARE_PAGES`,`CF_PAGES`,{ci:!0}],[`CLOUDFLARE_WORKERS`,`WORKERS_CI`,{ci:!0}],[`CODEBUILD`,`CODEBUILD_BUILD_ARN`],[`CODEFRESH`,`CF_BUILD_ID`],[`DRONE`],[`DRONE`,`DRONE_BUILD_EVENT`],[`DSARI`],[`GITHUB_ACTIONS`],[`GITLAB`,`GITLAB_CI`],[`GITLAB`,`CI_MERGE_REQUEST_ID`],[`GOCD`,`GO_PIPELINE_LABEL`],[`LAYERCI`],[`HUDSON`,`HUDSON_URL`],[`JENKINS`,`JENKINS_URL`],[`MAGNUM`],[`NETLIFY`],[`NETLIFY`,`NETLIFY_LOCAL`,{ci:!1}],[`NEVERCODE`],[`RENDER`],[`SAIL`,`SAILCI`],[`SEMAPHORE`],[`SCREWDRIVER`],[`SHIPPABLE`],[`SOLANO`,`TDDIUM`],[`STRIDER`],[`TEAMCITY`,`TEAMCITY_VERSION`],[`TRAVIS`],[`VERCEL`,`NOW_BUILDER`],[`VERCEL`,`VERCEL`,{ci:!1}],[`VERCEL`,`VERCEL_ENV`,{ci:!1}],[`APPCENTER`,`APPCENTER_BUILD_ID`],[`CODESANDBOX`,`CODESANDBOX_SSE`,{ci:!1}],[`CODESANDBOX`,`CODESANDBOX_HOST`,{ci:!1}],[`STACKBLITZ`],[`STORMKIT`],[`CLEAVR`],[`ZEABUR`],[`CODESPHERE`,`CODESPHERE_APP_ID`,{ci:!0}],[`RAILWAY`,`RAILWAY_PROJECT_ID`],[`RAILWAY`,`RAILWAY_SERVICE_ID`],[`DENO-DEPLOY`,`DENO_DEPLOYMENT_ID`],[`FIREBASE_APP_HOSTING`,`FIREBASE_APP_HOSTING`,{ci:!0}]],cr=function(){if(globalThis.process?.env)for(let e of sr){let t=e[1]||e[0];if(globalThis.process?.env[t])return{name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL===`/bin/jsh`&&globalThis.process?.versions?.webcontainer?{name:`stackblitz`,ci:!1}:{name:``,ci:!1}}();cr.name;function lr(e){return!!e&&e!==`false`}let ur=globalThis.process?.platform||``;lr(q.CI)||cr.ci;let dr=lr(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);q.DEBUG,or===`test`||q.TEST;let fr=(q.MINIMAL,/^win/i.test(ur)),pr=(/^linux/i.test(ur),/^darwin/i.test(ur),!lr(q.NO_COLOR)&&(lr(q.FORCE_COLOR)||(dr||fr)&&q.TERM),(globalThis.process?.versions?.node||``).replace(/^v/,``)||null),mr=(Number(pr?.split(`.`)[0]),globalThis.process||Object.create(null)),hr={versions:{}},gr=(new Proxy(mr,{get:(e,t)=>t===`env`?q:t in e?e[t]:t in hr?hr[t]:void 0}),globalThis.process?.release?.name===`node`),_r=!!globalThis.Bun||!!globalThis.process?.versions?.bun,vr=!!globalThis.Deno,yr=!!globalThis.fastly,br=[[!!globalThis.Netlify,`netlify`],[!!globalThis.EdgeRuntime,`edge-light`],[globalThis.navigator?.userAgent===`Cloudflare-Workers`,`workerd`],[yr,`fastly`],[vr,`deno`],[_r,`bun`],[gr,`node`]];(function(){let e=br.find(e=>e[0]);e&&e[1]})();let xr=n(`node:tty`)?.WriteStream?.prototype?.hasColors?.()??!1,J=(e,t)=>{if(!xr)return e=>e;let n=`[${e}m`,r=`[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}},Sr=(J(0,0),J(1,22),J(2,22),J(3,23),J(4,24),J(53,55),J(7,27),J(8,28),J(9,29),J(30,39),J(31,39)),Cr=J(32,39),wr=J(33,39),Tr=J(34,39),Er=(J(35,39),J(36,39)),Dr=(J(37,39),J(90,39));J(40,49),J(41,49),J(42,49),J(43,49),J(44,49),J(45,49),J(46,49),J(47,49),J(100,49),J(91,39),J(92,39),J(93,39),J(94,39),J(95,39),J(96,39),J(97,39),J(101,49),J(102,49),J(103,49),J(104,49),J(105,49),J(106,49),J(107,49);function Or(e){if(typeof e!=`string`||e.startsWith(`file://`))return!1;try{return(0,z.lstatSync)(e).isDirectory()}catch{return!1}}function kr(e,t=8){return(function(){if(jr!==void 0)return jr;try{return jr=!!rr().getFips?.(),jr}catch{return jr=!1,jr}}()?rr().createHash(`sha256`):rr().createHash(`md5`)).update(e).digest(`hex`).slice(0,t)}let Ar={true:Cr(`true`),false:wr(`false`),"[rebuild]":wr(`[rebuild]`),"[esm]":Tr(`[esm]`),"[cjs]":Cr(`[cjs]`),"[import]":Tr(`[import]`),"[require]":Cr(`[require]`),"[native]":Er(`[native]`),"[transpile]":wr(`[transpile]`),"[fallback]":Sr(`[fallback]`),"[unknown]":Sr(`[unknown]`),"[hit]":Cr(`[hit]`),"[miss]":wr(`[miss]`),"[json]":Cr(`[json]`),"[data]":Cr(`[data]`)};function Y(e,...t){if(!e.opts.debug)return;let n=process.cwd();console.log(Dr([`[jiti]`,...t.map(e=>e in Ar?Ar[e]:typeof e==`string`?e.replace(n,`.`):JSON.stringify(e))].join(` `)))}function X(e,t){return e.opts.interopDefault?function(e){let t=typeof e;if(e===null||t!==`object`&&t!==`function`)return e;let n=e.default,r=typeof n,i=n==null,a=r===`object`||r===`function`;return i&&e instanceof Promise?e:new Proxy(e,{get(t,r,o){if(r===`__esModule`)return!0;if(r===`default`)return i?e:typeof n?.default==`function`&&e.__esModule?n.default:n;if(Reflect.has(t,r))return Reflect.get(t,r,o);if(a&&!(n instanceof Promise)){let e=Reflect.get(n,r,o);return typeof e==`function`&&(e=e.bind(n)),e}},apply:(e,t,i)=>typeof e==`function`?Reflect.apply(e,t,i):r===`function`?Reflect.apply(n,t,i):void 0})}(t):t}let jr;function Z(e,t){return!!Q(e,t)}function Q(e,t){let n=process.env[e];if(!(e in process.env))return t;try{return JSON.parse(n)}catch{return t}}let Mr=/\.(c|m)?j(sx?)$/,Nr=/\.(c|m)?t(sx?)$/;function Pr(e,t,n){let r,i;if(e.isNativeRe.test(t))return t;e.alias&&(t=function(e,t){let n=xt(e);t=$n(t);for(let[e,r]of Object.entries(t))if(n.startsWith(e)&&er(n[(er(e)?e.slice(0,-1):e).length]))return B(r,n.slice(e.length));return n}(t,e.alias));let a=n?.parentURL||e.url;Or(a)&&(a=B(a,`_index.js`));let o=(n?.async?[n?.conditions,[`node`,`import`],[`node`,`require`]]:[n?.conditions,[`node`,`require`],[`node`,`import`]]).filter(Boolean);for(let n of o){try{r=Gn(t,{url:a,conditions:n,extensions:e.opts.extensions})}catch(e){i=e}if(r)return r}try{return e.nativeRequire.resolve(t,{paths:n.paths})}catch(e){i=e}for(let i of e.additionalExts)if(r=Fr(e,t+i,a,n)||Fr(e,t+`/index`+i,a,n),r||(Nr.test(e.filename)||Nr.test(e.parentModule?.filename||``)||Mr.test(t))&&(r=Fr(e,t.replace(Mr,`.$1t$2`),a,n),r))return r;if(!n?.try)throw i}function Fr(e,t,n,r){try{return e.nativeRequire.resolve(t,{...r,paths:[jt(Ln(n)),...r?.paths||[]]})}catch{}}let Ir=n(`node:perf_hooks`),Lr=n(`node:vm`);var Rr=i.n(Lr);function zr(e,t,n){let r=e.parentCache||{};if(t.startsWith(`node:`))return $(e,t,n.async);if(t.startsWith(`file:`))t=(0,H.fileURLToPath)(t);else if(t.startsWith(`data:`)){if(!n.async)throw Error("`data:` URLs are only supported in ESM context. Use `import` or `jiti.import` instead.");return Y(e,`[native]`,`[data]`,`[import]`,t),$(e,t,!0)}if(pt.builtinModules.includes(t)||t===`.pnp.js`)return $(e,t,n.async);if(e.opts.tryNative&&!e.opts.transformOptions)try{if(!(t=Pr(e,t,n))&&n.try)return;if(Y(e,`[try-native]`,n.async&&e.nativeImport?`[import]`:`[require]`,t),n.async&&e.nativeImport)return e.nativeImport(t).then(n=>(!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],X(e,n)));{let n=e.nativeRequire(t);return!1===e.opts.moduleCache&&delete e.nativeRequire.cache[t],X(e,n)}}catch(n){Y(e,`[try-native] Using fallback for ${t} because of an error:`,n)}let i=Pr(e,t,n);if(!i&&n.try)return;let a=At(i);if(a===`.json`){Y(e,`[json]`,i);let t=e.nativeRequire(i);return t&&!(`default`in t)&&Object.defineProperty(t,`default`,{value:t,enumerable:!1}),t}if(a&&!e.opts.extensions.includes(a))return Y(e,`[native]`,`[unknown]`,n.async?`[import]`:`[require]`,i),$(e,i,n.async);if(e.isNativeRe.test(i))return Y(e,`[native]`,n.async?`[import]`:`[require]`,i),$(e,i,n.async);if(r[i])return X(e,r[i]?.exports);if(e.opts.moduleCache){let t=e.nativeRequire.cache[i];if(t?.loaded)return X(e,t.exports)}return Ur(e,(0,z.readFileSync)(i,`utf8`),{id:t,filename:i,ext:a,cache:r,async:n.async})}function $(e,t,n){return n&&e.nativeImport?e.nativeImport(function(e){return fr&&V(e)?Rn(e):e}(t)).then(t=>X(e,t)):X(e,e.nativeRequire(t))}function Br(e,t,n){if(!e.opts.fsCache||!t.filename)return n();let r=` /* v9-${kr(t.source,16)} */\n`,i=`${Mt(jt(t.filename))}-${function(e){let t=e.split(Qn).pop();if(!t)return;let n=t.lastIndexOf(`.`);return n<=0?t:t.slice(0,n)}(t.filename)}`+(e.opts.sourceMaps?`+map`:``)+(t.interopDefault?`.i`:``)+`.${kr(t.filename)}`+(t.async?`.mjs`:`.cjs`);t.jsx&&t.filename.endsWith(`x`)&&(i+=`x`);let a=e.opts.fsCache,o=B(a,i);if(!e.opts.rebuildFsCache&&(0,z.existsSync)(o)){let n=(0,z.readFileSync)(o,`utf8`);if(n.endsWith(r))return Y(e,`[cache]`,`[hit]`,t.filename,`~>`,o),n}Y(e,`[cache]`,`[miss]`,t.filename);let s=n();return s.includes(`__JITI_ERROR__`)||((0,z.writeFileSync)(o,s+r,`utf8`),Y(e,`[cache]`,`[store]`,t.filename,`~>`,o)),s}function Vr(t){if(!0===t.opts.fsCache&&(t.opts.fsCache=function(t){let n=t.filename&&Ot(t.filename,`../node_modules`);if(n&&(0,z.existsSync)(n))return B(n,`.cache/jiti`);let r=(0,e.tmpdir)();if(process.env.TMPDIR&&r===process.cwd()&&!process.env.JITI_RESPECT_TMPDIR_ENV){let t=process.env.TMPDIR;delete process.env.TMPDIR,r=(0,e.tmpdir)(),process.env.TMPDIR=t}return B(r,`jiti`)}(t)),t.opts.fsCache)try{if((0,z.mkdirSync)(t.opts.fsCache,{recursive:!0}),!function(e){try{return(0,z.accessSync)(e,z.constants.W_OK),!0}catch{return!1}}(t.opts.fsCache))throw Error(`directory is not writable!`)}catch(e){Y(t,`Error creating cache directory at `,t.opts.fsCache,e),t.opts.fsCache=!1}}function Hr(e,t){let n=Br(e,t,()=>{let n=e.opts.transform({...e.opts.transformOptions,babel:{...e.opts.sourceMaps?{sourceFileName:t.filename,sourceMaps:`inline`}:{},...e.opts.transformOptions?.babel},interopDefault:e.opts.interopDefault,...t});return n.error&&e.opts.debug&&Y(e,n.error),n.code});return n.startsWith(`#!`)&&(n=`// `+n),n}function Ur(e,t,n={}){let r=n.id||(n.filename?Mt(n.filename):`_jitiEval.${n.ext||(n.async?`mjs`:`js`)}`),i=n.filename||Pr(e,r,{async:n.async}),a=n.ext||At(i),o=n.cache||e.parentCache||{},s=/\.[cm]?tsx?$/.test(a),c=a===`.mjs`||a===`.js`&&function(e){for(;e&&e!==`.`&&e!==`/`;){e=B(e,`..`);try{let t=(0,z.readFileSync)(B(e,`package.json`),`utf8`);try{return JSON.parse(t)}catch{}break}catch{}}}(i)?.type===`module`,l=a===`.cjs`,u=n.forceTranspile??(!l&&!(c&&n.async)&&(s||c||e.isTransformRe.test(i)||Jn(t))),d=Ir.performance.now();if(u){t=Hr(e,{filename:i,source:t,ts:s,async:n.async??!1,jsx:e.opts.jsx});let r=Math.round(1e3*(Ir.performance.now()-d))/1e3;Y(e,`[transpile]`,n.async?`[esm]`:`[cjs]`,i,`(${r}ms)`)}else{if(Y(e,`[native]`,n.async?`[import]`:`[require]`,i),n.async)return Promise.resolve($(e,i,n.async)).catch(r=>(Y(e,`Native import error:`,r),Y(e,`[fallback]`,i),Ur(e,t,{...n,forceTranspile:!0})));try{return $(e,i,n.async)}catch(r){Y(e,`Native require error:`,r),Y(e,`[fallback]`,i),t=Hr(e,{filename:i,source:t,ts:s,async:n.async??!1,jsx:e.opts.jsx})}}let f=new pt.Module(i);f.filename=i,e.parentModule&&(f.parent=e.parentModule,Array.isArray(e.parentModule.children)&&!e.parentModule.children.includes(f)&&e.parentModule.children.push(f));let p=Gr(i,e.opts,{parentModule:f,parentCache:o,nativeImport:e.nativeImport,onError:e.onError,createRequire:e.createRequire},!0),m;f.require=p,f.path=jt(i),f.paths=pt.Module._nodeModulePaths(f.path),o[i]=f,e.opts.moduleCache&&(e.nativeRequire.cache[i]=f);let h=function(e,t){return`(${t?.async?`async `:``}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e}\n});`}(t,{async:n.async});try{m=Rr().runInThisContext(h,{filename:i,lineOffset:0,displayErrors:!1})}catch(t){t.name===`SyntaxError`&&n.async&&e.nativeImport?(Y(e,`[esm]`,`[import]`,`[fallback]`,i),m=function(e,t){let n=`data:text/javascript;base64,${Buffer.from(`export default ${e}`).toString(`base64`)}`;return(...e)=>t(n).then(t=>t.default(...e))}(h,e.nativeImport)):(e.opts.moduleCache&&delete e.nativeRequire.cache[i],e.onError(t))}let g;try{g=m(f.exports,f.require,f,f.filename,jt(f.filename),p.import,p.esmResolve)}catch(t){e.opts.moduleCache&&delete e.nativeRequire.cache[i],e.onError(t)}function _(){if(f.exports&&f.exports.__JITI_ERROR__){let{filename:t,line:n,column:r,code:i,message:a}=f.exports.__JITI_ERROR__,o=Error(`${i}: ${a} \n ${`${t}:${n}:${r}`}`);Error.captureStackTrace(o,zr),e.onError(o)}return f.loaded=!0,X(e,f.exports)}return n.async?Promise.resolve(g).then(_):_()}let Wr=(0,e.platform)()===`win32`;function Gr(e,t={},n,r=!1){let i=r?t:function(e){let t={fsCache:Z(`JITI_FS_CACHE`,Z(`JITI_CACHE`,!0)),rebuildFsCache:Z(`JITI_REBUILD_FS_CACHE`,!1),moduleCache:Z(`JITI_MODULE_CACHE`,Z(`JITI_REQUIRE_CACHE`,!0)),debug:Z(`JITI_DEBUG`,!1),sourceMaps:Z(`JITI_SOURCE_MAPS`,!1),interopDefault:Z(`JITI_INTEROP_DEFAULT`,!0),extensions:Q(`JITI_EXTENSIONS`,[`.js`,`.mjs`,`.cjs`,`.ts`,`.tsx`,`.mts`,`.cts`,`.mtsx`,`.ctsx`]),alias:Q(`JITI_ALIAS`,{}),nativeModules:Q(`JITI_NATIVE_MODULES`,[]),transformModules:Q(`JITI_TRANSFORM_MODULES`,[]),tryNative:Q(`JITI_TRY_NATIVE`,`Bun`in globalThis),jsx:Z(`JITI_JSX`,!1)};t.jsx&&t.extensions.push(`.jsx`,`.tsx`);let n={};return e.cache!==void 0&&(n.fsCache=e.cache),e.requireCache!==void 0&&(n.moduleCache=e.requireCache),{...t,...n,...e}}(t),a=i.alias&&Object.keys(i.alias).length>0?$n(i.alias||{}):void 0,o=[`typescript`,`jiti`,...i.nativeModules||[]],s=RegExp(`node_modules/(${o.map(e=>Yn(e)).join(`|`)})/`),c=[...i.transformModules||[]],l=RegExp(`node_modules/(${c.map(e=>Yn(e)).join(`|`)})/`);e||=process.cwd(),!r&&Or(e)&&(e=B(e,`_index.js`));let u=Rn(e),d=[...i.extensions].filter(e=>e!==`.js`),f=n.createRequire(Wr?e.replace(/\//g,`\\`):e),p={filename:e,url:u,opts:i,alias:a,nativeModules:o,transformModules:c,isNativeRe:s,isTransformRe:l,additionalExts:d,nativeRequire:f,onError:n.onError,parentModule:n.parentModule,parentCache:n.parentCache,nativeImport:n.nativeImport,createRequire:n.createRequire};return r||Y(p,`[init]`,...[[`version:`,tr.rE],[`module-cache:`,i.moduleCache],[`fs-cache:`,i.fsCache],[`rebuild-fs-cache:`,i.rebuildFsCache],[`interop-defaults:`,i.interopDefault]].flat()),r||Vr(p),Object.assign(function(e){return zr(p,e,{async:!1})},{cache:i.moduleCache?f.cache:Object.create(null),extensions:f.extensions,main:f.main,options:i,resolve:Object.assign(function(e){return Pr(p,e,{async:!1})},{paths:f.resolve.paths}),transform:e=>Hr(p,e),evalModule:(e,t)=>Ur(p,e,t),async import(e,t){let n=await zr(p,e,{...t,async:!0});return t?.default?n?.default??n:n},esmResolve(e,t){typeof t==`string`&&(t={parentURL:t});let n=Pr(p,e,{parentURL:u,...t,async:!0});return!n||typeof n!=`string`||n.startsWith(`file://`)?n:Rn(n)}})}})(),t.exports=a.default})()}));function o(e){throw e}function s(...e){return d||=i(import.meta.url)(`../dist/babel.cjs`),d(...e)}function c(e,t={}){return t.transform||(t={...t,transform:s}),(0,l.default)(e,t,{onError:o,nativeImport:u,createRequire:i})}var l,u,d;t((()=>{l=e(a(),1),u=e=>import(e)}))();export{c as createJiti,c as default};
|