@drincs/nqtr 0.8.2 → 1.0.1
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/README.md +8 -21
- package/dist/StageInterface-BN_O8nDA.d.mts +363 -0
- package/dist/StageInterface-BN_O8nDA.d.ts +363 -0
- package/dist/handlers.cjs +1 -1
- package/dist/handlers.d.mts +6 -617
- package/dist/handlers.d.ts +6 -617
- package/dist/handlers.mjs +1 -1
- package/dist/index-CtxMgD9N.d.ts +270 -0
- package/dist/index-D0T0L2IE.d.mts +270 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +62 -660
- package/dist/index.d.ts +62 -660
- package/dist/index.mjs +1 -1
- package/dist/ink.cjs +1 -1
- package/dist/ink.d.mts +58 -10
- package/dist/ink.d.ts +58 -10
- package/dist/ink.mjs +1 -1
- package/dist/registries.cjs +1 -1
- package/dist/registries.d.mts +143 -366
- package/dist/registries.d.ts +143 -366
- package/dist/registries.mjs +1 -1
- package/dist/vite.cjs +2 -0
- package/dist/vite.d.mts +160 -0
- package/dist/vite.d.ts +160 -0
- package/dist/vite.mjs +2 -0
- package/package.json +37 -12
package/dist/vite.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var Fe=require('fs'),path=require('path'),url=require('url'),module$1=require('module');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Fe__namespace=/*#__PURE__*/_interopNamespace(Fe);var $e=Object.create;var wt=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var J=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Te=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ie(e))!Oe.call(t,n)&&n!==s&&wt(t,n,{get:()=>e[n],enumerable:!(r=Le(e,n))||r.enumerable});return t};var Ot=(t,e,s)=>(s=t!=null?$e(we(t)):{},Te(e||!t||!t.__esModule?wt(s,"default",{value:t,enumerable:true}):s,t));var Ht=J((Jr,gt)=>{var pt=process||{},Tt=pt.argv||[],lt=pt.env||{},Pe=!(lt.NO_COLOR||Tt.includes("--no-color"))&&(!!lt.FORCE_COLOR||Tt.includes("--color")||pt.platform==="win32"||(pt.stdout||{}).isTTY&<.TERM!=="dumb"||!!lt.CI),He=(t,e,s=t)=>r=>{let n=""+r,i=n.indexOf(e,t.length);return ~i?t+ke(n,e,s,i)+e:t+n+e},ke=(t,e,s,r)=>{let n="",i=0;do n+=t.substring(i,r)+s,i=r+e.length,r=t.indexOf(e,i);while(~r);return n+t.substring(i)},Pt=(t=Pe)=>{let e=t?He:()=>String;return {isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};gt.exports=Pt();gt.exports.createColors=Pt;});var rt=J((cn,Yt)=>{var Xt="[^\\\\/]",ks="(?=.)",Qt="[^/]",yt="(?:\\/|$)",jt="(?:^|\\/)",Rt=`\\.{1,2}${yt}`,Ns="(?!\\.)",Ds=`(?!${jt}${Rt})`,Bs=`(?!\\.{0,1}${yt})`,Ms=`(?!${Rt})`,qs="[^.\\/]",Fs=`${Qt}*?`,Gs="/",zt={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:ks,QMARK:Qt,END_ANCHOR:yt,DOTS_SLASH:Rt,NO_DOT:Ns,NO_DOTS:Ds,NO_DOT_SLASH:Bs,NO_DOTS_SLASH:Ms,QMARK_NO_DOT:qs,STAR:Fs,START_ANCHOR:jt,SEP:Gs},Ws={...zt,SLASH_LITERAL:"[\\\\/]",QMARK:Xt,STAR:`${Xt}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Us={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Yt.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Us,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?Ws:zt}};});var nt=J(W=>{var{REGEX_BACKSLASH:Ks,REGEX_REMOVE_BACKSLASH:Xs,REGEX_SPECIAL_CHARS:Qs,REGEX_SPECIAL_CHARS_GLOBAL:js}=rt();W.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);W.hasRegexChars=t=>Qs.test(t);W.isRegexChar=t=>t.length===1&&W.hasRegexChars(t);W.escapeRegex=t=>t.replace(js,"\\$1");W.toPosixSlashes=t=>t.replace(Ks,"/");W.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":false};W.removeBackslashes=t=>t.replace(Xs,e=>e==="\\"?"":e);W.escapeLast=(t,e,s)=>{let r=t.lastIndexOf(e,s);return r===-1?t:t[r-1]==="\\"?W.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};W.removePrefix=(t,e={})=>{let s=t;return s.startsWith("./")&&(s=s.slice(2),e.prefix="./"),s};W.wrapOutput=(t,e={},s={})=>{let r=s.contains?"":"^",n=s.contains?"":"$",i=`${r}(?:${t})${n}`;return e.negated===true&&(i=`(?:^(?!${i}).*$)`),i};W.basename=(t,{windows:e}={})=>{let s=t.split(e?/[\\/]/:"/"),r=s[s.length-1];return r===""?s[s.length-2]:r};});var ne=J((pn,re)=>{var Vt=nt(),{CHAR_ASTERISK:xt,CHAR_AT:zs,CHAR_BACKWARD_SLASH:it,CHAR_COMMA:Ys,CHAR_DOT:At,CHAR_EXCLAMATION_MARK:St,CHAR_FORWARD_SLASH:se,CHAR_LEFT_CURLY_BRACE:_t,CHAR_LEFT_PARENTHESES:Et,CHAR_LEFT_SQUARE_BRACKET:Vs,CHAR_PLUS:Js,CHAR_QUESTION_MARK:Jt,CHAR_RIGHT_CURLY_BRACE:Zs,CHAR_RIGHT_PARENTHESES:Zt,CHAR_RIGHT_SQUARE_BRACKET:tr}=rt(),te=t=>t===se||t===it,ee=t=>{t.isPrefix!==true&&(t.depth=t.isGlobstar?1/0:1);},er=(t,e)=>{let s=e||{},r=t.length-1,n=s.parts===true||s.scanToEnd===true,i=[],o=[],l=[],b=t,S=-1,x=0,y=0,_=false,E=false,R=false,g=false,p=false,m=false,h=false,q=false,F=false,w=false,I=0,L,A,$={value:"",depth:0,isGlob:false},c=()=>S>=r,G=()=>b.charCodeAt(S+1),B=()=>(L=A,b.charCodeAt(++S));for(;S<r;){A=B();let O;if(A===it){h=$.backslashes=true,A=B(),A===_t&&(m=true);continue}if(m===true||A===_t){for(I++;c()!==true&&(A=B());){if(A===it){h=$.backslashes=true,B();continue}if(A===_t){I++;continue}if(m!==true&&A===At&&(A=B())===At){if(_=$.isBrace=true,R=$.isGlob=true,w=true,n===true)continue;break}if(m!==true&&A===Ys){if(_=$.isBrace=true,R=$.isGlob=true,w=true,n===true)continue;break}if(A===Zs&&(I--,I===0)){m=false,_=$.isBrace=true,w=true;break}}if(n===true)continue;break}if(A===se){if(i.push(S),o.push($),$={value:"",depth:0,isGlob:false},w===true)continue;if(L===At&&S===x+1){x+=2;continue}y=S+1;continue}if(s.noext!==true&&(A===Js||A===zs||A===xt||A===Jt||A===St)===true&&G()===Et){if(R=$.isGlob=true,g=$.isExtglob=true,w=true,A===St&&S===x&&(F=true),n===true){for(;c()!==true&&(A=B());){if(A===it){h=$.backslashes=true,A=B();continue}if(A===Zt){R=$.isGlob=true,w=true;break}}continue}break}if(A===xt){if(L===xt&&(p=$.isGlobstar=true),R=$.isGlob=true,w=true,n===true)continue;break}if(A===Jt){if(R=$.isGlob=true,w=true,n===true)continue;break}if(A===Vs){for(;c()!==true&&(O=B());){if(O===it){h=$.backslashes=true,B();continue}if(O===tr){E=$.isBracket=true,R=$.isGlob=true,w=true;break}}if(n===true)continue;break}if(s.nonegate!==true&&A===St&&S===x){q=$.negated=true,x++;continue}if(s.noparen!==true&&A===Et){if(R=$.isGlob=true,n===true){for(;c()!==true&&(A=B());){if(A===Et){h=$.backslashes=true,A=B();continue}if(A===Zt){w=true;break}}continue}break}if(R===true){if(w=true,n===true)continue;break}}s.noext===true&&(g=false,R=false);let N=b,a="",u="";x>0&&(a=b.slice(0,x),b=b.slice(x),y-=x),N&&R===true&&y>0?(N=b.slice(0,y),u=b.slice(y)):R===true?(N="",u=b):N=b,N&&N!==""&&N!=="/"&&N!==b&&te(N.charCodeAt(N.length-1))&&(N=N.slice(0,-1)),s.unescape===true&&(u&&(u=Vt.removeBackslashes(u)),N&&h===true&&(N=Vt.removeBackslashes(N)));let K={prefix:a,input:t,start:x,base:N,glob:u,isBrace:_,isBracket:E,isGlob:R,isExtglob:g,isGlobstar:p,negated:q,negatedExtglob:F};if(s.tokens===true&&(K.maxDepth=0,te(A)||o.push($),K.tokens=o),s.parts===true||s.tokens===true){let O;for(let k=0;k<i.length;k++){let z=O?O+1:x,X=i[k],Y=t.slice(z,X);s.tokens&&(k===0&&x!==0?(o[k].isPrefix=true,o[k].value=a):o[k].value=Y,ee(o[k]),K.maxDepth+=o[k].depth),(k!==0||Y!=="")&&l.push(Y),O=X;}if(O&&O+1<t.length){let k=t.slice(O+1);l.push(k),s.tokens&&(o[o.length-1].value=k,ee(o[o.length-1]),K.maxDepth+=o[o.length-1].depth);}K.slashes=i,K.parts=l;}return K};re.exports=er;});var ce=J((fn,ae)=>{var ot=rt(),U=nt(),{MAX_LENGTH:ht,POSIX_REGEX_SOURCE:sr,REGEX_NON_SPECIAL_CHARS:rr,REGEX_SPECIAL_CHARS_BACKREF:nr,REPLACEMENTS:ie}=ot,ir=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let s=`[${t.join("-")}]`;try{new RegExp(s);}catch{return t.map(n=>U.escapeRegex(n)).join("..")}return s},tt=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,oe=t=>{let e=[],s=0,r=0,n=0,i="",o=false;for(let l of t){if(o===true){i+=l,o=false;continue}if(l==="\\"){i+=l,o=true;continue}if(l==='"'){n=n===1?0:1,i+=l;continue}if(n===0){if(l==="[")s++;else if(l==="]"&&s>0)s--;else if(s===0){if(l==="(")r++;else if(l===")"&&r>0)r--;else if(l==="|"&&r===0){e.push(i),i="";continue}}}i+=l;}return e.push(i),e},or=t=>{let e=false;for(let s of t){if(e===true){e=false;continue}if(s==="\\"){e=true;continue}if(/[?*+@!()[\]{}]/.test(s))return false}return true},ue=t=>{let e=t.trim(),s=true;for(;s===true;)s=false,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),s=true);if(or(e))return e.replace(/\\(.)/g,"$1")},ur=t=>{let e=t.map(ue).filter(Boolean);for(let s=0;s<e.length;s++)for(let r=s+1;r<e.length;r++){let n=e[s],i=e[r],o=n[0];if(!(!o||n!==o.repeat(n.length)||i!==o.repeat(i.length))&&(n===i||n.startsWith(i)||i.startsWith(n)))return true}return false},vt=(t,e=true)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let s=0,r=0,n=0,i=false;for(let o=1;o<t.length;o++){let l=t[o];if(i===true){i=false;continue}if(l==="\\"){i=true;continue}if(l==='"'){n=n===1?0:1;continue}if(n!==1){if(l==="["){s++;continue}if(l==="]"&&s>0){s--;continue}if(!(s>0)){if(l==="("){r++;continue}if(l===")"&&(r--,r===0))return e===true&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},ar=t=>{let e=0,s=[];for(;e<t.length;){let n=vt(t.slice(e),false);if(!n||n.type!=="*")return;let i=oe(n.body).map(l=>l.trim());if(i.length!==1)return;let o=ue(i[0]);if(!o||o.length!==1)return;s.push(o),e+=n.end+1;}return s.length<1?void 0:`${s.length===1?U.escapeRegex(s[0]):`[${s.map(n=>U.escapeRegex(n)).join("")}]`}*`},cr=t=>{let e=0,s=t.trim(),r=vt(s);for(;r;)e++,s=r.body.trim(),r=vt(s);return e},lr=(t,e)=>{if(e.maxExtglobRecursion===false)return {risky:false};let s=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:ot.DEFAULT_MAX_EXTGLOB_RECURSION,r=oe(t).map(n=>n.trim());if(r.length>1&&(r.some(n=>n==="")||r.some(n=>/^[*?]+$/.test(n))||ur(r)))return {risky:true};for(let n of r){let i=ar(n);if(i)return {risky:true,safeOutput:i};if(cr(n)>s)return {risky:true}}return {risky:false}},Ct=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=ie[t]||t;let s={...e},r=typeof s.maxLength=="number"?Math.min(ht,s.maxLength):ht,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let i={type:"bos",value:"",output:s.prepend||""},o=[i],l=s.capture?"":"?:",b=ot.globChars(s.windows),S=ot.extglobChars(b),{DOT_LITERAL:x,PLUS_LITERAL:y,SLASH_LITERAL:_,ONE_CHAR:E,DOTS_SLASH:R,NO_DOT:g,NO_DOT_SLASH:p,NO_DOTS_SLASH:m,QMARK:h,QMARK_NO_DOT:q,STAR:F,START_ANCHOR:w}=b,I=d=>`(${l}(?:(?!${w}${d.dot?R:x}).)*?)`,L=s.dot?"":g,A=s.dot?h:q,$=s.bash===true?I(s):F;s.capture&&($=`(${$})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);let c={input:t,index:-1,start:0,dot:s.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:o};t=U.removePrefix(t,c),n=t.length;let G=[],B=[],N=[],a=i,u,K=()=>c.index===n-1,O=c.peek=(d=1)=>t[c.index+d],k=c.advance=()=>t[++c.index]||"",z=()=>t.slice(c.index+1),X=(d="",H=0)=>{c.consumed+=d,c.index+=H;},Y=d=>{c.output+=d.output!=null?d.output:d.value,X(d.value);},ve=()=>{let d=1;for(;O()==="!"&&(O(2)!=="("||O(3)==="?");)k(),c.start++,d++;return d%2===0?false:(c.negated=true,c.start++,true)},at=d=>{c[d]++,N.push(d);},V=d=>{c[d]--,N.pop();},v=d=>{if(a.type==="globstar"){let H=c.braces>0&&(d.type==="comma"||d.type==="brace"),f=d.extglob===true||G.length&&(d.type==="pipe"||d.type==="paren");d.type!=="slash"&&d.type!=="paren"&&!H&&!f&&(c.output=c.output.slice(0,-a.output.length),a.type="star",a.value="*",a.output=$,c.output+=a.output);}if(G.length&&d.type!=="paren"&&(G[G.length-1].inner+=d.value),(d.value||d.output)&&Y(d),a&&a.type==="text"&&d.type==="text"){a.output=(a.output||a.value)+d.value,a.value+=d.value;return}d.prev=a,o.push(d),a=d;},ct=(d,H)=>{let f={...S[H],conditions:1,inner:""};f.prev=a,f.parens=c.parens,f.output=c.output,f.startIndex=c.index,f.tokensIndex=o.length;let C=(s.capture?"(":"")+f.open;at("parens"),v({type:d,value:H,output:c.output?"":E}),v({type:"paren",extglob:true,value:k(),output:C}),G.push(f);},Ce=d=>{let H=t.slice(d.startIndex,c.index+1),f=t.slice(d.startIndex+2,c.index),C=lr(f,s);if((d.type==="plus"||d.type==="star")&&C.risky){let T=C.safeOutput?(d.output?"":E)+(s.capture?`(${C.safeOutput})`:C.safeOutput):void 0,Q=o[d.tokensIndex];Q.type="text",Q.value=H,Q.output=T||U.escapeRegex(H);for(let j=d.tokensIndex+1;j<o.length;j++)o[j].value="",o[j].output="",delete o[j].suffix;c.output=d.output+Q.output,c.backtrack=true,v({type:"paren",extglob:true,value:u,output:""}),V("parens");return}let P=d.close+(s.capture?")":""),M;if(d.type==="negate"){let T=$;if(d.inner&&d.inner.length>1&&d.inner.includes("/")&&(T=I(s)),(T!==$||K()||/^\)+$/.test(z()))&&(P=d.close=`)$))${T}`),d.inner.includes("*")&&(M=z())&&/^\.[^\\/.]+$/.test(M)){let Q=Ct(M,{...e,fastpaths:false}).output;P=d.close=`)${Q})${T})`;}d.prev.type==="bos"&&(c.negatedExtglob=true);}v({type:"paren",extglob:true,value:u,output:P}),V("parens");};if(s.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let d=false,H=t.replace(nr,(f,C,P,M,T,Q)=>M==="\\"?(d=true,f):M==="?"?C?C+M+(T?h.repeat(T.length):""):Q===0?A+(T?h.repeat(T.length):""):h.repeat(P.length):M==="."?x.repeat(P.length):M==="*"?C?C+M+(T?$:""):$:C?f:`\\${f}`);return d===true&&(s.unescape===true?H=H.replace(/\\/g,""):H=H.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),H===t&&s.contains===true?(c.output=t,c):(c.output=U.wrapOutput(H,c,e),c)}for(;!K();){if(u=k(),u==="\0")continue;if(u==="\\"){let f=O();if(f==="/"&&s.bash!==true||f==="."||f===";")continue;if(!f){u+="\\",v({type:"text",value:u});continue}let C=/^\\+/.exec(z()),P=0;if(C&&C[0].length>2&&(P=C[0].length,c.index+=P,P%2!==0&&(u+="\\")),s.unescape===true?u=k():u+=k(),c.brackets===0){v({type:"text",value:u});continue}}if(c.brackets>0&&(u!=="]"||a.value==="["||a.value==="[^")){if(s.posix!==false&&u===":"){let f=a.value.slice(1);if(f.includes("[")&&(a.posix=true,f.includes(":"))){let C=a.value.lastIndexOf("["),P=a.value.slice(0,C),M=a.value.slice(C+2),T=sr[M];if(T){a.value=P+T,c.backtrack=true,k(),!i.output&&o.indexOf(a)===1&&(i.output=E);continue}}}(u==="["&&O()!==":"||u==="-"&&O()==="]")&&(u=`\\${u}`),u==="]"&&(a.value==="["||a.value==="[^")&&(u=`\\${u}`),s.posix===true&&u==="!"&&a.value==="["&&(u="^"),a.value+=u,Y({value:u});continue}if(c.quotes===1&&u!=='"'){u=U.escapeRegex(u),a.value+=u,Y({value:u});continue}if(u==='"'){c.quotes=c.quotes===1?0:1,s.keepQuotes===true&&v({type:"text",value:u});continue}if(u==="("){at("parens"),v({type:"paren",value:u});continue}if(u===")"){if(c.parens===0&&s.strictBrackets===true)throw new SyntaxError(tt("opening","("));let f=G[G.length-1];if(f&&c.parens===f.parens+1){Ce(G.pop());continue}v({type:"paren",value:u,output:c.parens?")":"\\)"}),V("parens");continue}if(u==="["){if(s.nobracket===true||!z().includes("]")){if(s.nobracket!==true&&s.strictBrackets===true)throw new SyntaxError(tt("closing","]"));u=`\\${u}`;}else at("brackets");v({type:"bracket",value:u});continue}if(u==="]"){if(s.nobracket===true||a&&a.type==="bracket"&&a.value.length===1){v({type:"text",value:u,output:`\\${u}`});continue}if(c.brackets===0){if(s.strictBrackets===true)throw new SyntaxError(tt("opening","["));v({type:"text",value:u,output:`\\${u}`});continue}V("brackets");let f=a.value.slice(1);if(a.posix!==true&&f[0]==="^"&&!f.includes("/")&&(u=`/${u}`),a.value+=u,Y({value:u}),s.literalBrackets===false||U.hasRegexChars(f))continue;let C=U.escapeRegex(a.value);if(c.output=c.output.slice(0,-a.value.length),s.literalBrackets===true){c.output+=C,a.value=C;continue}a.value=`(${l}${C}|${a.value})`,c.output+=a.value;continue}if(u==="{"&&s.nobrace!==true){at("braces");let f={type:"brace",value:u,output:"(",outputIndex:c.output.length,tokensIndex:c.tokens.length};B.push(f),v(f);continue}if(u==="}"){let f=B[B.length-1];if(s.nobrace===true||!f){v({type:"text",value:u,output:u});continue}let C=")";if(f.dots===true){let P=o.slice(),M=[];for(let T=P.length-1;T>=0&&(o.pop(),P[T].type!=="brace");T--)P[T].type!=="dots"&&M.unshift(P[T].value);C=ir(M,s),c.backtrack=true;}if(f.comma!==true&&f.dots!==true){let P=c.output.slice(0,f.outputIndex),M=c.tokens.slice(f.tokensIndex);f.value=f.output="\\{",u=C="\\}",c.output=P;for(let T of M)c.output+=T.output||T.value;}v({type:"brace",value:u,output:C}),V("braces"),B.pop();continue}if(u==="|"){G.length>0&&G[G.length-1].conditions++,v({type:"text",value:u});continue}if(u===","){let f=u,C=B[B.length-1];C&&N[N.length-1]==="braces"&&(C.comma=true,f="|"),v({type:"comma",value:u,output:f});continue}if(u==="/"){if(a.type==="dot"&&c.index===c.start+1){c.start=c.index+1,c.consumed="",c.output="",o.pop(),a=i;continue}v({type:"slash",value:u,output:_});continue}if(u==="."){if(c.braces>0&&a.type==="dot"){a.value==="."&&(a.output=x);let f=B[B.length-1];a.type="dots",a.output+=u,a.value+=u,f.dots=true;continue}if(c.braces+c.parens===0&&a.type!=="bos"&&a.type!=="slash"){v({type:"text",value:u,output:x});continue}v({type:"dot",value:u,output:x});continue}if(u==="?"){if(!(a&&a.value==="(")&&s.noextglob!==true&&O()==="("&&O(2)!=="?"){ct("qmark",u);continue}if(a&&a.type==="paren"){let C=O(),P=u;(a.value==="("&&!/[!=<:]/.test(C)||C==="<"&&!/<([!=]|\w+>)/.test(z()))&&(P=`\\${u}`),v({type:"text",value:u,output:P});continue}if(s.dot!==true&&(a.type==="slash"||a.type==="bos")){v({type:"qmark",value:u,output:q});continue}v({type:"qmark",value:u,output:h});continue}if(u==="!"){if(s.noextglob!==true&&O()==="("&&(O(2)!=="?"||!/[!=<:]/.test(O(3)))){ct("negate",u);continue}if(s.nonegate!==true&&c.index===0){ve();continue}}if(u==="+"){if(s.noextglob!==true&&O()==="("&&O(2)!=="?"){ct("plus",u);continue}if(a&&a.value==="("||s.regex===false){v({type:"plus",value:u,output:y});continue}if(a&&(a.type==="bracket"||a.type==="paren"||a.type==="brace")||c.parens>0){v({type:"plus",value:u});continue}v({type:"plus",value:y});continue}if(u==="@"){if(s.noextglob!==true&&O()==="("&&O(2)!=="?"){v({type:"at",extglob:true,value:u,output:""});continue}v({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);let f=rr.exec(z());f&&(u+=f[0],c.index+=f[0].length),v({type:"text",value:u});continue}if(a&&(a.type==="globstar"||a.star===true)){a.type="star",a.star=true,a.value+=u,a.output=$,c.backtrack=true,c.globstar=true,X(u);continue}let d=z();if(s.noextglob!==true&&/^\([^?]/.test(d)){ct("star",u);continue}if(a.type==="star"){if(s.noglobstar===true){X(u);continue}let f=a.prev,C=f.prev,P=f.type==="slash"||f.type==="bos",M=C&&(C.type==="star"||C.type==="globstar");if(s.bash===true&&(!P||d[0]&&d[0]!=="/")){v({type:"star",value:u,output:""});continue}let T=c.braces>0&&(f.type==="comma"||f.type==="brace"),Q=G.length&&(f.type==="pipe"||f.type==="paren");if(!P&&f.type!=="paren"&&!T&&!Q){v({type:"star",value:u,output:""});continue}for(;d.slice(0,3)==="/**";){let j=t[c.index+4];if(j&&j!=="/")break;d=d.slice(3),X("/**",3);}if(f.type==="bos"&&K()){a.type="globstar",a.value+=u,a.output=I(s),c.output=a.output,c.globstar=true,X(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!M&&K()){c.output=c.output.slice(0,-(f.output+a.output).length),f.output=`(?:${f.output}`,a.type="globstar",a.output=I(s)+(s.strictSlashes?")":"|$)"),a.value+=u,c.globstar=true,c.output+=f.output+a.output,X(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&d[0]==="/"){let j=d[1]!==void 0?"|$":"";c.output=c.output.slice(0,-(f.output+a.output).length),f.output=`(?:${f.output}`,a.type="globstar",a.output=`${I(s)}${_}|${_}${j})`,a.value+=u,c.output+=f.output+a.output,c.globstar=true,X(u+k()),v({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&d[0]==="/"){a.type="globstar",a.value+=u,a.output=`(?:^|${_}|${I(s)}${_})`,c.output=a.output,c.globstar=true,X(u+k()),v({type:"slash",value:"/",output:""});continue}c.output=c.output.slice(0,-a.output.length),a.type="globstar",a.output=I(s),a.value+=u,c.output+=a.output,c.globstar=true,X(u);continue}let H={type:"star",value:u,output:$};if(s.bash===true){H.output=".*?",(a.type==="bos"||a.type==="slash")&&(H.output=L+H.output),v(H);continue}if(a&&(a.type==="bracket"||a.type==="paren")&&s.regex===true){H.output=u,v(H);continue}(c.index===c.start||a.type==="slash"||a.type==="dot")&&(a.type==="dot"?(c.output+=p,a.output+=p):s.dot===true?(c.output+=m,a.output+=m):(c.output+=L,a.output+=L),O()!=="*"&&(c.output+=E,a.output+=E)),v(H);}for(;c.brackets>0;){if(s.strictBrackets===true)throw new SyntaxError(tt("closing","]"));c.output=U.escapeLast(c.output,"["),V("brackets");}for(;c.parens>0;){if(s.strictBrackets===true)throw new SyntaxError(tt("closing",")"));c.output=U.escapeLast(c.output,"("),V("parens");}for(;c.braces>0;){if(s.strictBrackets===true)throw new SyntaxError(tt("closing","}"));c.output=U.escapeLast(c.output,"{"),V("braces");}if(s.strictSlashes!==true&&(a.type==="star"||a.type==="bracket")&&v({type:"maybe_slash",value:"",output:`${_}?`}),c.backtrack===true){c.output="";for(let d of c.tokens)c.output+=d.output!=null?d.output:d.value,d.suffix&&(c.output+=d.suffix);}return c};Ct.fastpaths=(t,e)=>{let s={...e},r=typeof s.maxLength=="number"?Math.min(ht,s.maxLength):ht,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);t=ie[t]||t;let{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:b,NO_DOT:S,NO_DOTS:x,NO_DOTS_SLASH:y,STAR:_,START_ANCHOR:E}=ot.globChars(s.windows),R=s.dot?x:S,g=s.dot?y:S,p=s.capture?"":"?:",m={negated:false,prefix:""},h=s.bash===true?".*?":_;s.capture&&(h=`(${h})`);let q=L=>L.noglobstar===true?h:`(${p}(?:(?!${E}${L.dot?b:i}).)*?)`,F=L=>{switch(L){case "*":return `${R}${l}${h}`;case ".*":return `${i}${l}${h}`;case "*.*":return `${R}${h}${i}${l}${h}`;case "*/*":return `${R}${h}${o}${l}${g}${h}`;case "**":return R+q(s);case "**/*":return `(?:${R}${q(s)}${o})?${g}${l}${h}`;case "**/*.*":return `(?:${R}${q(s)}${o})?${g}${h}${i}${l}${h}`;case "**/.*":return `(?:${R}${q(s)}${o})?${i}${l}${h}`;default:{let A=/^(.*?)\.(\w+)$/.exec(L);if(!A)return;let $=F(A[1]);return $?$+i+A[2]:void 0}}},w=U.removePrefix(t,m),I=F(w);return I&&s.strictSlashes!==true&&(I+=`${o}?`),I};ae.exports=Ct;});var fe=J((hn,pe)=>{var pr=ne(),$t=ce(),le=nt(),fr=rt(),hr=t=>t&&typeof t=="object"&&!Array.isArray(t),D=(t,e,s=false)=>{if(Array.isArray(t)){let x=t.map(_=>D(_,e,s));return _=>{for(let E of x){let R=E(_);if(R)return R}return false}}let r=hr(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},i=n.windows,o=r?D.compileRe(t,e):D.makeRe(t,e,false,true),l=o.state;delete o.state;let b=()=>false;if(n.ignore){let x={...e,ignore:null,onMatch:null,onResult:null};b=D(n.ignore,x,s);}let S=(x,y=false)=>{let{isMatch:_,match:E,output:R}=D.test(x,o,e,{glob:t,posix:i}),g={glob:t,state:l,regex:o,posix:i,input:x,output:R,match:E,isMatch:_};return typeof n.onResult=="function"&&n.onResult(g),_===false?(g.isMatch=false,y?g:false):b(x)?(typeof n.onIgnore=="function"&&n.onIgnore(g),g.isMatch=false,y?g:false):(typeof n.onMatch=="function"&&n.onMatch(g),y?g:true)};return s&&(S.state=l),S};D.test=(t,e,s,{glob:r,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:false,output:""};let i=s||{},o=i.format||(n?le.toPosixSlashes:null),l=t===r,b=l&&o?o(t):t;return l===false&&(b=o?o(t):t,l=b===r),(l===false||i.capture===true)&&(i.matchBase===true||i.basename===true?l=D.matchBase(t,e,s,n):l=e.exec(b)),{isMatch:!!l,match:l,output:b}};D.matchBase=(t,e,s)=>(e instanceof RegExp?e:D.makeRe(e,s)).test(le.basename(t));D.isMatch=(t,e,s)=>D(e,s)(t);D.parse=(t,e)=>Array.isArray(t)?t.map(s=>D.parse(s,e)):$t(t,{...e,fastpaths:false});D.scan=(t,e)=>pr(t,e);D.compileRe=(t,e,s=false,r=false)=>{if(s===true)return t.output;let n=e||{},i=n.contains?"":"^",o=n.contains?"":"$",l=`${i}(?:${t.output})${o}`;t&&t.negated===true&&(l=`^(?!${l}).*$`);let b=D.toRegex(l,e);return r===true&&(b.state=t),b};D.makeRe=(t,e={},s=false,r=false)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:false,fastpaths:true};return e.fastpaths!==false&&(t[0]==="."||t[0]==="*")&&(n.output=$t.fastpaths(t,e)),n.output||(n=$t(t,e)),D.compileRe(n,e,s,r)};D.toRegex=(t,e)=>{try{let s=e||{};return new RegExp(t,s.flags||(s.nocase?"i":""))}catch(s){if(e&&e.debug===true)throw s;return /$^/}};D.constants=fr;pe.exports=D;});var me=J((dn,ge)=>{var he=fe(),dr=nt();function de(t,e,s=false){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:dr.isWindows()}),he(t,e,s)}Object.assign(de,he);ge.exports=de;});var It=Ot(Ht());var kt=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vite.cjs', document.baseURI).href)));function Ge(t){let e=path.normalize(t);return e.length>1&&e[e.length-1]===path.sep&&(e=e.substring(0,e.length-1)),e}var We=/[\\/]/g;function Bt(t,e){return t.replace(We,e)}var Ue=/^[a-z]:[\\/]$/i;function Ke(t){return t==="/"||Ue.test(t)}function mt(t,e){let{resolvePaths:s,normalizePath:r,pathSeparator:n}=e,i=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(s&&(t=path.resolve(t)),(r||i)&&(t=Ge(t)),t===".")return "";let o=t[t.length-1]!==n;return Bt(o?t+n:t,n)}function Mt(t,e){return e+t}function Xe(t,e){return function(s,r){return r.startsWith(t)?r.slice(t.length)+s:Bt(path.relative(t,r),e.pathSeparator)+e.pathSeparator+s}}function Qe(t){return t}function je(t,e,s){return e+t+s}function ze(t,e){let{relativePaths:s,includeBasePath:r}=e;return s&&t?Xe(t,e):r?Mt:Qe}function Ye(t){return function(e,s){s.push(e.substring(t.length)||".");}}function Ve(t){return function(e,s,r){let n=e.substring(t.length)||".";r.every(i=>i(n,true))&&s.push(n);}}var Je=(t,e)=>{e.push(t||".");},Ze=(t,e,s)=>{let r=t||".";s.every(n=>n(r,true))&&e.push(r);},ts=()=>{};function es(t,e){let{includeDirs:s,filters:r,relativePaths:n}=e;return s?n?r&&r.length?Ve(t):Ye(t):r&&r.length?Ze:Je:ts}var ss=(t,e,s,r)=>{r.every(n=>n(t,false))&&s.files++;},rs=(t,e,s,r)=>{r.every(n=>n(t,false))&&e.push(t);},ns=(t,e,s,r)=>{s.files++;},is=(t,e)=>{e.push(t);},os=()=>{};function us(t){let{excludeFiles:e,filters:s,onlyCounts:r}=t;return e?os:s&&s.length?r?ss:rs:r?ns:is}var as=t=>t,cs=()=>[""].slice(0,0);function ls(t){return t.group?cs:as}var ps=(t,e,s)=>{t.push({directory:e,files:s,dir:e});},fs=()=>{};function hs(t){return t.group?ps:fs}var ds=function(t,e,s){let{queue:r,fs:n,options:{suppressErrors:i}}=e;r.enqueue(),n.realpath(t,(o,l)=>{if(o)return r.dequeue(i?null:o,e);n.stat(l,(b,S)=>{if(b)return r.dequeue(i?null:b,e);if(S.isDirectory()&&qt(t,l,e))return r.dequeue(null,e);s(S,l),r.dequeue(null,e);});});},gs=function(t,e,s){let{queue:r,fs:n,options:{suppressErrors:i}}=e;r.enqueue();try{let o=n.realpathSync(t),l=n.statSync(o);if(l.isDirectory()&&qt(t,o,e))return;s(l,o);}catch(o){if(!i)throw o}};function ms(t,e){return !t.resolveSymlinks||t.excludeSymlinks?null:e?gs:ds}function qt(t,e,s){if(s.options.useRealPaths)return bs(e,s);let r=path.dirname(t),n=1;for(;r!==s.root&&n<2;){let i=s.symlinks.get(r);!!i&&(i===e||i.startsWith(e)||e.startsWith(i))?n++:r=path.dirname(r);}return s.symlinks.set(t,e),n>1}function bs(t,e){return e.visited.includes(t+e.options.pathSeparator)}var ys=t=>t.counts,Rs=t=>t.groups,xs=t=>t.paths,As=t=>t.paths.slice(0,t.options.maxFiles),Ss=(t,e,s)=>(ft(e,s,t.counts,t.options.suppressErrors),null),_s=(t,e,s)=>(ft(e,s,t.paths,t.options.suppressErrors),null),Es=(t,e,s)=>(ft(e,s,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),vs=(t,e,s)=>(ft(e,s,t.groups,t.options.suppressErrors),null);function ft(t,e,s,r){e(t&&!r?t:null,s);}function Cs(t,e){let{onlyCounts:s,group:r,maxFiles:n}=t;return s?e?ys:Ss:r?e?Rs:vs:n?e?As:Es:e?xs:_s}var Ft={withFileTypes:true},$s=(t,e,s,r,n)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);let{fs:i}=t;t.visited.push(e),t.counts.directories++,i.readdir(e||".",Ft,(o,l=[])=>{n(l,s,r),t.queue.dequeue(t.options.suppressErrors?null:o,t);});},Ls=(t,e,s,r,n)=>{let{fs:i}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let o=[];try{o=i.readdirSync(e||".",Ft);}catch(l){if(!t.options.suppressErrors)throw l}n(o,s,r);};function Is(t){return t?Ls:$s}var ws=class{count=0;constructor(t){this.onQueueEmpty=t;}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0));}},Os=class{_files=0;_directories=0;set files(t){this._files=t;}get files(){return this._files}set directories(t){this._directories=t;}get directories(){return this._directories}get dirs(){return this._directories}},Ts=class{aborted=false;abort(){this.aborted=true;}},Gt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,s){this.isSynchronous=!s,this.callbackInvoker=Cs(e,this.isSynchronous),this.root=mt(t,e),this.state={root:Ke(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Os,options:e,queue:new ws((r,n)=>this.callbackInvoker(n,r,s)),symlinks:new Map,visited:[""].slice(0,0),controller:new Ts,fs:e.fs||Fe__namespace},this.joinPath=ze(this.root,e),this.pushDirectory=es(this.root,e),this.pushFile=us(e),this.getArray=ls(e),this.groupFiles=hs(e),this.resolveSymlink=ms(e,this.isSynchronous),this.walkDirectory=Is(this.isSynchronous);}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,s)=>{let{paths:r,options:{filters:n,resolveSymlinks:i,excludeSymlinks:o,exclude:l,maxFiles:b,signal:S,useRealPaths:x,pathSeparator:y},controller:_}=this.state;if(_.aborted||S&&S.aborted||b&&r.length>b)return;let E=this.getArray(this.state.paths);for(let R=0;R<t.length;++R){let g=t[R];if(g.isFile()||g.isSymbolicLink()&&!i&&!o){let p=this.joinPath(g.name,e);this.pushFile(p,E,this.state.counts,n);}else if(g.isDirectory()){let p=je(g.name,e,this.state.options.pathSeparator);if(l&&l(g.name,p))continue;this.pushDirectory(p,r,n),this.walkDirectory(this.state,p,p,s-1,this.walk);}else if(this.resolveSymlink&&g.isSymbolicLink()){let p=Mt(g.name,e);this.resolveSymlink(p,this.state,(m,h)=>{if(m.isDirectory()){if(h=mt(h,this.state.options),l&&l(g.name,x?h:p+y))return;this.walkDirectory(this.state,h,x?h:p+y,s-1,this.walk);}else {h=x?h:p;let q=path.basename(h),F=mt(path.dirname(h),this.state.options);h=this.joinPath(q,F),this.pushFile(h,E,this.state.counts,n);}});}}this.groupFiles(this.state.groups,e,E);}};function Ps(t,e){return new Promise((s,r)=>{Wt(t,e,(n,i)=>{if(n)return r(n);s(i);});})}function Wt(t,e,s){new Gt(t,e,s).start();}function Hs(t,e){return new Gt(t,e).start()}var Nt=class{constructor(t,e){this.root=t,this.options=e;}withPromise(){return Ps(this.root,this.options)}withCallback(t){Wt(this.root,this.options,t);}sync(){return Hs(this.root,this.options)}},Ut=null;try{kt.resolve("picomatch"),Ut=kt("picomatch");}catch{}var Kt=class{globCache={};options={maxDepth:1/0,suppressErrors:true,pathSeparator:path.sep,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction;}group(){return this.options.group=true,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=true,this}withRelativePaths(){return this.options.relativePaths=true,this}withDirs(){return this.options.includeDirs=true,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=true,this.options.includeBasePath=true,this}withErrors(){return this.options.suppressErrors=false,this}withSymlinks({resolvePaths:t=true}={}){return this.options.resolveSymlinks=true,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=true,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=true,this.options.includeDirs=true,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=true,this}crawl(t){return new Nt(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Nt(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:true})}globWithOptions(t,...e){let s=this.globFunction||Ut;if(!s)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=s(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(n=>r(n)),this}};var et=Ot(me(),1),Er=Array.isArray,xe=/\\/g,vr=/^[A-Za-z]:$/,Ae=process.platform==="win32",Cr=/^(\/?\.\.)+$/;function $r(t,e={}){let s=t.length,r=Array(s),n=Array(s),i,o;for(i=0;i<s;i++){let l=Se(t[i]);r[i]=l;let b=l.length,S=Array(b);for(o=0;o<b;o++)S[o]=(0, et.default)(l[o],e);n[i]=S;}return l=>{let b=l.split("/");if(b[0]===".."&&Cr.test(l))return true;for(i=0;i<s;i++){let S=r[i],x=n[i],y=b.length,_=Math.min(y,S.length);for(o=0;o<_;){let E=S[o];if(E.includes("/"))return true;if(!x[o](b[o]))break;if(!e.noglobstar&&E==="**")return true;o++;}if(o===y)return true}return false}}var Lr=/^[A-Z]:\/$/i,Ir=Ae?t=>Lr.test(t):t=>t==="/";function be(t,e,s){if(t===e||e.startsWith(`${t}/`)){if(s){let n=t.length+ +!Ir(t);return (i,o)=>i.slice(n,o?-1:void 0)||"."}let r=e.slice(t.length+1);return r?(n,i)=>{if(n===".")return r;let o=`${r}/${n}`;return i?o.slice(0,-1):o}:(n,i)=>i&&n!=="."?n.slice(0,-1):n}return s?r=>path.posix.relative(t,r)||".":r=>path.posix.relative(t,`${e}/${r}`)||"."}function wr(t,e){if(e.startsWith(`${t}/`)){let s=e.slice(t.length+1);return r=>`${s}/${r}`}return s=>{let r=path.posix.relative(t,`${e}/${s}`);return s[s.length-1]==="/"&&r!==""?`${r}/`:r||"."}}function ye(t){return t.replace(vr,e=>`${e}/`)}var Or={parts:true};function Se(t){var e;let s=et.default.scan(t,Or);return !((e=s.parts)===null||e===void 0)&&e.length?s.parts:[t]}var Tr=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Pr=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Hr=t=>t.replace(Tr,"\\$&"),kr=t=>t.replace(Pr,"\\$&"),Nr=Ae?kr:Hr;function Dr(t,e){let s=et.default.scan(t);return s.isGlob||s.negated}function ut(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t);}function _e(t){return typeof t=="string"?[t]:t??[]}var Br=/^(\/?\.\.)+/,Mr=/\\(?=[()[\]{}!*+?@|])/g;function Lt(t,e,s,r){var n;let i=e.cwd,o=t;t[t.length-1]==="/"&&(o=t.slice(0,-1)),o[o.length-1]!=="*"&&e.expandDirectories&&(o+="/**");let l=Nr(i);o=path.isAbsolute(o.replace(Mr,""))?path.posix.relative(l,o):path.posix.normalize(o);let b=(n=Br.exec(o))===null||n===void 0?void 0:n[0],S=Se(o);if(b){let y=(b.length+1)/3,_=0,E=l.split("/");for(;_<y&&S[_+y]===E[E.length+_-y];)o=o.slice(0,(y-_-1)*3)+o.slice((y-_)*3+S[_+y].length+1)||".",_++;let R=path.posix.join(i,b.slice(_*3));R[0]!=="."&&s.root.length>R.length&&(s.root=ye(R),s.depthOffset=-y+_);}if(!r&&s.depthOffset>=0){var x;(x=s.commonPath)!==null&&x!==void 0||(s.commonPath=S);let y=[],_=Math.min(s.commonPath.length,S.length);for(let E=0;E<_;E++){let R=S[E];if(R==="**"&&!S[E+1]){y.pop();break}if(E===S.length-1||R!==s.commonPath[E]||Dr(R))break;y.push(R);}s.depthOffset=y.length,s.commonPath=y,s.root=ye(y.length>0?path.posix.join(i,...y):i);}return o}function qr(t,e,s){let r=[],n=[];for(let i of t.ignore)i&&(i[0]!=="!"||i[1]==="(")&&n.push(Lt(i,t,s,true));for(let i of e)i&&(i[0]!=="!"||i[1]==="("?r.push(Lt(i,t,s,false)):(i[1]!=="!"||i[2]==="(")&&n.push(Lt(i.slice(1),t,s,true)));return {match:r,ignore:n}}function Fr(t,e){let s=t.cwd,r={root:s,depthOffset:0},n=qr(t,e,r);t.debug&&ut("internal processing patterns:",n);let{absolute:i,caseSensitiveMatch:o,debug:l,dot:b,followSymbolicLinks:S,onlyDirectories:x}=t,y=r.root.replace(xe,""),_={dot:b,nobrace:t.braceExpansion===false,nocase:!o,noextglob:t.extglob===false,noglobstar:t.globstar===false,posix:true},E=(0, et.default)(n.match,_),R=(0, et.default)(n.ignore,_),g=$r(n.match,_),p=be(s,y,i),m=i?p:be(s,y,true),h=(w,I)=>{let L=m(I,true);return L!=="."&&!g(L)||R(L)},q;t.deep!==void 0&&(q=Math.round(t.deep-r.depthOffset));let F=new Kt({filters:[l?(w,I)=>{let L=p(w,I),A=E(L)&&!R(L);return A&&ut(`matched ${L}`),A}:(w,I)=>{let L=p(w,I);return E(L)&&!R(L)}],exclude:l?(w,I)=>{let L=h(w,I);return ut(`${L?"skipped":"crawling"} ${I}`),L}:h,fs:t.fs,pathSeparator:"/",relativePaths:!i,resolvePaths:i,includeBasePath:i,resolveSymlinks:S,excludeSymlinks:!S,excludeFiles:x,includeDirs:x||!t.onlyFiles,maxDepth:q,signal:t.signal}).crawl(y);return t.debug&&ut("internal properties:",{...r,root:y}),[F,s!==y&&!i&&wr(s,y)]}function Gr(t,e){if(e)for(let s=t.length-1;s>=0;s--)t[s]=e(t[s]);return t}var Re={caseSensitiveMatch:true,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:true,followSymbolicLinks:true,onlyFiles:true};function Wr(t){let e=Object.assign({},t);for(let s in Re)e[s]===void 0&&Object.assign(e,{[s]:Re[s]});return e.cwd=(e.cwd instanceof URL?url.fileURLToPath(e.cwd):path.resolve(e.cwd||process.cwd())).replace(xe,"/"),e.ignore=_e(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Fe.readdir,readdirSync:e.fs.readdirSync||Fe.readdirSync,realpath:e.fs.realpath||Fe.realpath,realpathSync:e.fs.realpathSync||Fe.realpathSync,stat:e.fs.stat||Fe.stat,statSync:e.fs.statSync||Fe.statSync}),e.debug&&ut("globbing with options:",e),e}function Ur(t,e={}){var s;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let r=Er(t)||typeof t=="string",n=_e((s=r?t:t.patterns)!==null&&s!==void 0?s:"**/*"),i=Wr(r?e:t);return n.length>0?Fr(i,n):[]}async function Ee(t,e){let[s,r]=Ur(t,e);return s?Gr(await s.withPromise(),r):[]}var dt=It.default.cyan("(nqtr)");function st(t){return t?Array.isArray(t)?t:[t]:[]}function Yr(t){return t?.find(e=>e.name==="vite-plugin-pixi-vn")}function _n(t){let e,s,r,n=new Promise(g=>{r=g;}),i=[...st(t?.activities),...st(t?.commitments),...st(t?.locations),...st(t?.maps),...st(t?.quests),...st(t?.rooms)],o=new Set,l={activityIds:[],commitmentIds:[],locationIds:[],mapIds:[],questIds:[],roomIds:[]};function b(){if(!t?.typeFilePath||!e)return null;let g=t.typeFilePath;return path.isAbsolute(g)?g:path.resolve(e.root,g)}function S(g,p){Fe.mkdirSync(path.dirname(g),{recursive:true});let m=["// @ts-nocheck","/* eslint-disable */","// noinspection JSUnusedGlobalSymbols","// This file is auto-generated by @drincs/nqtr vite plugin. Do not edit manually.","",`export const nqtrActivityIds = ${JSON.stringify(p.activityIds)} as const;`,`export const nqtrCommitmentIds = ${JSON.stringify(p.commitmentIds)} as const;`,`export const nqtrLocationIds = ${JSON.stringify(p.locationIds)} as const;`,`export const nqtrMapIds = ${JSON.stringify(p.mapIds)} as const;`,`export const nqtrQuestIds = ${JSON.stringify(p.questIds)} as const;`,`export const nqtrRoomIds = ${JSON.stringify(p.roomIds)} as const;`,""],h=[["nqtrActivityIdsEnum",p.activityIds],["nqtrCommitmentIdsEnum",p.commitmentIds],["nqtrLocationIdsEnum",p.locationIds],["nqtrMapIdsEnum",p.mapIds],["nqtrQuestIdsEnum",p.questIds],["nqtrRoomIdsEnum",p.roomIds]];for(let[F,w]of h){if(w.length===0){m.push(`export const ${F} = {} as const;`);continue}let I=w.map(L=>`${JSON.stringify(L)}: ${JSON.stringify(L)}`).join(", ");m.push(`export const ${F} = { ${I} } as const;`);}m.push(""),m.push('declare module "@drincs/nqtr/registries" {');let q=[["NqtrActivityIds",p.activityIds],["NqtrCommitmentIds",p.commitmentIds],["NqtrLocationIds",p.locationIds],["NqtrMapIds",p.mapIds],["NqtrQuestIds",p.questIds],["NqtrRoomIds",p.roomIds]];for(let[F,w]of q)if(w.length!==0){m.push(` interface ${F} {`);for(let I of w)m.push(` ${JSON.stringify(I)}: never;`);m.push(" }");}m.push("}"),m.push(""),Fe.writeFileSync(g,m.join(`
|
|
2
|
+
`),"utf-8");}function x(){let g=b();if(g)try{S(g,l);}catch(p){e?.logger.error(`${dt} Failed to write type file "${g}".`,{error:p instanceof Error?p:new Error(String(p)),timestamp:true});}}async function y(g){let p={};try{p=await g("@drincs/nqtr/registries");}catch{}l={activityIds:p.RegisteredActivities?.values().map(h=>h.id)??[],commitmentIds:p.RegisteredCommitments?.values().map(h=>h.id)??[],locationIds:p.RegisteredLocations?.values().map(h=>h.id)??[],mapIds:p.RegisteredMaps?.values().map(h=>h.id)??[],questIds:p.RegisteredQuests?.values().map(h=>h.id)??[],roomIds:p.RegisteredRooms?.values().map(h=>h.id)??[]};let m=l.activityIds.length+l.commitmentIds.length+l.locationIds.length+l.mapIds.length+l.questIds.length+l.roomIds.length;e?.logger.info(`${dt} ${It.default.dim(`${m} NQTR id(s) \u2014 activities: ${l.activityIds.length}, commitments: ${l.commitmentIds.length}, locations: ${l.locationIds.length}, maps: ${l.mapIds.length}, quests: ${l.questIds.length}, rooms: ${l.roomIds.length}`)}`,{timestamp:true});}async function _(g){try{let p=await g("@drincs/nqtr/registries");p.RegisteredActivities?.clear?.(),p.RegisteredCommitments?.clear?.(),p.RegisteredLocations?.clear?.(),p.RegisteredMaps?.clear?.(),p.RegisteredQuests?.clear?.(),p.RegisteredRooms?.clear?.();}catch{}}async function E(g,p){let m=await Ee(i,{cwd:p,absolute:true,onlyFiles:true});for(let h of m){o.add(h);try{await g(h);}catch{}}}async function R(g){for(let p of o)for(let m of g.moduleGraph.getModulesByFile(p)??[])g.moduleGraph.invalidateModule(m);await _(p=>g.ssrLoadModule(p)),await E(p=>g.ssrLoadModule(p),e.root),await y(p=>g.ssrLoadModule(p)),x();}return {name:"vite-plugin-nqtr",enforce:"post",api:{contentLoaded:n},config(g,p){if(p.command==="serve"&&i.length>0)return {ssr:{noExternal:["@drincs/nqtr","@drincs/pixi-vn"]}}},configResolved(g){e=g,s=Yr(g.plugins),i.length===0&&!s?.api?.contentLoaded&&r();},async buildStart(){if(e?.command!=="build")return;let g=s?.api?.contentLoaded;if(g&&await g,i.length>0){let{createServer:p}=await import('vite'),m=await p({root:e.root,configFile:false,server:{middlewareMode:true},appType:"custom",logLevel:"silent",optimizeDeps:{noDiscovery:true},ssr:{noExternal:["@drincs/nqtr","@drincs/pixi-vn"]}});try{await E(h=>m.ssrLoadModule(h),e.root),await y(h=>m.ssrLoadModule(h)),x(),r();}catch{r();}finally{await m.close();}}else if(g){try{let p=await import('@drincs/nqtr/registries');l={activityIds:p.RegisteredActivities?.values().map(m=>m.id)??[],commitmentIds:p.RegisteredCommitments?.values().map(m=>m.id)??[],locationIds:p.RegisteredLocations?.values().map(m=>m.id)??[],mapIds:p.RegisteredMaps?.values().map(m=>m.id)??[],questIds:p.RegisteredQuests?.values().map(m=>m.id)??[],roomIds:p.RegisteredRooms?.values().map(m=>m.id)??[]},x();}catch{}r();}else r();},configureServer(g){(async()=>{let m=s?.api?.contentLoaded;m&&await m,i.length>0&&await E(h=>g.ssrLoadModule(h),e.root),await y(h=>g.ssrLoadModule(h)),x(),r(),s?.api?.onReload?.(()=>{y(h=>g.ssrLoadModule(h)).then(()=>x()).catch(h=>{e?.logger.error(`${dt} Failed to regenerate types after pixi-vn reload.`,{error:h instanceof Error?h:new Error(String(h)),timestamp:true});});});})().catch(()=>r());},hotUpdate({file:g,server:p}){let m=b();if(m&&g===m)return [];if(i.length>0&&o.has(g))return R(p).catch(h=>{e?.logger.error(`${dt} Failed to reload NQTR content.`,{error:h instanceof Error?h:new Error(String(h)),timestamp:true});}),[]}}}exports.vitePluginNqtr=_n;
|
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link vitePluginNqtr}.
|
|
5
|
+
*/
|
|
6
|
+
interface VitePluginNqtrOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Glob / path of module(s) whose side effects register activities via
|
|
9
|
+
* `RegisteredActivities.add(...)`.
|
|
10
|
+
*
|
|
11
|
+
* @example "./src/activities.ts"
|
|
12
|
+
* @example "./src/activities/*.ts"
|
|
13
|
+
*/
|
|
14
|
+
activities?: string | string[];
|
|
15
|
+
/**
|
|
16
|
+
* Glob / path of module(s) whose side effects register commitments via
|
|
17
|
+
* `RegisteredCommitments.add(...)`.
|
|
18
|
+
*
|
|
19
|
+
* @example "./src/commitments.ts"
|
|
20
|
+
*/
|
|
21
|
+
commitments?: string | string[];
|
|
22
|
+
/**
|
|
23
|
+
* Glob / path of module(s) whose side effects register locations via
|
|
24
|
+
* `RegisteredLocations.add(...)`.
|
|
25
|
+
*
|
|
26
|
+
* @example "./src/locations.ts"
|
|
27
|
+
*/
|
|
28
|
+
locations?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* Glob / path of module(s) whose side effects register maps via
|
|
31
|
+
* `RegisteredMaps.add(...)`.
|
|
32
|
+
*
|
|
33
|
+
* @example "./src/maps.ts"
|
|
34
|
+
*/
|
|
35
|
+
maps?: string | string[];
|
|
36
|
+
/**
|
|
37
|
+
* Glob / path of module(s) whose side effects register quests via
|
|
38
|
+
* `RegisteredQuests.add(...)`.
|
|
39
|
+
*
|
|
40
|
+
* @example "./src/quests.ts"
|
|
41
|
+
* @example "./src/*.quest.ts"
|
|
42
|
+
*/
|
|
43
|
+
quests?: string | string[];
|
|
44
|
+
/**
|
|
45
|
+
* Glob / path of module(s) whose side effects register rooms via
|
|
46
|
+
* `RegisteredRooms.add(...)`.
|
|
47
|
+
*
|
|
48
|
+
* @example "./src/rooms.ts"
|
|
49
|
+
*/
|
|
50
|
+
rooms?: string | string[];
|
|
51
|
+
/**
|
|
52
|
+
* Path to the auto-generated TypeScript file that contains both:
|
|
53
|
+
* - `as const` runtime arrays of all currently known entity IDs
|
|
54
|
+
* (e.g. `nqtrActivityIds`, `nqtrRoomIds`, …) — import these into
|
|
55
|
+
* {@link createNqtrHandler} for runtime validation of Ink hashtag commands.
|
|
56
|
+
* - a `declare module` augmentation of the six `Nqtr*Ids` interfaces in
|
|
57
|
+
* `@drincs/nqtr/registries` — gives compile-time–safe ID types once the
|
|
58
|
+
* file is included in the project's TypeScript compilation.
|
|
59
|
+
*
|
|
60
|
+
* When provided, the plugin generates (or overwrites) this file:
|
|
61
|
+
* - after all content modules have been loaded at startup,
|
|
62
|
+
* - after every hot-reload of a watched content file.
|
|
63
|
+
*
|
|
64
|
+
* The generated file is **excluded from HMR** so that regenerating it
|
|
65
|
+
* never triggers a full-page reload.
|
|
66
|
+
*
|
|
67
|
+
* The path may be absolute or relative to Vite `root`.
|
|
68
|
+
*
|
|
69
|
+
* @example "./src/nqtr.keys.gen.ts"
|
|
70
|
+
*/
|
|
71
|
+
typeFilePath?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Creates a Vite plugin that generates TypeScript declaration files with
|
|
75
|
+
* compile-time–safe ID types for all six NQTR entity registries:
|
|
76
|
+
* activities, commitments, locations, maps, quests, and rooms.
|
|
77
|
+
*
|
|
78
|
+
* ---
|
|
79
|
+
*
|
|
80
|
+
* **How it works**
|
|
81
|
+
*
|
|
82
|
+
* At startup (and after every hot-module reload), the plugin executes the
|
|
83
|
+
* content modules listed in the options server-side via Vite SSR. Those
|
|
84
|
+
* modules register entities by calling `RegisteredActivities.add(...)`,
|
|
85
|
+
* `RegisteredRooms.add(...)`, etc. The plugin then reads back the IDs from
|
|
86
|
+
* all six registries and writes a `.d.ts` declaration file that augments the
|
|
87
|
+
* `Nqtr*Ids` interfaces in `@drincs/nqtr/registries`.
|
|
88
|
+
*
|
|
89
|
+
* ---
|
|
90
|
+
*
|
|
91
|
+
* **Pixi-VN integration**
|
|
92
|
+
*
|
|
93
|
+
* If `vitePluginPixivn` (from `@drincs/pixi-vn/vite`) is present in the same
|
|
94
|
+
* Vite config, this plugin automatically waits for its `contentLoaded`
|
|
95
|
+
* signal before reading registry state. This means you can pass a single
|
|
96
|
+
* `content` barrel file to `vitePluginPixivn` and have both plugins read from
|
|
97
|
+
* it without duplicating the option:
|
|
98
|
+
*
|
|
99
|
+
* ```ts
|
|
100
|
+
* // vite.config.ts
|
|
101
|
+
* import { vitePluginPixivn } from "@drincs/pixi-vn/vite";
|
|
102
|
+
* import { vitePluginNqtr } from "@drincs/nqtr/vite";
|
|
103
|
+
*
|
|
104
|
+
* export default defineConfig({
|
|
105
|
+
* plugins: [
|
|
106
|
+
* vitePluginPixivn({ content: "./src/content/index.ts" }),
|
|
107
|
+
* vitePluginNqtr({ typeFilePath: "./src/nqtr.keys.gen.ts" }),
|
|
108
|
+
* ],
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* The nqtr plugin will piggy-back on pixi-vn's content loading and re-run
|
|
113
|
+
* type generation on every hot-reload triggered by the pixi-vn plugin.
|
|
114
|
+
*
|
|
115
|
+
* ---
|
|
116
|
+
*
|
|
117
|
+
* **Standalone usage** (without pixi-vn)
|
|
118
|
+
*
|
|
119
|
+
* Target specific entity files directly:
|
|
120
|
+
*
|
|
121
|
+
* ```ts
|
|
122
|
+
* vitePluginNqtr({
|
|
123
|
+
* activities: "./src/activities/*.ts",
|
|
124
|
+
* rooms: "./src/rooms.ts",
|
|
125
|
+
* locations: "./src/locations.ts",
|
|
126
|
+
* maps: "./src/maps.ts",
|
|
127
|
+
* typeFilePath: "./src/nqtr.keys.gen.ts",
|
|
128
|
+
* })
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* ---
|
|
132
|
+
*
|
|
133
|
+
* **Generated file**
|
|
134
|
+
*
|
|
135
|
+
* The file written to {@link VitePluginNqtrOptions.typeFilePath} looks like:
|
|
136
|
+
*
|
|
137
|
+
* ```ts
|
|
138
|
+
* // nqtr.keys.gen.ts — auto-generated, do not edit manually
|
|
139
|
+
* export const nqtrActivityIds = ["study", "cook"] as const;
|
|
140
|
+
* export const nqtrRoomIds = ["bedroom", "kitchen"] as const;
|
|
141
|
+
* // …
|
|
142
|
+
*
|
|
143
|
+
* declare module "@drincs/nqtr/registries" {
|
|
144
|
+
* interface NqtrActivityIds { "study": never; "cook": never; }
|
|
145
|
+
* interface NqtrRoomIds { "bedroom": never; "kitchen": never; }
|
|
146
|
+
* // …
|
|
147
|
+
* }
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* The `as const` arrays can be passed to {@link createNqtrHandler} for runtime
|
|
151
|
+
* validation of Ink hashtag commands. The `declare module` augmentation narrows
|
|
152
|
+
* the `*IdType` helpers (`ActivityIdType`, `RoomIdType`, …) from `string` to
|
|
153
|
+
* the union of known literal IDs at compile time.
|
|
154
|
+
*
|
|
155
|
+
* @param options - Optional plugin configuration.
|
|
156
|
+
* @returns A Vite plugin.
|
|
157
|
+
*/
|
|
158
|
+
declare function vitePluginNqtr(options?: VitePluginNqtrOptions): Plugin;
|
|
159
|
+
|
|
160
|
+
export { type VitePluginNqtrOptions, vitePluginNqtr };
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link vitePluginNqtr}.
|
|
5
|
+
*/
|
|
6
|
+
interface VitePluginNqtrOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Glob / path of module(s) whose side effects register activities via
|
|
9
|
+
* `RegisteredActivities.add(...)`.
|
|
10
|
+
*
|
|
11
|
+
* @example "./src/activities.ts"
|
|
12
|
+
* @example "./src/activities/*.ts"
|
|
13
|
+
*/
|
|
14
|
+
activities?: string | string[];
|
|
15
|
+
/**
|
|
16
|
+
* Glob / path of module(s) whose side effects register commitments via
|
|
17
|
+
* `RegisteredCommitments.add(...)`.
|
|
18
|
+
*
|
|
19
|
+
* @example "./src/commitments.ts"
|
|
20
|
+
*/
|
|
21
|
+
commitments?: string | string[];
|
|
22
|
+
/**
|
|
23
|
+
* Glob / path of module(s) whose side effects register locations via
|
|
24
|
+
* `RegisteredLocations.add(...)`.
|
|
25
|
+
*
|
|
26
|
+
* @example "./src/locations.ts"
|
|
27
|
+
*/
|
|
28
|
+
locations?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* Glob / path of module(s) whose side effects register maps via
|
|
31
|
+
* `RegisteredMaps.add(...)`.
|
|
32
|
+
*
|
|
33
|
+
* @example "./src/maps.ts"
|
|
34
|
+
*/
|
|
35
|
+
maps?: string | string[];
|
|
36
|
+
/**
|
|
37
|
+
* Glob / path of module(s) whose side effects register quests via
|
|
38
|
+
* `RegisteredQuests.add(...)`.
|
|
39
|
+
*
|
|
40
|
+
* @example "./src/quests.ts"
|
|
41
|
+
* @example "./src/*.quest.ts"
|
|
42
|
+
*/
|
|
43
|
+
quests?: string | string[];
|
|
44
|
+
/**
|
|
45
|
+
* Glob / path of module(s) whose side effects register rooms via
|
|
46
|
+
* `RegisteredRooms.add(...)`.
|
|
47
|
+
*
|
|
48
|
+
* @example "./src/rooms.ts"
|
|
49
|
+
*/
|
|
50
|
+
rooms?: string | string[];
|
|
51
|
+
/**
|
|
52
|
+
* Path to the auto-generated TypeScript file that contains both:
|
|
53
|
+
* - `as const` runtime arrays of all currently known entity IDs
|
|
54
|
+
* (e.g. `nqtrActivityIds`, `nqtrRoomIds`, …) — import these into
|
|
55
|
+
* {@link createNqtrHandler} for runtime validation of Ink hashtag commands.
|
|
56
|
+
* - a `declare module` augmentation of the six `Nqtr*Ids` interfaces in
|
|
57
|
+
* `@drincs/nqtr/registries` — gives compile-time–safe ID types once the
|
|
58
|
+
* file is included in the project's TypeScript compilation.
|
|
59
|
+
*
|
|
60
|
+
* When provided, the plugin generates (or overwrites) this file:
|
|
61
|
+
* - after all content modules have been loaded at startup,
|
|
62
|
+
* - after every hot-reload of a watched content file.
|
|
63
|
+
*
|
|
64
|
+
* The generated file is **excluded from HMR** so that regenerating it
|
|
65
|
+
* never triggers a full-page reload.
|
|
66
|
+
*
|
|
67
|
+
* The path may be absolute or relative to Vite `root`.
|
|
68
|
+
*
|
|
69
|
+
* @example "./src/nqtr.keys.gen.ts"
|
|
70
|
+
*/
|
|
71
|
+
typeFilePath?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Creates a Vite plugin that generates TypeScript declaration files with
|
|
75
|
+
* compile-time–safe ID types for all six NQTR entity registries:
|
|
76
|
+
* activities, commitments, locations, maps, quests, and rooms.
|
|
77
|
+
*
|
|
78
|
+
* ---
|
|
79
|
+
*
|
|
80
|
+
* **How it works**
|
|
81
|
+
*
|
|
82
|
+
* At startup (and after every hot-module reload), the plugin executes the
|
|
83
|
+
* content modules listed in the options server-side via Vite SSR. Those
|
|
84
|
+
* modules register entities by calling `RegisteredActivities.add(...)`,
|
|
85
|
+
* `RegisteredRooms.add(...)`, etc. The plugin then reads back the IDs from
|
|
86
|
+
* all six registries and writes a `.d.ts` declaration file that augments the
|
|
87
|
+
* `Nqtr*Ids` interfaces in `@drincs/nqtr/registries`.
|
|
88
|
+
*
|
|
89
|
+
* ---
|
|
90
|
+
*
|
|
91
|
+
* **Pixi-VN integration**
|
|
92
|
+
*
|
|
93
|
+
* If `vitePluginPixivn` (from `@drincs/pixi-vn/vite`) is present in the same
|
|
94
|
+
* Vite config, this plugin automatically waits for its `contentLoaded`
|
|
95
|
+
* signal before reading registry state. This means you can pass a single
|
|
96
|
+
* `content` barrel file to `vitePluginPixivn` and have both plugins read from
|
|
97
|
+
* it without duplicating the option:
|
|
98
|
+
*
|
|
99
|
+
* ```ts
|
|
100
|
+
* // vite.config.ts
|
|
101
|
+
* import { vitePluginPixivn } from "@drincs/pixi-vn/vite";
|
|
102
|
+
* import { vitePluginNqtr } from "@drincs/nqtr/vite";
|
|
103
|
+
*
|
|
104
|
+
* export default defineConfig({
|
|
105
|
+
* plugins: [
|
|
106
|
+
* vitePluginPixivn({ content: "./src/content/index.ts" }),
|
|
107
|
+
* vitePluginNqtr({ typeFilePath: "./src/nqtr.keys.gen.ts" }),
|
|
108
|
+
* ],
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* The nqtr plugin will piggy-back on pixi-vn's content loading and re-run
|
|
113
|
+
* type generation on every hot-reload triggered by the pixi-vn plugin.
|
|
114
|
+
*
|
|
115
|
+
* ---
|
|
116
|
+
*
|
|
117
|
+
* **Standalone usage** (without pixi-vn)
|
|
118
|
+
*
|
|
119
|
+
* Target specific entity files directly:
|
|
120
|
+
*
|
|
121
|
+
* ```ts
|
|
122
|
+
* vitePluginNqtr({
|
|
123
|
+
* activities: "./src/activities/*.ts",
|
|
124
|
+
* rooms: "./src/rooms.ts",
|
|
125
|
+
* locations: "./src/locations.ts",
|
|
126
|
+
* maps: "./src/maps.ts",
|
|
127
|
+
* typeFilePath: "./src/nqtr.keys.gen.ts",
|
|
128
|
+
* })
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* ---
|
|
132
|
+
*
|
|
133
|
+
* **Generated file**
|
|
134
|
+
*
|
|
135
|
+
* The file written to {@link VitePluginNqtrOptions.typeFilePath} looks like:
|
|
136
|
+
*
|
|
137
|
+
* ```ts
|
|
138
|
+
* // nqtr.keys.gen.ts — auto-generated, do not edit manually
|
|
139
|
+
* export const nqtrActivityIds = ["study", "cook"] as const;
|
|
140
|
+
* export const nqtrRoomIds = ["bedroom", "kitchen"] as const;
|
|
141
|
+
* // …
|
|
142
|
+
*
|
|
143
|
+
* declare module "@drincs/nqtr/registries" {
|
|
144
|
+
* interface NqtrActivityIds { "study": never; "cook": never; }
|
|
145
|
+
* interface NqtrRoomIds { "bedroom": never; "kitchen": never; }
|
|
146
|
+
* // …
|
|
147
|
+
* }
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* The `as const` arrays can be passed to {@link createNqtrHandler} for runtime
|
|
151
|
+
* validation of Ink hashtag commands. The `declare module` augmentation narrows
|
|
152
|
+
* the `*IdType` helpers (`ActivityIdType`, `RoomIdType`, …) from `string` to
|
|
153
|
+
* the union of known literal IDs at compile time.
|
|
154
|
+
*
|
|
155
|
+
* @param options - Optional plugin configuration.
|
|
156
|
+
* @returns A Vite plugin.
|
|
157
|
+
*/
|
|
158
|
+
declare function vitePluginNqtr(options?: VitePluginNqtrOptions): Plugin;
|
|
159
|
+
|
|
160
|
+
export { type VitePluginNqtrOptions, vitePluginNqtr };
|
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as Fe from'fs';import {mkdirSync,writeFileSync,statSync,stat,realpathSync,realpath,readdirSync,readdir}from'fs';import {isAbsolute,resolve,dirname,posix,sep,basename,normalize,relative}from'path';import {fileURLToPath}from'url';import {createRequire}from'module';var $e=Object.create;var wt=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var J=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Te=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ie(e))!Oe.call(t,n)&&n!==s&&wt(t,n,{get:()=>e[n],enumerable:!(r=Le(e,n))||r.enumerable});return t};var Ot=(t,e,s)=>(s=t!=null?$e(we(t)):{},Te(e||!t||!t.__esModule?wt(s,"default",{value:t,enumerable:true}):s,t));var Ht=J((Jr,gt)=>{var pt=process||{},Tt=pt.argv||[],lt=pt.env||{},Pe=!(lt.NO_COLOR||Tt.includes("--no-color"))&&(!!lt.FORCE_COLOR||Tt.includes("--color")||pt.platform==="win32"||(pt.stdout||{}).isTTY&<.TERM!=="dumb"||!!lt.CI),He=(t,e,s=t)=>r=>{let n=""+r,i=n.indexOf(e,t.length);return ~i?t+ke(n,e,s,i)+e:t+n+e},ke=(t,e,s,r)=>{let n="",i=0;do n+=t.substring(i,r)+s,i=r+e.length,r=t.indexOf(e,i);while(~r);return n+t.substring(i)},Pt=(t=Pe)=>{let e=t?He:()=>String;return {isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};gt.exports=Pt();gt.exports.createColors=Pt;});var rt=J((cn,Yt)=>{var Xt="[^\\\\/]",ks="(?=.)",Qt="[^/]",yt="(?:\\/|$)",jt="(?:^|\\/)",Rt=`\\.{1,2}${yt}`,Ns="(?!\\.)",Ds=`(?!${jt}${Rt})`,Bs=`(?!\\.{0,1}${yt})`,Ms=`(?!${Rt})`,qs="[^.\\/]",Fs=`${Qt}*?`,Gs="/",zt={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:ks,QMARK:Qt,END_ANCHOR:yt,DOTS_SLASH:Rt,NO_DOT:Ns,NO_DOTS:Ds,NO_DOT_SLASH:Bs,NO_DOTS_SLASH:Ms,QMARK_NO_DOT:qs,STAR:Fs,START_ANCHOR:jt,SEP:Gs},Ws={...zt,SLASH_LITERAL:"[\\\\/]",QMARK:Xt,STAR:`${Xt}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Us={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Yt.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Us,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===true?Ws:zt}};});var nt=J(W=>{var{REGEX_BACKSLASH:Ks,REGEX_REMOVE_BACKSLASH:Xs,REGEX_SPECIAL_CHARS:Qs,REGEX_SPECIAL_CHARS_GLOBAL:js}=rt();W.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);W.hasRegexChars=t=>Qs.test(t);W.isRegexChar=t=>t.length===1&&W.hasRegexChars(t);W.escapeRegex=t=>t.replace(js,"\\$1");W.toPosixSlashes=t=>t.replace(Ks,"/");W.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":false};W.removeBackslashes=t=>t.replace(Xs,e=>e==="\\"?"":e);W.escapeLast=(t,e,s)=>{let r=t.lastIndexOf(e,s);return r===-1?t:t[r-1]==="\\"?W.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};W.removePrefix=(t,e={})=>{let s=t;return s.startsWith("./")&&(s=s.slice(2),e.prefix="./"),s};W.wrapOutput=(t,e={},s={})=>{let r=s.contains?"":"^",n=s.contains?"":"$",i=`${r}(?:${t})${n}`;return e.negated===true&&(i=`(?:^(?!${i}).*$)`),i};W.basename=(t,{windows:e}={})=>{let s=t.split(e?/[\\/]/:"/"),r=s[s.length-1];return r===""?s[s.length-2]:r};});var ne=J((pn,re)=>{var Vt=nt(),{CHAR_ASTERISK:xt,CHAR_AT:zs,CHAR_BACKWARD_SLASH:it,CHAR_COMMA:Ys,CHAR_DOT:At,CHAR_EXCLAMATION_MARK:St,CHAR_FORWARD_SLASH:se,CHAR_LEFT_CURLY_BRACE:_t,CHAR_LEFT_PARENTHESES:Et,CHAR_LEFT_SQUARE_BRACKET:Vs,CHAR_PLUS:Js,CHAR_QUESTION_MARK:Jt,CHAR_RIGHT_CURLY_BRACE:Zs,CHAR_RIGHT_PARENTHESES:Zt,CHAR_RIGHT_SQUARE_BRACKET:tr}=rt(),te=t=>t===se||t===it,ee=t=>{t.isPrefix!==true&&(t.depth=t.isGlobstar?1/0:1);},er=(t,e)=>{let s=e||{},r=t.length-1,n=s.parts===true||s.scanToEnd===true,i=[],o=[],l=[],b=t,S=-1,x=0,y=0,_=false,E=false,R=false,g=false,p=false,m=false,h=false,q=false,F=false,w=false,I=0,L,A,$={value:"",depth:0,isGlob:false},c=()=>S>=r,G=()=>b.charCodeAt(S+1),B=()=>(L=A,b.charCodeAt(++S));for(;S<r;){A=B();let O;if(A===it){h=$.backslashes=true,A=B(),A===_t&&(m=true);continue}if(m===true||A===_t){for(I++;c()!==true&&(A=B());){if(A===it){h=$.backslashes=true,B();continue}if(A===_t){I++;continue}if(m!==true&&A===At&&(A=B())===At){if(_=$.isBrace=true,R=$.isGlob=true,w=true,n===true)continue;break}if(m!==true&&A===Ys){if(_=$.isBrace=true,R=$.isGlob=true,w=true,n===true)continue;break}if(A===Zs&&(I--,I===0)){m=false,_=$.isBrace=true,w=true;break}}if(n===true)continue;break}if(A===se){if(i.push(S),o.push($),$={value:"",depth:0,isGlob:false},w===true)continue;if(L===At&&S===x+1){x+=2;continue}y=S+1;continue}if(s.noext!==true&&(A===Js||A===zs||A===xt||A===Jt||A===St)===true&&G()===Et){if(R=$.isGlob=true,g=$.isExtglob=true,w=true,A===St&&S===x&&(F=true),n===true){for(;c()!==true&&(A=B());){if(A===it){h=$.backslashes=true,A=B();continue}if(A===Zt){R=$.isGlob=true,w=true;break}}continue}break}if(A===xt){if(L===xt&&(p=$.isGlobstar=true),R=$.isGlob=true,w=true,n===true)continue;break}if(A===Jt){if(R=$.isGlob=true,w=true,n===true)continue;break}if(A===Vs){for(;c()!==true&&(O=B());){if(O===it){h=$.backslashes=true,B();continue}if(O===tr){E=$.isBracket=true,R=$.isGlob=true,w=true;break}}if(n===true)continue;break}if(s.nonegate!==true&&A===St&&S===x){q=$.negated=true,x++;continue}if(s.noparen!==true&&A===Et){if(R=$.isGlob=true,n===true){for(;c()!==true&&(A=B());){if(A===Et){h=$.backslashes=true,A=B();continue}if(A===Zt){w=true;break}}continue}break}if(R===true){if(w=true,n===true)continue;break}}s.noext===true&&(g=false,R=false);let N=b,a="",u="";x>0&&(a=b.slice(0,x),b=b.slice(x),y-=x),N&&R===true&&y>0?(N=b.slice(0,y),u=b.slice(y)):R===true?(N="",u=b):N=b,N&&N!==""&&N!=="/"&&N!==b&&te(N.charCodeAt(N.length-1))&&(N=N.slice(0,-1)),s.unescape===true&&(u&&(u=Vt.removeBackslashes(u)),N&&h===true&&(N=Vt.removeBackslashes(N)));let K={prefix:a,input:t,start:x,base:N,glob:u,isBrace:_,isBracket:E,isGlob:R,isExtglob:g,isGlobstar:p,negated:q,negatedExtglob:F};if(s.tokens===true&&(K.maxDepth=0,te(A)||o.push($),K.tokens=o),s.parts===true||s.tokens===true){let O;for(let k=0;k<i.length;k++){let z=O?O+1:x,X=i[k],Y=t.slice(z,X);s.tokens&&(k===0&&x!==0?(o[k].isPrefix=true,o[k].value=a):o[k].value=Y,ee(o[k]),K.maxDepth+=o[k].depth),(k!==0||Y!=="")&&l.push(Y),O=X;}if(O&&O+1<t.length){let k=t.slice(O+1);l.push(k),s.tokens&&(o[o.length-1].value=k,ee(o[o.length-1]),K.maxDepth+=o[o.length-1].depth);}K.slashes=i,K.parts=l;}return K};re.exports=er;});var ce=J((fn,ae)=>{var ot=rt(),U=nt(),{MAX_LENGTH:ht,POSIX_REGEX_SOURCE:sr,REGEX_NON_SPECIAL_CHARS:rr,REGEX_SPECIAL_CHARS_BACKREF:nr,REPLACEMENTS:ie}=ot,ir=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let s=`[${t.join("-")}]`;try{new RegExp(s);}catch{return t.map(n=>U.escapeRegex(n)).join("..")}return s},tt=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,oe=t=>{let e=[],s=0,r=0,n=0,i="",o=false;for(let l of t){if(o===true){i+=l,o=false;continue}if(l==="\\"){i+=l,o=true;continue}if(l==='"'){n=n===1?0:1,i+=l;continue}if(n===0){if(l==="[")s++;else if(l==="]"&&s>0)s--;else if(s===0){if(l==="(")r++;else if(l===")"&&r>0)r--;else if(l==="|"&&r===0){e.push(i),i="";continue}}}i+=l;}return e.push(i),e},or=t=>{let e=false;for(let s of t){if(e===true){e=false;continue}if(s==="\\"){e=true;continue}if(/[?*+@!()[\]{}]/.test(s))return false}return true},ue=t=>{let e=t.trim(),s=true;for(;s===true;)s=false,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),s=true);if(or(e))return e.replace(/\\(.)/g,"$1")},ur=t=>{let e=t.map(ue).filter(Boolean);for(let s=0;s<e.length;s++)for(let r=s+1;r<e.length;r++){let n=e[s],i=e[r],o=n[0];if(!(!o||n!==o.repeat(n.length)||i!==o.repeat(i.length))&&(n===i||n.startsWith(i)||i.startsWith(n)))return true}return false},vt=(t,e=true)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let s=0,r=0,n=0,i=false;for(let o=1;o<t.length;o++){let l=t[o];if(i===true){i=false;continue}if(l==="\\"){i=true;continue}if(l==='"'){n=n===1?0:1;continue}if(n!==1){if(l==="["){s++;continue}if(l==="]"&&s>0){s--;continue}if(!(s>0)){if(l==="("){r++;continue}if(l===")"&&(r--,r===0))return e===true&&o!==t.length-1?void 0:{type:t[0],body:t.slice(2,o),end:o}}}}},ar=t=>{let e=0,s=[];for(;e<t.length;){let n=vt(t.slice(e),false);if(!n||n.type!=="*")return;let i=oe(n.body).map(l=>l.trim());if(i.length!==1)return;let o=ue(i[0]);if(!o||o.length!==1)return;s.push(o),e+=n.end+1;}return s.length<1?void 0:`${s.length===1?U.escapeRegex(s[0]):`[${s.map(n=>U.escapeRegex(n)).join("")}]`}*`},cr=t=>{let e=0,s=t.trim(),r=vt(s);for(;r;)e++,s=r.body.trim(),r=vt(s);return e},lr=(t,e)=>{if(e.maxExtglobRecursion===false)return {risky:false};let s=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:ot.DEFAULT_MAX_EXTGLOB_RECURSION,r=oe(t).map(n=>n.trim());if(r.length>1&&(r.some(n=>n==="")||r.some(n=>/^[*?]+$/.test(n))||ur(r)))return {risky:true};for(let n of r){let i=ar(n);if(i)return {risky:true,safeOutput:i};if(cr(n)>s)return {risky:true}}return {risky:false}},Ct=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=ie[t]||t;let s={...e},r=typeof s.maxLength=="number"?Math.min(ht,s.maxLength):ht,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let i={type:"bos",value:"",output:s.prepend||""},o=[i],l=s.capture?"":"?:",b=ot.globChars(s.windows),S=ot.extglobChars(b),{DOT_LITERAL:x,PLUS_LITERAL:y,SLASH_LITERAL:_,ONE_CHAR:E,DOTS_SLASH:R,NO_DOT:g,NO_DOT_SLASH:p,NO_DOTS_SLASH:m,QMARK:h,QMARK_NO_DOT:q,STAR:F,START_ANCHOR:w}=b,I=d=>`(${l}(?:(?!${w}${d.dot?R:x}).)*?)`,L=s.dot?"":g,A=s.dot?h:q,$=s.bash===true?I(s):F;s.capture&&($=`(${$})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);let c={input:t,index:-1,start:0,dot:s.dot===true,consumed:"",output:"",prefix:"",backtrack:false,negated:false,brackets:0,braces:0,parens:0,quotes:0,globstar:false,tokens:o};t=U.removePrefix(t,c),n=t.length;let G=[],B=[],N=[],a=i,u,K=()=>c.index===n-1,O=c.peek=(d=1)=>t[c.index+d],k=c.advance=()=>t[++c.index]||"",z=()=>t.slice(c.index+1),X=(d="",H=0)=>{c.consumed+=d,c.index+=H;},Y=d=>{c.output+=d.output!=null?d.output:d.value,X(d.value);},ve=()=>{let d=1;for(;O()==="!"&&(O(2)!=="("||O(3)==="?");)k(),c.start++,d++;return d%2===0?false:(c.negated=true,c.start++,true)},at=d=>{c[d]++,N.push(d);},V=d=>{c[d]--,N.pop();},v=d=>{if(a.type==="globstar"){let H=c.braces>0&&(d.type==="comma"||d.type==="brace"),f=d.extglob===true||G.length&&(d.type==="pipe"||d.type==="paren");d.type!=="slash"&&d.type!=="paren"&&!H&&!f&&(c.output=c.output.slice(0,-a.output.length),a.type="star",a.value="*",a.output=$,c.output+=a.output);}if(G.length&&d.type!=="paren"&&(G[G.length-1].inner+=d.value),(d.value||d.output)&&Y(d),a&&a.type==="text"&&d.type==="text"){a.output=(a.output||a.value)+d.value,a.value+=d.value;return}d.prev=a,o.push(d),a=d;},ct=(d,H)=>{let f={...S[H],conditions:1,inner:""};f.prev=a,f.parens=c.parens,f.output=c.output,f.startIndex=c.index,f.tokensIndex=o.length;let C=(s.capture?"(":"")+f.open;at("parens"),v({type:d,value:H,output:c.output?"":E}),v({type:"paren",extglob:true,value:k(),output:C}),G.push(f);},Ce=d=>{let H=t.slice(d.startIndex,c.index+1),f=t.slice(d.startIndex+2,c.index),C=lr(f,s);if((d.type==="plus"||d.type==="star")&&C.risky){let T=C.safeOutput?(d.output?"":E)+(s.capture?`(${C.safeOutput})`:C.safeOutput):void 0,Q=o[d.tokensIndex];Q.type="text",Q.value=H,Q.output=T||U.escapeRegex(H);for(let j=d.tokensIndex+1;j<o.length;j++)o[j].value="",o[j].output="",delete o[j].suffix;c.output=d.output+Q.output,c.backtrack=true,v({type:"paren",extglob:true,value:u,output:""}),V("parens");return}let P=d.close+(s.capture?")":""),M;if(d.type==="negate"){let T=$;if(d.inner&&d.inner.length>1&&d.inner.includes("/")&&(T=I(s)),(T!==$||K()||/^\)+$/.test(z()))&&(P=d.close=`)$))${T}`),d.inner.includes("*")&&(M=z())&&/^\.[^\\/.]+$/.test(M)){let Q=Ct(M,{...e,fastpaths:false}).output;P=d.close=`)${Q})${T})`;}d.prev.type==="bos"&&(c.negatedExtglob=true);}v({type:"paren",extglob:true,value:u,output:P}),V("parens");};if(s.fastpaths!==false&&!/(^[*!]|[/()[\]{}"])/.test(t)){let d=false,H=t.replace(nr,(f,C,P,M,T,Q)=>M==="\\"?(d=true,f):M==="?"?C?C+M+(T?h.repeat(T.length):""):Q===0?A+(T?h.repeat(T.length):""):h.repeat(P.length):M==="."?x.repeat(P.length):M==="*"?C?C+M+(T?$:""):$:C?f:`\\${f}`);return d===true&&(s.unescape===true?H=H.replace(/\\/g,""):H=H.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),H===t&&s.contains===true?(c.output=t,c):(c.output=U.wrapOutput(H,c,e),c)}for(;!K();){if(u=k(),u==="\0")continue;if(u==="\\"){let f=O();if(f==="/"&&s.bash!==true||f==="."||f===";")continue;if(!f){u+="\\",v({type:"text",value:u});continue}let C=/^\\+/.exec(z()),P=0;if(C&&C[0].length>2&&(P=C[0].length,c.index+=P,P%2!==0&&(u+="\\")),s.unescape===true?u=k():u+=k(),c.brackets===0){v({type:"text",value:u});continue}}if(c.brackets>0&&(u!=="]"||a.value==="["||a.value==="[^")){if(s.posix!==false&&u===":"){let f=a.value.slice(1);if(f.includes("[")&&(a.posix=true,f.includes(":"))){let C=a.value.lastIndexOf("["),P=a.value.slice(0,C),M=a.value.slice(C+2),T=sr[M];if(T){a.value=P+T,c.backtrack=true,k(),!i.output&&o.indexOf(a)===1&&(i.output=E);continue}}}(u==="["&&O()!==":"||u==="-"&&O()==="]")&&(u=`\\${u}`),u==="]"&&(a.value==="["||a.value==="[^")&&(u=`\\${u}`),s.posix===true&&u==="!"&&a.value==="["&&(u="^"),a.value+=u,Y({value:u});continue}if(c.quotes===1&&u!=='"'){u=U.escapeRegex(u),a.value+=u,Y({value:u});continue}if(u==='"'){c.quotes=c.quotes===1?0:1,s.keepQuotes===true&&v({type:"text",value:u});continue}if(u==="("){at("parens"),v({type:"paren",value:u});continue}if(u===")"){if(c.parens===0&&s.strictBrackets===true)throw new SyntaxError(tt("opening","("));let f=G[G.length-1];if(f&&c.parens===f.parens+1){Ce(G.pop());continue}v({type:"paren",value:u,output:c.parens?")":"\\)"}),V("parens");continue}if(u==="["){if(s.nobracket===true||!z().includes("]")){if(s.nobracket!==true&&s.strictBrackets===true)throw new SyntaxError(tt("closing","]"));u=`\\${u}`;}else at("brackets");v({type:"bracket",value:u});continue}if(u==="]"){if(s.nobracket===true||a&&a.type==="bracket"&&a.value.length===1){v({type:"text",value:u,output:`\\${u}`});continue}if(c.brackets===0){if(s.strictBrackets===true)throw new SyntaxError(tt("opening","["));v({type:"text",value:u,output:`\\${u}`});continue}V("brackets");let f=a.value.slice(1);if(a.posix!==true&&f[0]==="^"&&!f.includes("/")&&(u=`/${u}`),a.value+=u,Y({value:u}),s.literalBrackets===false||U.hasRegexChars(f))continue;let C=U.escapeRegex(a.value);if(c.output=c.output.slice(0,-a.value.length),s.literalBrackets===true){c.output+=C,a.value=C;continue}a.value=`(${l}${C}|${a.value})`,c.output+=a.value;continue}if(u==="{"&&s.nobrace!==true){at("braces");let f={type:"brace",value:u,output:"(",outputIndex:c.output.length,tokensIndex:c.tokens.length};B.push(f),v(f);continue}if(u==="}"){let f=B[B.length-1];if(s.nobrace===true||!f){v({type:"text",value:u,output:u});continue}let C=")";if(f.dots===true){let P=o.slice(),M=[];for(let T=P.length-1;T>=0&&(o.pop(),P[T].type!=="brace");T--)P[T].type!=="dots"&&M.unshift(P[T].value);C=ir(M,s),c.backtrack=true;}if(f.comma!==true&&f.dots!==true){let P=c.output.slice(0,f.outputIndex),M=c.tokens.slice(f.tokensIndex);f.value=f.output="\\{",u=C="\\}",c.output=P;for(let T of M)c.output+=T.output||T.value;}v({type:"brace",value:u,output:C}),V("braces"),B.pop();continue}if(u==="|"){G.length>0&&G[G.length-1].conditions++,v({type:"text",value:u});continue}if(u===","){let f=u,C=B[B.length-1];C&&N[N.length-1]==="braces"&&(C.comma=true,f="|"),v({type:"comma",value:u,output:f});continue}if(u==="/"){if(a.type==="dot"&&c.index===c.start+1){c.start=c.index+1,c.consumed="",c.output="",o.pop(),a=i;continue}v({type:"slash",value:u,output:_});continue}if(u==="."){if(c.braces>0&&a.type==="dot"){a.value==="."&&(a.output=x);let f=B[B.length-1];a.type="dots",a.output+=u,a.value+=u,f.dots=true;continue}if(c.braces+c.parens===0&&a.type!=="bos"&&a.type!=="slash"){v({type:"text",value:u,output:x});continue}v({type:"dot",value:u,output:x});continue}if(u==="?"){if(!(a&&a.value==="(")&&s.noextglob!==true&&O()==="("&&O(2)!=="?"){ct("qmark",u);continue}if(a&&a.type==="paren"){let C=O(),P=u;(a.value==="("&&!/[!=<:]/.test(C)||C==="<"&&!/<([!=]|\w+>)/.test(z()))&&(P=`\\${u}`),v({type:"text",value:u,output:P});continue}if(s.dot!==true&&(a.type==="slash"||a.type==="bos")){v({type:"qmark",value:u,output:q});continue}v({type:"qmark",value:u,output:h});continue}if(u==="!"){if(s.noextglob!==true&&O()==="("&&(O(2)!=="?"||!/[!=<:]/.test(O(3)))){ct("negate",u);continue}if(s.nonegate!==true&&c.index===0){ve();continue}}if(u==="+"){if(s.noextglob!==true&&O()==="("&&O(2)!=="?"){ct("plus",u);continue}if(a&&a.value==="("||s.regex===false){v({type:"plus",value:u,output:y});continue}if(a&&(a.type==="bracket"||a.type==="paren"||a.type==="brace")||c.parens>0){v({type:"plus",value:u});continue}v({type:"plus",value:y});continue}if(u==="@"){if(s.noextglob!==true&&O()==="("&&O(2)!=="?"){v({type:"at",extglob:true,value:u,output:""});continue}v({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);let f=rr.exec(z());f&&(u+=f[0],c.index+=f[0].length),v({type:"text",value:u});continue}if(a&&(a.type==="globstar"||a.star===true)){a.type="star",a.star=true,a.value+=u,a.output=$,c.backtrack=true,c.globstar=true,X(u);continue}let d=z();if(s.noextglob!==true&&/^\([^?]/.test(d)){ct("star",u);continue}if(a.type==="star"){if(s.noglobstar===true){X(u);continue}let f=a.prev,C=f.prev,P=f.type==="slash"||f.type==="bos",M=C&&(C.type==="star"||C.type==="globstar");if(s.bash===true&&(!P||d[0]&&d[0]!=="/")){v({type:"star",value:u,output:""});continue}let T=c.braces>0&&(f.type==="comma"||f.type==="brace"),Q=G.length&&(f.type==="pipe"||f.type==="paren");if(!P&&f.type!=="paren"&&!T&&!Q){v({type:"star",value:u,output:""});continue}for(;d.slice(0,3)==="/**";){let j=t[c.index+4];if(j&&j!=="/")break;d=d.slice(3),X("/**",3);}if(f.type==="bos"&&K()){a.type="globstar",a.value+=u,a.output=I(s),c.output=a.output,c.globstar=true,X(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!M&&K()){c.output=c.output.slice(0,-(f.output+a.output).length),f.output=`(?:${f.output}`,a.type="globstar",a.output=I(s)+(s.strictSlashes?")":"|$)"),a.value+=u,c.globstar=true,c.output+=f.output+a.output,X(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&d[0]==="/"){let j=d[1]!==void 0?"|$":"";c.output=c.output.slice(0,-(f.output+a.output).length),f.output=`(?:${f.output}`,a.type="globstar",a.output=`${I(s)}${_}|${_}${j})`,a.value+=u,c.output+=f.output+a.output,c.globstar=true,X(u+k()),v({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&d[0]==="/"){a.type="globstar",a.value+=u,a.output=`(?:^|${_}|${I(s)}${_})`,c.output=a.output,c.globstar=true,X(u+k()),v({type:"slash",value:"/",output:""});continue}c.output=c.output.slice(0,-a.output.length),a.type="globstar",a.output=I(s),a.value+=u,c.output+=a.output,c.globstar=true,X(u);continue}let H={type:"star",value:u,output:$};if(s.bash===true){H.output=".*?",(a.type==="bos"||a.type==="slash")&&(H.output=L+H.output),v(H);continue}if(a&&(a.type==="bracket"||a.type==="paren")&&s.regex===true){H.output=u,v(H);continue}(c.index===c.start||a.type==="slash"||a.type==="dot")&&(a.type==="dot"?(c.output+=p,a.output+=p):s.dot===true?(c.output+=m,a.output+=m):(c.output+=L,a.output+=L),O()!=="*"&&(c.output+=E,a.output+=E)),v(H);}for(;c.brackets>0;){if(s.strictBrackets===true)throw new SyntaxError(tt("closing","]"));c.output=U.escapeLast(c.output,"["),V("brackets");}for(;c.parens>0;){if(s.strictBrackets===true)throw new SyntaxError(tt("closing",")"));c.output=U.escapeLast(c.output,"("),V("parens");}for(;c.braces>0;){if(s.strictBrackets===true)throw new SyntaxError(tt("closing","}"));c.output=U.escapeLast(c.output,"{"),V("braces");}if(s.strictSlashes!==true&&(a.type==="star"||a.type==="bracket")&&v({type:"maybe_slash",value:"",output:`${_}?`}),c.backtrack===true){c.output="";for(let d of c.tokens)c.output+=d.output!=null?d.output:d.value,d.suffix&&(c.output+=d.suffix);}return c};Ct.fastpaths=(t,e)=>{let s={...e},r=typeof s.maxLength=="number"?Math.min(ht,s.maxLength):ht,n=t.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);t=ie[t]||t;let{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:b,NO_DOT:S,NO_DOTS:x,NO_DOTS_SLASH:y,STAR:_,START_ANCHOR:E}=ot.globChars(s.windows),R=s.dot?x:S,g=s.dot?y:S,p=s.capture?"":"?:",m={negated:false,prefix:""},h=s.bash===true?".*?":_;s.capture&&(h=`(${h})`);let q=L=>L.noglobstar===true?h:`(${p}(?:(?!${E}${L.dot?b:i}).)*?)`,F=L=>{switch(L){case "*":return `${R}${l}${h}`;case ".*":return `${i}${l}${h}`;case "*.*":return `${R}${h}${i}${l}${h}`;case "*/*":return `${R}${h}${o}${l}${g}${h}`;case "**":return R+q(s);case "**/*":return `(?:${R}${q(s)}${o})?${g}${l}${h}`;case "**/*.*":return `(?:${R}${q(s)}${o})?${g}${h}${i}${l}${h}`;case "**/.*":return `(?:${R}${q(s)}${o})?${i}${l}${h}`;default:{let A=/^(.*?)\.(\w+)$/.exec(L);if(!A)return;let $=F(A[1]);return $?$+i+A[2]:void 0}}},w=U.removePrefix(t,m),I=F(w);return I&&s.strictSlashes!==true&&(I+=`${o}?`),I};ae.exports=Ct;});var fe=J((hn,pe)=>{var pr=ne(),$t=ce(),le=nt(),fr=rt(),hr=t=>t&&typeof t=="object"&&!Array.isArray(t),D=(t,e,s=false)=>{if(Array.isArray(t)){let x=t.map(_=>D(_,e,s));return _=>{for(let E of x){let R=E(_);if(R)return R}return false}}let r=hr(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},i=n.windows,o=r?D.compileRe(t,e):D.makeRe(t,e,false,true),l=o.state;delete o.state;let b=()=>false;if(n.ignore){let x={...e,ignore:null,onMatch:null,onResult:null};b=D(n.ignore,x,s);}let S=(x,y=false)=>{let{isMatch:_,match:E,output:R}=D.test(x,o,e,{glob:t,posix:i}),g={glob:t,state:l,regex:o,posix:i,input:x,output:R,match:E,isMatch:_};return typeof n.onResult=="function"&&n.onResult(g),_===false?(g.isMatch=false,y?g:false):b(x)?(typeof n.onIgnore=="function"&&n.onIgnore(g),g.isMatch=false,y?g:false):(typeof n.onMatch=="function"&&n.onMatch(g),y?g:true)};return s&&(S.state=l),S};D.test=(t,e,s,{glob:r,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:false,output:""};let i=s||{},o=i.format||(n?le.toPosixSlashes:null),l=t===r,b=l&&o?o(t):t;return l===false&&(b=o?o(t):t,l=b===r),(l===false||i.capture===true)&&(i.matchBase===true||i.basename===true?l=D.matchBase(t,e,s,n):l=e.exec(b)),{isMatch:!!l,match:l,output:b}};D.matchBase=(t,e,s)=>(e instanceof RegExp?e:D.makeRe(e,s)).test(le.basename(t));D.isMatch=(t,e,s)=>D(e,s)(t);D.parse=(t,e)=>Array.isArray(t)?t.map(s=>D.parse(s,e)):$t(t,{...e,fastpaths:false});D.scan=(t,e)=>pr(t,e);D.compileRe=(t,e,s=false,r=false)=>{if(s===true)return t.output;let n=e||{},i=n.contains?"":"^",o=n.contains?"":"$",l=`${i}(?:${t.output})${o}`;t&&t.negated===true&&(l=`^(?!${l}).*$`);let b=D.toRegex(l,e);return r===true&&(b.state=t),b};D.makeRe=(t,e={},s=false,r=false)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:false,fastpaths:true};return e.fastpaths!==false&&(t[0]==="."||t[0]==="*")&&(n.output=$t.fastpaths(t,e)),n.output||(n=$t(t,e)),D.compileRe(n,e,s,r)};D.toRegex=(t,e)=>{try{let s=e||{};return new RegExp(t,s.flags||(s.nocase?"i":""))}catch(s){if(e&&e.debug===true)throw s;return /$^/}};D.constants=fr;pe.exports=D;});var me=J((dn,ge)=>{var he=fe(),dr=nt();function de(t,e,s=false){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:dr.isWindows()}),he(t,e,s)}Object.assign(de,he);ge.exports=de;});var It=Ot(Ht());var kt=createRequire(import.meta.url);function Ge(t){let e=normalize(t);return e.length>1&&e[e.length-1]===sep&&(e=e.substring(0,e.length-1)),e}var We=/[\\/]/g;function Bt(t,e){return t.replace(We,e)}var Ue=/^[a-z]:[\\/]$/i;function Ke(t){return t==="/"||Ue.test(t)}function mt(t,e){let{resolvePaths:s,normalizePath:r,pathSeparator:n}=e,i=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(s&&(t=resolve(t)),(r||i)&&(t=Ge(t)),t===".")return "";let o=t[t.length-1]!==n;return Bt(o?t+n:t,n)}function Mt(t,e){return e+t}function Xe(t,e){return function(s,r){return r.startsWith(t)?r.slice(t.length)+s:Bt(relative(t,r),e.pathSeparator)+e.pathSeparator+s}}function Qe(t){return t}function je(t,e,s){return e+t+s}function ze(t,e){let{relativePaths:s,includeBasePath:r}=e;return s&&t?Xe(t,e):r?Mt:Qe}function Ye(t){return function(e,s){s.push(e.substring(t.length)||".");}}function Ve(t){return function(e,s,r){let n=e.substring(t.length)||".";r.every(i=>i(n,true))&&s.push(n);}}var Je=(t,e)=>{e.push(t||".");},Ze=(t,e,s)=>{let r=t||".";s.every(n=>n(r,true))&&e.push(r);},ts=()=>{};function es(t,e){let{includeDirs:s,filters:r,relativePaths:n}=e;return s?n?r&&r.length?Ve(t):Ye(t):r&&r.length?Ze:Je:ts}var ss=(t,e,s,r)=>{r.every(n=>n(t,false))&&s.files++;},rs=(t,e,s,r)=>{r.every(n=>n(t,false))&&e.push(t);},ns=(t,e,s,r)=>{s.files++;},is=(t,e)=>{e.push(t);},os=()=>{};function us(t){let{excludeFiles:e,filters:s,onlyCounts:r}=t;return e?os:s&&s.length?r?ss:rs:r?ns:is}var as=t=>t,cs=()=>[""].slice(0,0);function ls(t){return t.group?cs:as}var ps=(t,e,s)=>{t.push({directory:e,files:s,dir:e});},fs=()=>{};function hs(t){return t.group?ps:fs}var ds=function(t,e,s){let{queue:r,fs:n,options:{suppressErrors:i}}=e;r.enqueue(),n.realpath(t,(o,l)=>{if(o)return r.dequeue(i?null:o,e);n.stat(l,(b,S)=>{if(b)return r.dequeue(i?null:b,e);if(S.isDirectory()&&qt(t,l,e))return r.dequeue(null,e);s(S,l),r.dequeue(null,e);});});},gs=function(t,e,s){let{queue:r,fs:n,options:{suppressErrors:i}}=e;r.enqueue();try{let o=n.realpathSync(t),l=n.statSync(o);if(l.isDirectory()&&qt(t,o,e))return;s(l,o);}catch(o){if(!i)throw o}};function ms(t,e){return !t.resolveSymlinks||t.excludeSymlinks?null:e?gs:ds}function qt(t,e,s){if(s.options.useRealPaths)return bs(e,s);let r=dirname(t),n=1;for(;r!==s.root&&n<2;){let i=s.symlinks.get(r);!!i&&(i===e||i.startsWith(e)||e.startsWith(i))?n++:r=dirname(r);}return s.symlinks.set(t,e),n>1}function bs(t,e){return e.visited.includes(t+e.options.pathSeparator)}var ys=t=>t.counts,Rs=t=>t.groups,xs=t=>t.paths,As=t=>t.paths.slice(0,t.options.maxFiles),Ss=(t,e,s)=>(ft(e,s,t.counts,t.options.suppressErrors),null),_s=(t,e,s)=>(ft(e,s,t.paths,t.options.suppressErrors),null),Es=(t,e,s)=>(ft(e,s,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),vs=(t,e,s)=>(ft(e,s,t.groups,t.options.suppressErrors),null);function ft(t,e,s,r){e(t&&!r?t:null,s);}function Cs(t,e){let{onlyCounts:s,group:r,maxFiles:n}=t;return s?e?ys:Ss:r?e?Rs:vs:n?e?As:Es:e?xs:_s}var Ft={withFileTypes:true},$s=(t,e,s,r,n)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);let{fs:i}=t;t.visited.push(e),t.counts.directories++,i.readdir(e||".",Ft,(o,l=[])=>{n(l,s,r),t.queue.dequeue(t.options.suppressErrors?null:o,t);});},Ls=(t,e,s,r,n)=>{let{fs:i}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let o=[];try{o=i.readdirSync(e||".",Ft);}catch(l){if(!t.options.suppressErrors)throw l}n(o,s,r);};function Is(t){return t?Ls:$s}var ws=class{count=0;constructor(t){this.onQueueEmpty=t;}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0));}},Os=class{_files=0;_directories=0;set files(t){this._files=t;}get files(){return this._files}set directories(t){this._directories=t;}get directories(){return this._directories}get dirs(){return this._directories}},Ts=class{aborted=false;abort(){this.aborted=true;}},Gt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,s){this.isSynchronous=!s,this.callbackInvoker=Cs(e,this.isSynchronous),this.root=mt(t,e),this.state={root:Ke(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Os,options:e,queue:new ws((r,n)=>this.callbackInvoker(n,r,s)),symlinks:new Map,visited:[""].slice(0,0),controller:new Ts,fs:e.fs||Fe},this.joinPath=ze(this.root,e),this.pushDirectory=es(this.root,e),this.pushFile=us(e),this.getArray=ls(e),this.groupFiles=hs(e),this.resolveSymlink=ms(e,this.isSynchronous),this.walkDirectory=Is(this.isSynchronous);}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,s)=>{let{paths:r,options:{filters:n,resolveSymlinks:i,excludeSymlinks:o,exclude:l,maxFiles:b,signal:S,useRealPaths:x,pathSeparator:y},controller:_}=this.state;if(_.aborted||S&&S.aborted||b&&r.length>b)return;let E=this.getArray(this.state.paths);for(let R=0;R<t.length;++R){let g=t[R];if(g.isFile()||g.isSymbolicLink()&&!i&&!o){let p=this.joinPath(g.name,e);this.pushFile(p,E,this.state.counts,n);}else if(g.isDirectory()){let p=je(g.name,e,this.state.options.pathSeparator);if(l&&l(g.name,p))continue;this.pushDirectory(p,r,n),this.walkDirectory(this.state,p,p,s-1,this.walk);}else if(this.resolveSymlink&&g.isSymbolicLink()){let p=Mt(g.name,e);this.resolveSymlink(p,this.state,(m,h)=>{if(m.isDirectory()){if(h=mt(h,this.state.options),l&&l(g.name,x?h:p+y))return;this.walkDirectory(this.state,h,x?h:p+y,s-1,this.walk);}else {h=x?h:p;let q=basename(h),F=mt(dirname(h),this.state.options);h=this.joinPath(q,F),this.pushFile(h,E,this.state.counts,n);}});}}this.groupFiles(this.state.groups,e,E);}};function Ps(t,e){return new Promise((s,r)=>{Wt(t,e,(n,i)=>{if(n)return r(n);s(i);});})}function Wt(t,e,s){new Gt(t,e,s).start();}function Hs(t,e){return new Gt(t,e).start()}var Nt=class{constructor(t,e){this.root=t,this.options=e;}withPromise(){return Ps(this.root,this.options)}withCallback(t){Wt(this.root,this.options,t);}sync(){return Hs(this.root,this.options)}},Ut=null;try{kt.resolve("picomatch"),Ut=kt("picomatch");}catch{}var Kt=class{globCache={};options={maxDepth:1/0,suppressErrors:true,pathSeparator:sep,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction;}group(){return this.options.group=true,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=true,this}withRelativePaths(){return this.options.relativePaths=true,this}withDirs(){return this.options.includeDirs=true,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=true,this.options.includeBasePath=true,this}withErrors(){return this.options.suppressErrors=false,this}withSymlinks({resolvePaths:t=true}={}){return this.options.resolveSymlinks=true,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=true,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=true,this.options.includeDirs=true,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=true,this}crawl(t){return new Nt(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Nt(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:true})}globWithOptions(t,...e){let s=this.globFunction||Ut;if(!s)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=s(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(n=>r(n)),this}};var et=Ot(me(),1),Er=Array.isArray,xe=/\\/g,vr=/^[A-Za-z]:$/,Ae=process.platform==="win32",Cr=/^(\/?\.\.)+$/;function $r(t,e={}){let s=t.length,r=Array(s),n=Array(s),i,o;for(i=0;i<s;i++){let l=Se(t[i]);r[i]=l;let b=l.length,S=Array(b);for(o=0;o<b;o++)S[o]=(0, et.default)(l[o],e);n[i]=S;}return l=>{let b=l.split("/");if(b[0]===".."&&Cr.test(l))return true;for(i=0;i<s;i++){let S=r[i],x=n[i],y=b.length,_=Math.min(y,S.length);for(o=0;o<_;){let E=S[o];if(E.includes("/"))return true;if(!x[o](b[o]))break;if(!e.noglobstar&&E==="**")return true;o++;}if(o===y)return true}return false}}var Lr=/^[A-Z]:\/$/i,Ir=Ae?t=>Lr.test(t):t=>t==="/";function be(t,e,s){if(t===e||e.startsWith(`${t}/`)){if(s){let n=t.length+ +!Ir(t);return (i,o)=>i.slice(n,o?-1:void 0)||"."}let r=e.slice(t.length+1);return r?(n,i)=>{if(n===".")return r;let o=`${r}/${n}`;return i?o.slice(0,-1):o}:(n,i)=>i&&n!=="."?n.slice(0,-1):n}return s?r=>posix.relative(t,r)||".":r=>posix.relative(t,`${e}/${r}`)||"."}function wr(t,e){if(e.startsWith(`${t}/`)){let s=e.slice(t.length+1);return r=>`${s}/${r}`}return s=>{let r=posix.relative(t,`${e}/${s}`);return s[s.length-1]==="/"&&r!==""?`${r}/`:r||"."}}function ye(t){return t.replace(vr,e=>`${e}/`)}var Or={parts:true};function Se(t){var e;let s=et.default.scan(t,Or);return !((e=s.parts)===null||e===void 0)&&e.length?s.parts:[t]}var Tr=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Pr=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Hr=t=>t.replace(Tr,"\\$&"),kr=t=>t.replace(Pr,"\\$&"),Nr=Ae?kr:Hr;function Dr(t,e){let s=et.default.scan(t);return s.isGlob||s.negated}function ut(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t);}function _e(t){return typeof t=="string"?[t]:t??[]}var Br=/^(\/?\.\.)+/,Mr=/\\(?=[()[\]{}!*+?@|])/g;function Lt(t,e,s,r){var n;let i=e.cwd,o=t;t[t.length-1]==="/"&&(o=t.slice(0,-1)),o[o.length-1]!=="*"&&e.expandDirectories&&(o+="/**");let l=Nr(i);o=isAbsolute(o.replace(Mr,""))?posix.relative(l,o):posix.normalize(o);let b=(n=Br.exec(o))===null||n===void 0?void 0:n[0],S=Se(o);if(b){let y=(b.length+1)/3,_=0,E=l.split("/");for(;_<y&&S[_+y]===E[E.length+_-y];)o=o.slice(0,(y-_-1)*3)+o.slice((y-_)*3+S[_+y].length+1)||".",_++;let R=posix.join(i,b.slice(_*3));R[0]!=="."&&s.root.length>R.length&&(s.root=ye(R),s.depthOffset=-y+_);}if(!r&&s.depthOffset>=0){var x;(x=s.commonPath)!==null&&x!==void 0||(s.commonPath=S);let y=[],_=Math.min(s.commonPath.length,S.length);for(let E=0;E<_;E++){let R=S[E];if(R==="**"&&!S[E+1]){y.pop();break}if(E===S.length-1||R!==s.commonPath[E]||Dr(R))break;y.push(R);}s.depthOffset=y.length,s.commonPath=y,s.root=ye(y.length>0?posix.join(i,...y):i);}return o}function qr(t,e,s){let r=[],n=[];for(let i of t.ignore)i&&(i[0]!=="!"||i[1]==="(")&&n.push(Lt(i,t,s,true));for(let i of e)i&&(i[0]!=="!"||i[1]==="("?r.push(Lt(i,t,s,false)):(i[1]!=="!"||i[2]==="(")&&n.push(Lt(i.slice(1),t,s,true)));return {match:r,ignore:n}}function Fr(t,e){let s=t.cwd,r={root:s,depthOffset:0},n=qr(t,e,r);t.debug&&ut("internal processing patterns:",n);let{absolute:i,caseSensitiveMatch:o,debug:l,dot:b,followSymbolicLinks:S,onlyDirectories:x}=t,y=r.root.replace(xe,""),_={dot:b,nobrace:t.braceExpansion===false,nocase:!o,noextglob:t.extglob===false,noglobstar:t.globstar===false,posix:true},E=(0, et.default)(n.match,_),R=(0, et.default)(n.ignore,_),g=$r(n.match,_),p=be(s,y,i),m=i?p:be(s,y,true),h=(w,I)=>{let L=m(I,true);return L!=="."&&!g(L)||R(L)},q;t.deep!==void 0&&(q=Math.round(t.deep-r.depthOffset));let F=new Kt({filters:[l?(w,I)=>{let L=p(w,I),A=E(L)&&!R(L);return A&&ut(`matched ${L}`),A}:(w,I)=>{let L=p(w,I);return E(L)&&!R(L)}],exclude:l?(w,I)=>{let L=h(w,I);return ut(`${L?"skipped":"crawling"} ${I}`),L}:h,fs:t.fs,pathSeparator:"/",relativePaths:!i,resolvePaths:i,includeBasePath:i,resolveSymlinks:S,excludeSymlinks:!S,excludeFiles:x,includeDirs:x||!t.onlyFiles,maxDepth:q,signal:t.signal}).crawl(y);return t.debug&&ut("internal properties:",{...r,root:y}),[F,s!==y&&!i&&wr(s,y)]}function Gr(t,e){if(e)for(let s=t.length-1;s>=0;s--)t[s]=e(t[s]);return t}var Re={caseSensitiveMatch:true,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:true,followSymbolicLinks:true,onlyFiles:true};function Wr(t){let e=Object.assign({},t);for(let s in Re)e[s]===void 0&&Object.assign(e,{[s]:Re[s]});return e.cwd=(e.cwd instanceof URL?fileURLToPath(e.cwd):resolve(e.cwd||process.cwd())).replace(xe,"/"),e.ignore=_e(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||readdir,readdirSync:e.fs.readdirSync||readdirSync,realpath:e.fs.realpath||realpath,realpathSync:e.fs.realpathSync||realpathSync,stat:e.fs.stat||stat,statSync:e.fs.statSync||statSync}),e.debug&&ut("globbing with options:",e),e}function Ur(t,e={}){var s;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let r=Er(t)||typeof t=="string",n=_e((s=r?t:t.patterns)!==null&&s!==void 0?s:"**/*"),i=Wr(r?e:t);return n.length>0?Fr(i,n):[]}async function Ee(t,e){let[s,r]=Ur(t,e);return s?Gr(await s.withPromise(),r):[]}var dt=It.default.cyan("(nqtr)");function st(t){return t?Array.isArray(t)?t:[t]:[]}function Yr(t){return t?.find(e=>e.name==="vite-plugin-pixi-vn")}function _n(t){let e,s,r,n=new Promise(g=>{r=g;}),i=[...st(t?.activities),...st(t?.commitments),...st(t?.locations),...st(t?.maps),...st(t?.quests),...st(t?.rooms)],o=new Set,l={activityIds:[],commitmentIds:[],locationIds:[],mapIds:[],questIds:[],roomIds:[]};function b(){if(!t?.typeFilePath||!e)return null;let g=t.typeFilePath;return isAbsolute(g)?g:resolve(e.root,g)}function S(g,p){mkdirSync(dirname(g),{recursive:true});let m=["// @ts-nocheck","/* eslint-disable */","// noinspection JSUnusedGlobalSymbols","// This file is auto-generated by @drincs/nqtr vite plugin. Do not edit manually.","",`export const nqtrActivityIds = ${JSON.stringify(p.activityIds)} as const;`,`export const nqtrCommitmentIds = ${JSON.stringify(p.commitmentIds)} as const;`,`export const nqtrLocationIds = ${JSON.stringify(p.locationIds)} as const;`,`export const nqtrMapIds = ${JSON.stringify(p.mapIds)} as const;`,`export const nqtrQuestIds = ${JSON.stringify(p.questIds)} as const;`,`export const nqtrRoomIds = ${JSON.stringify(p.roomIds)} as const;`,""],h=[["nqtrActivityIdsEnum",p.activityIds],["nqtrCommitmentIdsEnum",p.commitmentIds],["nqtrLocationIdsEnum",p.locationIds],["nqtrMapIdsEnum",p.mapIds],["nqtrQuestIdsEnum",p.questIds],["nqtrRoomIdsEnum",p.roomIds]];for(let[F,w]of h){if(w.length===0){m.push(`export const ${F} = {} as const;`);continue}let I=w.map(L=>`${JSON.stringify(L)}: ${JSON.stringify(L)}`).join(", ");m.push(`export const ${F} = { ${I} } as const;`);}m.push(""),m.push('declare module "@drincs/nqtr/registries" {');let q=[["NqtrActivityIds",p.activityIds],["NqtrCommitmentIds",p.commitmentIds],["NqtrLocationIds",p.locationIds],["NqtrMapIds",p.mapIds],["NqtrQuestIds",p.questIds],["NqtrRoomIds",p.roomIds]];for(let[F,w]of q)if(w.length!==0){m.push(` interface ${F} {`);for(let I of w)m.push(` ${JSON.stringify(I)}: never;`);m.push(" }");}m.push("}"),m.push(""),writeFileSync(g,m.join(`
|
|
2
|
+
`),"utf-8");}function x(){let g=b();if(g)try{S(g,l);}catch(p){e?.logger.error(`${dt} Failed to write type file "${g}".`,{error:p instanceof Error?p:new Error(String(p)),timestamp:true});}}async function y(g){let p={};try{p=await g("@drincs/nqtr/registries");}catch{}l={activityIds:p.RegisteredActivities?.values().map(h=>h.id)??[],commitmentIds:p.RegisteredCommitments?.values().map(h=>h.id)??[],locationIds:p.RegisteredLocations?.values().map(h=>h.id)??[],mapIds:p.RegisteredMaps?.values().map(h=>h.id)??[],questIds:p.RegisteredQuests?.values().map(h=>h.id)??[],roomIds:p.RegisteredRooms?.values().map(h=>h.id)??[]};let m=l.activityIds.length+l.commitmentIds.length+l.locationIds.length+l.mapIds.length+l.questIds.length+l.roomIds.length;e?.logger.info(`${dt} ${It.default.dim(`${m} NQTR id(s) \u2014 activities: ${l.activityIds.length}, commitments: ${l.commitmentIds.length}, locations: ${l.locationIds.length}, maps: ${l.mapIds.length}, quests: ${l.questIds.length}, rooms: ${l.roomIds.length}`)}`,{timestamp:true});}async function _(g){try{let p=await g("@drincs/nqtr/registries");p.RegisteredActivities?.clear?.(),p.RegisteredCommitments?.clear?.(),p.RegisteredLocations?.clear?.(),p.RegisteredMaps?.clear?.(),p.RegisteredQuests?.clear?.(),p.RegisteredRooms?.clear?.();}catch{}}async function E(g,p){let m=await Ee(i,{cwd:p,absolute:true,onlyFiles:true});for(let h of m){o.add(h);try{await g(h);}catch{}}}async function R(g){for(let p of o)for(let m of g.moduleGraph.getModulesByFile(p)??[])g.moduleGraph.invalidateModule(m);await _(p=>g.ssrLoadModule(p)),await E(p=>g.ssrLoadModule(p),e.root),await y(p=>g.ssrLoadModule(p)),x();}return {name:"vite-plugin-nqtr",enforce:"post",api:{contentLoaded:n},config(g,p){if(p.command==="serve"&&i.length>0)return {ssr:{noExternal:["@drincs/nqtr","@drincs/pixi-vn"]}}},configResolved(g){e=g,s=Yr(g.plugins),i.length===0&&!s?.api?.contentLoaded&&r();},async buildStart(){if(e?.command!=="build")return;let g=s?.api?.contentLoaded;if(g&&await g,i.length>0){let{createServer:p}=await import('vite'),m=await p({root:e.root,configFile:false,server:{middlewareMode:true},appType:"custom",logLevel:"silent",optimizeDeps:{noDiscovery:true},ssr:{noExternal:["@drincs/nqtr","@drincs/pixi-vn"]}});try{await E(h=>m.ssrLoadModule(h),e.root),await y(h=>m.ssrLoadModule(h)),x(),r();}catch{r();}finally{await m.close();}}else if(g){try{let p=await import('@drincs/nqtr/registries');l={activityIds:p.RegisteredActivities?.values().map(m=>m.id)??[],commitmentIds:p.RegisteredCommitments?.values().map(m=>m.id)??[],locationIds:p.RegisteredLocations?.values().map(m=>m.id)??[],mapIds:p.RegisteredMaps?.values().map(m=>m.id)??[],questIds:p.RegisteredQuests?.values().map(m=>m.id)??[],roomIds:p.RegisteredRooms?.values().map(m=>m.id)??[]},x();}catch{}r();}else r();},configureServer(g){(async()=>{let m=s?.api?.contentLoaded;m&&await m,i.length>0&&await E(h=>g.ssrLoadModule(h),e.root),await y(h=>g.ssrLoadModule(h)),x(),r(),s?.api?.onReload?.(()=>{y(h=>g.ssrLoadModule(h)).then(()=>x()).catch(h=>{e?.logger.error(`${dt} Failed to regenerate types after pixi-vn reload.`,{error:h instanceof Error?h:new Error(String(h)),timestamp:true});});});})().catch(()=>r());},hotUpdate({file:g,server:p}){let m=b();if(m&&g===m)return [];if(i.length>0&&o.has(g))return R(p).catch(h=>{e?.logger.error(`${dt} Failed to reload NQTR content.`,{error:h instanceof Error?h:new Error(String(h)),timestamp:true});}),[]}}}export{_n as vitePluginNqtr};
|