@5minds/processcube_app_sdk 5.1.0-develop-d3b97b-ltsoxo35 → 5.1.0-develop-8e8375-lu2qhtor
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/build/server/index.cjs +1 -1
- package/build/server/index.mjs +2 -2
- package/package.json +1 -1
package/build/server/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var se=(e,t)=>{for(var s in t)N(e,s,{get:t[s],enumerable:!0})},re=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ee(t))!te.call(e,n)&&n!==s&&N(e,n,{get:()=>t[n],enumerable:!(r=Q(t,n))||r.enumerable});return e};var ne=e=>re(N({},"__esModule",{value:!0}),e);var Ue={};se(Ue,{finishUserTask:()=>Pe,finishUserTaskAndGetNext:()=>Ee,getActiveProcessInstances:()=>Te,getAssignedUserTasksByIdentity:()=>_e,getEngineClient:()=>fe,getIdentity:()=>Ie,getReservedUserTasksByIdentity:()=>Ce,getUserTasks:()=>H,getWaitingUserTaskByFlowNodeInstanceId:()=>Y,getWaitingUserTasks:()=>ge,getWaitingUserTasksByCorrelationId:()=>xe,getWaitingUserTasksByFlowNodeId:()=>we,getWaitingUserTasksByProcessInstanceId:()=>ye,navigateToUrl:()=>Ne,startProcess:()=>Re,waitForUserTask:()=>me,withApplicationSdk:()=>Se});module.exports=ne(Ue);var pt=require("only-server"),ft=require("../common/index.cjs");var E=require("node:fs"),a=require("node:path"),L=require("chokidar"),O=require("esbuild"),v=require("jwt-decode"),b=require("openid-client"),W=require("@5minds/processcube_engine_client"),B=require("@5minds/processcube_engine_sdk");var F=require("@5minds/processcube_engine_client"),R=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",i=new F.EngineClient(R);var oe={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},ie=.85,y=["external_task.ts","external_task.js"],c=new B.Logger("processcube_app_sdk:external_task_adapter"),U=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,f={};async function D(e){if(e&&!(0,E.existsSync)(e))throw new Error(`Invalid customExternalTasksDirPath. The given path '${e}' does not exist`);let t=pe(e);(0,L.watch)(t).on("add",async s=>{if(!y.includes((0,a.basename)(s)))return;await q(s,t);let r=(0,a.dirname)(s),n=(0,a.relative)(t,r),o=w(n);c.info(`Started external task ${f[s].workerId} for topic ${o}`)}).on("change",async s=>{if(!y.includes((0,a.basename)(s)))return;await ae(s,t);let r=(0,a.dirname)(s),n=(0,a.relative)(t,r),o=w(n);c.info(`Restarted external task ${f[s].workerId} for topic ${o}`)}).on("unlink",async s=>{if(!y.includes((0,a.basename)(s)))return;K(s);let r=(0,a.dirname)(s),n=(0,a.relative)(t,r),o=w(n);c.info(`Stopped external task ${f[s].workerId} for topic '${o}'`,{reason:`External Task for topic '${o}' was removed`,workerId:f[s].workerId,topic:o}),delete f[s]}).on("error",s=>c.info(`Watcher error: ${s}`))}async function q(e,t,s){let r=(0,a.dirname)(e);if(!ce(r)){c.error(`Could not find external task file in directory '${r}'`);return}let o=await le(e),u=await de(o,e);if(u.default===void 0){c.info(`External task file recognized at ${e}. Please export a default handler function. For more information see https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#external-tasks-entwickeln`);return}let T=await M(),g=$(T),p=(0,a.relative)(t,r),C=w(p),_=u.default,S={identity:g,...s,...u?.config},I=new W.ExternalTaskWorker(R,C,_,S);I.onWorkerError((m,A,J)=>{c.error(`Intercepted "${m}"-type error: ${A.message}`,{err:A,type:m,externalTask:J})}),I.start(),await P(T,I),f[e]=I}async function ae(e,t){let s=f[e]?.workerId;K(e),await q(e,t,{workerId:s})}function K(e){let t=f[e];t&&(t.stop(),t.dispose())}async function ce(e){let s=(await E.promises.readdir(e)).filter(r=>y.includes(r));if(s.length===0)return null;if(s.length>1)throw new Error(`Found more than one external task file in directory '${e}'`);return s[0]}async function M(){if(!U)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw c.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let e=await b.Issuer.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new e.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function $(e){if(!U||e===null)return oe;let t=e.access_token,s=(0,v.jwtDecode)(t);return{token:e.access_token,userId:s.sub}}async function P(e,t,s=5){try{if(!U||e===null||!t.pollingIsActive)return;let n=await ue(e)*ie*1e3;setTimeout(async()=>{if(!t.pollingIsActive)return;let o=await M(),u=$(o);t.identity=u,await P(o,t)},n)}catch(r){if(s===0)throw r;c.error(`Could not refresh identity for external task worker ${t.workerId}`,{err:r,workerId:t.workerId,retryCount:s});let n=2*1e3;setTimeout(async()=>await P(e,t,s-1),n)}}async function le(e){let t=await(0,O.build)({entryPoints:[e],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(t.errors.length>0)throw c.error(`Could not transpile file at '${e}'`,{errors:t.errors}),new Error(`Could not transpile file at '${e}'`);return t.warnings.length>0&&c.warn(`Transpiled file at '${e}' with warnings`,{warnings:t.warnings}),t.outputFiles[0].text}async function de(e,t){try{var s=module.constructor,r=new s;return r._compile(e,t),r.exports}catch(n){throw c.error("Could not require module from string",{err:n}),n}}async function ue(e){let t=e.expires_in;if(!t&&e.expires_at&&(t=Math.floor(e.expires_at-Date.now()/1e3)),t===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return t}function w(e){return e.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function pe(e){let t,s=[e,(0,a.join)(process.cwd(),"app"),(0,a.join)(process.cwd(),"src","app")];for(let r of s)if(r&&(0,E.existsSync)(r)){t=r;break}if(!t)throw new Error("Could not find external tasks directory");return t}function fe(){return i}var h=require("next-auth/jwt"),j=require("next/dist/compiled/@edge-runtime/cookies"),k=require("next/headers"),ke=process.env.NEXTAUTH_URL?.startsWith("https://"),X=`${ke?"__Secure-":""}next-auth.session-token`;async function Ie(){let e=await(0,h.getToken)({req:{cookies:(0,k.cookies)(),headers:(0,k.headers)()}});if(e?.expiresAt&&Date.now()>=e.expiresAt*1e3){let s=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:(0,k.cookies)().toString()}}),r=new j.ResponseCookies(s.headers),n=r.get(X);if(n){let o=!1;try{(0,k.cookies)().set(X,n.value,{...n})}catch{o=!0}if(e=await(0,h.getToken)({req:{cookies:o?r:(0,k.cookies)(),headers:(0,k.headers)()}}),e?.error)throw e.error}}if(!e?.accessToken||!e?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:e?.accessToken,userId:e?.sub}}var G=require("@5minds/processcube_engine_client");async function Te(e){return await i.processInstances.query({...e?.query,state:G.DataModels.ProcessInstances.ProcessInstanceState.running},e?.options)}var d=require("@5minds/processcube_engine_client"),l=require("../common/index.cjs");async function me(e={},t){let{correlationId:s,processInstanceId:r,flowNodeId:n}=e;return new Promise(async(o,u)=>{let T=await i.userTasks.onUserTaskWaiting(async p=>{let C=s!==void 0&&p.correlationId!==s,_=p.flowNodeInstanceId===void 0,S=r!==void 0&&p.processInstanceId!==r,I=n!==void 0&&p.flowNodeId!==n;if(C||_||S||I)return;let m=await Y(p.flowNodeInstanceId,{identity:t});return i.notification.removeSubscription(T,t),m===null?u(new Error(`UserTask with instance ID "${p.flowNodeInstanceId}" does not exist.`)):o(m)},{identity:t}),g=await H({correlationId:s,processInstanceId:r,flowNodeId:n,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t});g.userTasks.length>0&&(i.notification.removeSubscription(T,t),o(g.userTasks[0]))})}async function Ee(e,t={},s={},r){await i.userTasks.finishUserTask(e,s,r);let n={state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,...t},o=await i.userTasks.query(n,{identity:r});return(0,l.mapUserTask)(o.userTasks[0])}async function H(...e){let t=await i.userTasks.query(...e);return(0,l.mapUserTaskList)(t)}async function ge(e){let t=await i.userTasks.query({state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return(0,l.mapUserTaskList)(t)}async function ye(e,t){let s=await i.userTasks.query({processInstanceId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return(0,l.mapUserTaskList)(s)}async function we(e,t){let s=await i.userTasks.query({flowNodeId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return(0,l.mapUserTaskList)(s)}async function Y(e,t){let s=await i.userTasks.query({flowNodeInstanceId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{...t,limit:1});return s.userTasks.length===0?null:(0,l.mapUserTask)(s.userTasks[0])}async function xe(e,t){let s=await i.userTasks.query({correlationId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return(0,l.mapUserTaskList)(s)}async function Ce(e,t){let s=await i.userTasks.query({state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...t}),r=s.userTasks.filter(n=>n.actualOwnerId===e.userId);return s.userTasks=r,(0,l.mapUserTaskList)(s)}async function _e(e,t){let s=await i.userTasks.query({state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...t}),r=s.userTasks.filter(n=>n.assignedUserIds?.includes(e.userId));return s.userTasks=r,(0,l.mapUserTaskList)(s)}var x=require("next/dist/shared/lib/constants");var V=!1;function Se(e={}){let{applicationSdk:t,...s}=e;return async(r,n)=>{let o=r===x.PHASE_DEVELOPMENT_SERVER||r===x.PHASE_PRODUCTION_SERVER;return t?.useExternalTasks&&o&&!V&&(V=!0,await D(t?.customExternalTasksDirPath)),s}}var Z=require("next/cache"),z=require("next/navigation");function Ne(e){(0,Z.revalidatePath)(e),(0,z.redirect)(e)}async function Re(...e){return await i.processModels.startProcessInstance(...e)}async function Pe(...e){await i.userTasks.finishUserTask(...e)}0&&(module.exports={finishUserTask,finishUserTaskAndGetNext,getActiveProcessInstances,getAssignedUserTasksByIdentity,getEngineClient,getIdentity,getReservedUserTasksByIdentity,getUserTasks,getWaitingUserTaskByFlowNodeInstanceId,getWaitingUserTasks,getWaitingUserTasksByCorrelationId,getWaitingUserTasksByFlowNodeId,getWaitingUserTasksByProcessInstanceId,navigateToUrl,startProcess,waitForUserTask,withApplicationSdk});
|
|
1
|
+
var R=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var se=(e,t)=>{for(var s in t)R(e,s,{get:t[s],enumerable:!0})},re=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ee(t))!te.call(e,n)&&n!==s&&R(e,n,{get:()=>t[n],enumerable:!(r=Q(t,n))||r.enumerable});return e};var ne=e=>re(R({},"__esModule",{value:!0}),e);var Ue={};se(Ue,{finishUserTask:()=>Pe,finishUserTaskAndGetNext:()=>Ee,getActiveProcessInstances:()=>me,getAssignedUserTasksByIdentity:()=>_e,getEngineClient:()=>fe,getIdentity:()=>Ie,getReservedUserTasksByIdentity:()=>Ce,getUserTasks:()=>G,getWaitingUserTaskByFlowNodeInstanceId:()=>Y,getWaitingUserTasks:()=>ge,getWaitingUserTasksByCorrelationId:()=>xe,getWaitingUserTasksByFlowNodeId:()=>we,getWaitingUserTasksByProcessInstanceId:()=>ye,navigateToUrl:()=>Ne,startProcess:()=>Re,waitForUserTask:()=>Te,withApplicationSdk:()=>Se});module.exports=ne(Ue);var pt=require("only-server"),ft=require("../common/index.cjs");var E=require("node:fs"),a=require("node:path"),O=require("chokidar"),v=require("esbuild"),b=require("jwt-decode"),x=require("openid-client"),W=require("@5minds/processcube_engine_client"),B=require("@5minds/processcube_engine_sdk");var L=require("@5minds/processcube_engine_client"),P=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",i=new L.EngineClient(P);var oe={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},ie=.85,y=["external_task.ts","external_task.js"],c=new B.Logger("processcube_app_sdk:external_task_adapter"),h=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,f={};async function D(e){if(x.custom.setHttpOptionsDefaults({timeout:1e5}),e&&!(0,E.existsSync)(e))throw new Error(`Invalid customExternalTasksDirPath. The given path '${e}' does not exist`);let t=pe(e);(0,O.watch)(t).on("add",async s=>{if(!y.includes((0,a.basename)(s)))return;await q(s,t);let r=(0,a.dirname)(s),n=(0,a.relative)(t,r),o=w(n);c.info(`Started external task ${f[s].workerId} for topic ${o}`)}).on("change",async s=>{if(!y.includes((0,a.basename)(s)))return;await ae(s,t);let r=(0,a.dirname)(s),n=(0,a.relative)(t,r),o=w(n);c.info(`Restarted external task ${f[s].workerId} for topic ${o}`)}).on("unlink",async s=>{if(!y.includes((0,a.basename)(s)))return;K(s);let r=(0,a.dirname)(s),n=(0,a.relative)(t,r),o=w(n);c.info(`Stopped external task ${f[s].workerId} for topic '${o}'`,{reason:`External Task for topic '${o}' was removed`,workerId:f[s].workerId,topic:o}),delete f[s]}).on("error",s=>c.info(`Watcher error: ${s}`))}async function q(e,t,s){let r=(0,a.dirname)(e);if(!ce(r)){c.error(`Could not find external task file in directory '${r}'`);return}let o=await le(e),u=await de(o,e);if(u.default===void 0){c.info(`External task file recognized at ${e}. Please export a default handler function. For more information see https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#external-tasks-entwickeln`);return}let m=await M(),g=$(m),p=(0,a.relative)(t,r),_=w(p),S=u.default,N={identity:g,...s,...u?.config},I=new W.ExternalTaskWorker(P,_,S,N);I.onWorkerError((T,F,J)=>{c.error(`Intercepted "${T}"-type error: ${F.message}`,{err:F,type:T,externalTask:J})}),I.start(),await U(m,I),f[e]=I}async function ae(e,t){let s=f[e]?.workerId;K(e),await q(e,t,{workerId:s})}function K(e){let t=f[e];t&&(t.stop(),t.dispose())}async function ce(e){let s=(await E.promises.readdir(e)).filter(r=>y.includes(r));if(s.length===0)return null;if(s.length>1)throw new Error(`Found more than one external task file in directory '${e}'`);return s[0]}async function M(){if(!h)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw c.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let e=await x.Issuer.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new e.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function $(e){if(!h||e===null)return oe;let t=e.access_token,s=(0,b.jwtDecode)(t);return{token:e.access_token,userId:s.sub}}async function U(e,t,s=5){try{if(!h||e===null||!t.pollingIsActive)return;let n=await ue(e)*ie*1e3;setTimeout(async()=>{if(!t.pollingIsActive)return;let o=await M(),u=$(o);t.identity=u,await U(o,t)},n)}catch(r){if(s===0)throw r;c.error(`Could not refresh identity for external task worker ${t.workerId}`,{err:r,workerId:t.workerId,retryCount:s});let n=2*1e3;setTimeout(async()=>await U(e,t,s-1),n)}}async function le(e){let t=await(0,v.build)({entryPoints:[e],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(t.errors.length>0)throw c.error(`Could not transpile file at '${e}'`,{errors:t.errors}),new Error(`Could not transpile file at '${e}'`);return t.warnings.length>0&&c.warn(`Transpiled file at '${e}' with warnings`,{warnings:t.warnings}),t.outputFiles[0].text}async function de(e,t){try{var s=module.constructor,r=new s;return r._compile(e,t),r.exports}catch(n){throw c.error("Could not require module from string",{err:n}),n}}async function ue(e){let t=e.expires_in;if(!t&&e.expires_at&&(t=Math.floor(e.expires_at-Date.now()/1e3)),t===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return t}function w(e){return e.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function pe(e){let t,s=[e,(0,a.join)(process.cwd(),"app"),(0,a.join)(process.cwd(),"src","app")];for(let r of s)if(r&&(0,E.existsSync)(r)){t=r;break}if(!t)throw new Error("Could not find external tasks directory");return t}function fe(){return i}var A=require("next-auth/jwt"),j=require("next/dist/compiled/@edge-runtime/cookies"),k=require("next/headers"),ke=process.env.NEXTAUTH_URL?.startsWith("https://"),X=`${ke?"__Secure-":""}next-auth.session-token`;async function Ie(){let e=await(0,A.getToken)({req:{cookies:(0,k.cookies)(),headers:(0,k.headers)()}});if(e?.expiresAt&&Date.now()>=e.expiresAt*1e3){let s=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:(0,k.cookies)().toString()}}),r=new j.ResponseCookies(s.headers),n=r.get(X);if(n){let o=!1;try{(0,k.cookies)().set(X,n.value,{...n})}catch{o=!0}if(e=await(0,A.getToken)({req:{cookies:o?r:(0,k.cookies)(),headers:(0,k.headers)()}}),e?.error)throw e.error}}if(!e?.accessToken||!e?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:e?.accessToken,userId:e?.sub}}var H=require("@5minds/processcube_engine_client");async function me(e){return await i.processInstances.query({...e?.query,state:H.DataModels.ProcessInstances.ProcessInstanceState.running},e?.options)}var d=require("@5minds/processcube_engine_client"),l=require("../common/index.cjs");async function Te(e={},t){let{correlationId:s,processInstanceId:r,flowNodeId:n}=e;return new Promise(async(o,u)=>{let m=await i.userTasks.onUserTaskWaiting(async p=>{let _=s!==void 0&&p.correlationId!==s,S=p.flowNodeInstanceId===void 0,N=r!==void 0&&p.processInstanceId!==r,I=n!==void 0&&p.flowNodeId!==n;if(_||S||N||I)return;let T=await Y(p.flowNodeInstanceId,{identity:t});return i.notification.removeSubscription(m,t),T===null?u(new Error(`UserTask with instance ID "${p.flowNodeInstanceId}" does not exist.`)):o(T)},{identity:t}),g=await G({correlationId:s,processInstanceId:r,flowNodeId:n,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:t});g.userTasks.length>0&&(i.notification.removeSubscription(m,t),o(g.userTasks[0]))})}async function Ee(e,t={},s={},r){await i.userTasks.finishUserTask(e,s,r);let n={state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended,...t},o=await i.userTasks.query(n,{identity:r});return(0,l.mapUserTask)(o.userTasks[0])}async function G(...e){let t=await i.userTasks.query(...e);return(0,l.mapUserTaskList)(t)}async function ge(e){let t=await i.userTasks.query({state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return(0,l.mapUserTaskList)(t)}async function ye(e,t){let s=await i.userTasks.query({processInstanceId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return(0,l.mapUserTaskList)(s)}async function we(e,t){let s=await i.userTasks.query({flowNodeId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return(0,l.mapUserTaskList)(s)}async function Y(e,t){let s=await i.userTasks.query({flowNodeInstanceId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{...t,limit:1});return s.userTasks.length===0?null:(0,l.mapUserTask)(s.userTasks[0])}async function xe(e,t){let s=await i.userTasks.query({correlationId:e,state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},t);return(0,l.mapUserTaskList)(s)}async function Ce(e,t){let s=await i.userTasks.query({state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...t}),r=s.userTasks.filter(n=>n.actualOwnerId===e.userId);return s.userTasks=r,(0,l.mapUserTaskList)(s)}async function _e(e,t){let s=await i.userTasks.query({state:d.DataModels.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e,...t}),r=s.userTasks.filter(n=>n.assignedUserIds?.includes(e.userId));return s.userTasks=r,(0,l.mapUserTaskList)(s)}var C=require("next/dist/shared/lib/constants");var V=!1;function Se(e={}){let{applicationSdk:t,...s}=e;return async(r,n)=>{let o=r===C.PHASE_DEVELOPMENT_SERVER||r===C.PHASE_PRODUCTION_SERVER;return t?.useExternalTasks&&o&&!V&&(V=!0,await D(t?.customExternalTasksDirPath)),s}}var Z=require("next/cache"),z=require("next/navigation");function Ne(e){(0,Z.revalidatePath)(e),(0,z.redirect)(e)}async function Re(...e){return await i.processModels.startProcessInstance(...e)}async function Pe(...e){await i.userTasks.finishUserTask(...e)}0&&(module.exports={finishUserTask,finishUserTaskAndGetNext,getActiveProcessInstances,getAssignedUserTasksByIdentity,getEngineClient,getIdentity,getReservedUserTasksByIdentity,getUserTasks,getWaitingUserTaskByFlowNodeInstanceId,getWaitingUserTasks,getWaitingUserTasksByCorrelationId,getWaitingUserTasksByFlowNodeId,getWaitingUserTasksByProcessInstanceId,navigateToUrl,startProcess,waitForUserTask,withApplicationSdk});
|
package/build/server/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Sn=Object.create;var cs=Object.defineProperty;var Tn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var xn=Object.getPrototypeOf,bn=Object.prototype.hasOwnProperty;var L=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var v=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var In=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cn(e))!bn.call(s,n)&&n!==t&&cs(s,n,{get:()=>e[n],enumerable:!(r=Tn(e,n))||r.enumerable});return s};var vn=(s,e,t)=>(t=s!=null?Sn(xn(s)):{},In(e||!s||!s.__esModule?cs(t,"default",{value:s,enumerable:!0}):t,s));var Re=v((uc,hs)=>{"use strict";var kn=L("path"),ne="\\\\/",ls=`[^${ne}]`,ie="\\.",Nn="\\+",On="\\?",De="\\/",Pn="(?=.)",us="[^/]",at=`(?:${De}|$)`,fs=`(?:^|${De})`,ct=`${ie}{1,2}${at}`,Ln=`(?!${ie})`,Hn=`(?!${fs}${ct})`,Dn=`(?!${ie}{0,1}${at})`,Fn=`(?!${ct})`,$n=`[^.${De}]`,Un=`${us}*?`,ds={DOT_LITERAL:ie,PLUS_LITERAL:Nn,QMARK_LITERAL:On,SLASH_LITERAL:De,ONE_CHAR:Pn,QMARK:us,END_ANCHOR:at,DOTS_SLASH:ct,NO_DOT:Ln,NO_DOTS:Hn,NO_DOT_SLASH:Dn,NO_DOTS_SLASH:Fn,QMARK_NO_DOT:$n,STAR:Un,START_ANCHOR:fs},Mn={...ds,SLASH_LITERAL:`[${ne}]`,QMARK:ls,STAR:`${ls}*?`,DOTS_SLASH:`${ie}{1,2}(?:[${ne}]|$)`,NO_DOT:`(?!${ie})`,NO_DOTS:`(?!(?:^|[${ne}])${ie}{1,2}(?:[${ne}]|$))`,NO_DOT_SLASH:`(?!${ie}{0,1}(?:[${ne}]|$))`,NO_DOTS_SLASH:`(?!${ie}{1,2}(?:[${ne}]|$))`,QMARK_NO_DOT:`[^.${ne}]`,START_ANCHOR:`(?:^|[${ne}])`,END_ANCHOR:`(?:[${ne}]|$)`},Wn={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"};hs.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Wn,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:{"***":"*","**/**":"**","**/**/**":"**"},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,SEP:kn.sep,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?Mn:ds}}});var Fe=v(Y=>{"use strict";var Bn=L("path"),Gn=process.platform==="win32",{REGEX_BACKSLASH:qn,REGEX_REMOVE_BACKSLASH:Kn,REGEX_SPECIAL_CHARS:jn,REGEX_SPECIAL_CHARS_GLOBAL:Vn}=Re();Y.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s);Y.hasRegexChars=s=>jn.test(s);Y.isRegexChar=s=>s.length===1&&Y.hasRegexChars(s);Y.escapeRegex=s=>s.replace(Vn,"\\$1");Y.toPosixSlashes=s=>s.replace(qn,"/");Y.removeBackslashes=s=>s.replace(Kn,e=>e==="\\"?"":e);Y.supportsLookbehinds=()=>{let s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||s[0]===8&&s[1]>=10};Y.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:Gn===!0||Bn.sep==="\\";Y.escapeLast=(s,e,t)=>{let r=s.lastIndexOf(e,t);return r===-1?s:s[r-1]==="\\"?Y.escapeLast(s,e,r-1):`${s.slice(0,r)}\\${s.slice(r)}`};Y.removePrefix=(s,e={})=>{let t=s;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Y.wrapOutput=(s,e={},t={})=>{let r=t.contains?"":"^",n=t.contains?"":"$",o=`${r}(?:${s})${n}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var Rs=v((dc,ws)=>{"use strict";var ps=Fe(),{CHAR_ASTERISK:lt,CHAR_AT:Yn,CHAR_BACKWARD_SLASH:Ae,CHAR_COMMA:zn,CHAR_DOT:ut,CHAR_EXCLAMATION_MARK:ft,CHAR_FORWARD_SLASH:ys,CHAR_LEFT_CURLY_BRACE:dt,CHAR_LEFT_PARENTHESES:ht,CHAR_LEFT_SQUARE_BRACKET:Xn,CHAR_PLUS:Qn,CHAR_QUESTION_MARK:_s,CHAR_RIGHT_CURLY_BRACE:Zn,CHAR_RIGHT_PARENTHESES:Es,CHAR_RIGHT_SQUARE_BRACKET:Jn}=Re(),gs=s=>s===ys||s===Ae,ms=s=>{s.isPrefix!==!0&&(s.depth=s.isGlobstar?1/0:1)},ei=(s,e)=>{let t=e||{},r=s.length-1,n=t.parts===!0||t.scanToEnd===!0,o=[],i=[],a=[],c=s,u=-1,f=0,d=0,l=!1,m=!1,y=!1,w=!1,S=!1,x=!1,H=!1,F=!1,te=!1,q=!1,ce=0,K,A,I={value:"",depth:0,isGlob:!1},G=()=>u>=r,_=()=>c.charCodeAt(u+1),P=()=>(K=A,c.charCodeAt(++u));for(;u<r;){A=P();let j;if(A===Ae){H=I.backslashes=!0,A=P(),A===dt&&(x=!0);continue}if(x===!0||A===dt){for(ce++;G()!==!0&&(A=P());){if(A===Ae){H=I.backslashes=!0,P();continue}if(A===dt){ce++;continue}if(x!==!0&&A===ut&&(A=P())===ut){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(x!==!0&&A===zn){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===Zn&&(ce--,ce===0)){x=!1,l=I.isBrace=!0,q=!0;break}}if(n===!0)continue;break}if(A===ys){if(o.push(u),i.push(I),I={value:"",depth:0,isGlob:!1},q===!0)continue;if(K===ut&&u===f+1){f+=2;continue}d=u+1;continue}if(t.noext!==!0&&(A===Qn||A===Yn||A===lt||A===_s||A===ft)===!0&&_()===ht){if(y=I.isGlob=!0,w=I.isExtglob=!0,q=!0,A===ft&&u===f&&(te=!0),n===!0){for(;G()!==!0&&(A=P());){if(A===Ae){H=I.backslashes=!0,A=P();continue}if(A===Es){y=I.isGlob=!0,q=!0;break}}continue}break}if(A===lt){if(K===lt&&(S=I.isGlobstar=!0),y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===_s){if(y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===Xn){for(;G()!==!0&&(j=P());){if(j===Ae){H=I.backslashes=!0,P();continue}if(j===Jn){m=I.isBracket=!0,y=I.isGlob=!0,q=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&A===ft&&u===f){F=I.negated=!0,f++;continue}if(t.noparen!==!0&&A===ht){if(y=I.isGlob=!0,n===!0){for(;G()!==!0&&(A=P());){if(A===ht){H=I.backslashes=!0,A=P();continue}if(A===Es){q=!0;break}}continue}break}if(y===!0){if(q=!0,n===!0)continue;break}}t.noext===!0&&(w=!1,y=!1);let N=c,le="",h="";f>0&&(le=c.slice(0,f),c=c.slice(f),d-=f),N&&y===!0&&d>0?(N=c.slice(0,d),h=c.slice(d)):y===!0?(N="",h=c):N=c,N&&N!==""&&N!=="/"&&N!==c&&gs(N.charCodeAt(N.length-1))&&(N=N.slice(0,-1)),t.unescape===!0&&(h&&(h=ps.removeBackslashes(h)),N&&H===!0&&(N=ps.removeBackslashes(N)));let p={prefix:le,input:s,start:f,base:N,glob:h,isBrace:l,isBracket:m,isGlob:y,isExtglob:w,isGlobstar:S,negated:F,negatedExtglob:te};if(t.tokens===!0&&(p.maxDepth=0,gs(A)||i.push(I),p.tokens=i),t.parts===!0||t.tokens===!0){let j;for(let b=0;b<o.length;b++){let se=j?j+1:f,re=o[b],z=s.slice(se,re);t.tokens&&(b===0&&f!==0?(i[b].isPrefix=!0,i[b].value=le):i[b].value=z,ms(i[b]),p.maxDepth+=i[b].depth),(b!==0||z!=="")&&a.push(z),j=re}if(j&&j+1<s.length){let b=s.slice(j+1);a.push(b),t.tokens&&(i[i.length-1].value=b,ms(i[i.length-1]),p.maxDepth+=i[i.length-1].depth)}p.slashes=o,p.parts=a}return p};ws.exports=ei});var Ts=v((hc,Ss)=>{"use strict";var $e=Re(),X=Fe(),{MAX_LENGTH:Ue,POSIX_REGEX_SOURCE:ti,REGEX_NON_SPECIAL_CHARS:si,REGEX_SPECIAL_CHARS_BACKREF:ri,REPLACEMENTS:As}=$e,ni=(s,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...s,e);s.sort();let t=`[${s.join("-")}]`;try{new RegExp(t)}catch{return s.map(n=>X.escapeRegex(n)).join("..")}return t},Ee=(s,e)=>`Missing ${s}: "${e}" - use "\\\\${e}" to match literal characters`,pt=(s,e)=>{if(typeof s!="string")throw new TypeError("Expected a string");s=As[s]||s;let t={...e},r=typeof t.maxLength=="number"?Math.min(Ue,t.maxLength):Ue,n=s.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let o={type:"bos",value:"",output:t.prepend||""},i=[o],a=t.capture?"":"?:",c=X.isWindows(e),u=$e.globChars(c),f=$e.extglobChars(u),{DOT_LITERAL:d,PLUS_LITERAL:l,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:w,NO_DOT:S,NO_DOT_SLASH:x,NO_DOTS_SLASH:H,QMARK:F,QMARK_NO_DOT:te,STAR:q,START_ANCHOR:ce}=u,K=g=>`(${a}(?:(?!${ce}${g.dot?w:d}).)*?)`,A=t.dot?"":S,I=t.dot?F:te,G=t.bash===!0?K(t):q;t.capture&&(G=`(${G})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:s,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};s=X.removePrefix(s,_),n=s.length;let P=[],N=[],le=[],h=o,p,j=()=>_.index===n-1,b=_.peek=(g=1)=>s[_.index+g],se=_.advance=()=>s[++_.index]||"",re=()=>s.slice(_.index+1),z=(g="",O=0)=>{_.consumed+=g,_.index+=O},Oe=g=>{_.output+=g.output!=null?g.output:g.value,z(g.value)},Rn=()=>{let g=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)se(),_.start++,g++;return g%2===0?!1:(_.negated=!0,_.start++,!0)},Pe=g=>{_[g]++,le.push(g)},fe=g=>{_[g]--,le.pop()},C=g=>{if(h.type==="globstar"){let O=_.braces>0&&(g.type==="comma"||g.type==="brace"),E=g.extglob===!0||P.length&&(g.type==="pipe"||g.type==="paren");g.type!=="slash"&&g.type!=="paren"&&!O&&!E&&(_.output=_.output.slice(0,-h.output.length),h.type="star",h.value="*",h.output=G,_.output+=h.output)}if(P.length&&g.type!=="paren"&&(P[P.length-1].inner+=g.value),(g.value||g.output)&&Oe(g),h&&h.type==="text"&&g.type==="text"){h.value+=g.value,h.output=(h.output||"")+g.value;return}g.prev=h,i.push(g),h=g},Le=(g,O)=>{let E={...f[O],conditions:1,inner:""};E.prev=h,E.parens=_.parens,E.output=_.output;let T=(t.capture?"(":"")+E.open;Pe("parens"),C({type:g,value:O,output:_.output?"":y}),C({type:"paren",extglob:!0,value:se(),output:T}),P.push(E)},An=g=>{let O=g.close+(t.capture?")":""),E;if(g.type==="negate"){let T=G;if(g.inner&&g.inner.length>1&&g.inner.includes("/")&&(T=K(t)),(T!==G||j()||/^\)+$/.test(re()))&&(O=g.close=`)$))${T}`),g.inner.includes("*")&&(E=re())&&/^\.[^\\/.]+$/.test(E)){let D=pt(E,{...e,fastpaths:!1}).output;O=g.close=`)${D})${T})`}g.prev.type==="bos"&&(_.negatedExtglob=!0)}C({type:"paren",extglob:!0,value:p,output:O}),fe("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(s)){let g=!1,O=s.replace(ri,(E,T,D,V,M,ot)=>V==="\\"?(g=!0,E):V==="?"?T?T+V+(M?F.repeat(M.length):""):ot===0?I+(M?F.repeat(M.length):""):F.repeat(D.length):V==="."?d.repeat(D.length):V==="*"?T?T+V+(M?G:""):G:T?E:`\\${E}`);return g===!0&&(t.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,E=>E.length%2===0?"\\\\":E?"\\":"")),O===s&&t.contains===!0?(_.output=s,_):(_.output=X.wrapOutput(O,_,e),_)}for(;!j();){if(p=se(),p==="\0")continue;if(p==="\\"){let E=b();if(E==="/"&&t.bash!==!0||E==="."||E===";")continue;if(!E){p+="\\",C({type:"text",value:p});continue}let T=/^\\+/.exec(re()),D=0;if(T&&T[0].length>2&&(D=T[0].length,_.index+=D,D%2!==0&&(p+="\\")),t.unescape===!0?p=se():p+=se(),_.brackets===0){C({type:"text",value:p});continue}}if(_.brackets>0&&(p!=="]"||h.value==="["||h.value==="[^")){if(t.posix!==!1&&p===":"){let E=h.value.slice(1);if(E.includes("[")&&(h.posix=!0,E.includes(":"))){let T=h.value.lastIndexOf("["),D=h.value.slice(0,T),V=h.value.slice(T+2),M=ti[V];if(M){h.value=D+M,_.backtrack=!0,se(),!o.output&&i.indexOf(h)===1&&(o.output=y);continue}}}(p==="["&&b()!==":"||p==="-"&&b()==="]")&&(p=`\\${p}`),p==="]"&&(h.value==="["||h.value==="[^")&&(p=`\\${p}`),t.posix===!0&&p==="!"&&h.value==="["&&(p="^"),h.value+=p,Oe({value:p});continue}if(_.quotes===1&&p!=='"'){p=X.escapeRegex(p),h.value+=p,Oe({value:p});continue}if(p==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&C({type:"text",value:p});continue}if(p==="("){Pe("parens"),C({type:"paren",value:p});continue}if(p===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ee("opening","("));let E=P[P.length-1];if(E&&_.parens===E.parens+1){An(P.pop());continue}C({type:"paren",value:p,output:_.parens?")":"\\)"}),fe("parens");continue}if(p==="["){if(t.nobracket===!0||!re().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));p=`\\${p}`}else Pe("brackets");C({type:"bracket",value:p});continue}if(p==="]"){if(t.nobracket===!0||h&&h.type==="bracket"&&h.value.length===1){C({type:"text",value:p,output:`\\${p}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ee("opening","["));C({type:"text",value:p,output:`\\${p}`});continue}fe("brackets");let E=h.value.slice(1);if(h.posix!==!0&&E[0]==="^"&&!E.includes("/")&&(p=`/${p}`),h.value+=p,Oe({value:p}),t.literalBrackets===!1||X.hasRegexChars(E))continue;let T=X.escapeRegex(h.value);if(_.output=_.output.slice(0,-h.value.length),t.literalBrackets===!0){_.output+=T,h.value=T;continue}h.value=`(${a}${T}|${h.value})`,_.output+=h.value;continue}if(p==="{"&&t.nobrace!==!0){Pe("braces");let E={type:"brace",value:p,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};N.push(E),C(E);continue}if(p==="}"){let E=N[N.length-1];if(t.nobrace===!0||!E){C({type:"text",value:p,output:p});continue}let T=")";if(E.dots===!0){let D=i.slice(),V=[];for(let M=D.length-1;M>=0&&(i.pop(),D[M].type!=="brace");M--)D[M].type!=="dots"&&V.unshift(D[M].value);T=ni(V,t),_.backtrack=!0}if(E.comma!==!0&&E.dots!==!0){let D=_.output.slice(0,E.outputIndex),V=_.tokens.slice(E.tokensIndex);E.value=E.output="\\{",p=T="\\}",_.output=D;for(let M of V)_.output+=M.output||M.value}C({type:"brace",value:p,output:T}),fe("braces"),N.pop();continue}if(p==="|"){P.length>0&&P[P.length-1].conditions++,C({type:"text",value:p});continue}if(p===","){let E=p,T=N[N.length-1];T&&le[le.length-1]==="braces"&&(T.comma=!0,E="|"),C({type:"comma",value:p,output:E});continue}if(p==="/"){if(h.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",i.pop(),h=o;continue}C({type:"slash",value:p,output:m});continue}if(p==="."){if(_.braces>0&&h.type==="dot"){h.value==="."&&(h.output=d);let E=N[N.length-1];h.type="dots",h.output+=p,h.value+=p,E.dots=!0;continue}if(_.braces+_.parens===0&&h.type!=="bos"&&h.type!=="slash"){C({type:"text",value:p,output:d});continue}C({type:"dot",value:p,output:d});continue}if(p==="?"){if(!(h&&h.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){Le("qmark",p);continue}if(h&&h.type==="paren"){let T=b(),D=p;if(T==="<"&&!X.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(h.value==="("&&!/[!=<:]/.test(T)||T==="<"&&!/<([!=]|\w+>)/.test(re()))&&(D=`\\${p}`),C({type:"text",value:p,output:D});continue}if(t.dot!==!0&&(h.type==="slash"||h.type==="bos")){C({type:"qmark",value:p,output:te});continue}C({type:"qmark",value:p,output:F});continue}if(p==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){Le("negate",p);continue}if(t.nonegate!==!0&&_.index===0){Rn();continue}}if(p==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){Le("plus",p);continue}if(h&&h.value==="("||t.regex===!1){C({type:"plus",value:p,output:l});continue}if(h&&(h.type==="bracket"||h.type==="paren"||h.type==="brace")||_.parens>0){C({type:"plus",value:p});continue}C({type:"plus",value:l});continue}if(p==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){C({type:"at",extglob:!0,value:p,output:""});continue}C({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);let E=si.exec(re());E&&(p+=E[0],_.index+=E[0].length),C({type:"text",value:p});continue}if(h&&(h.type==="globstar"||h.star===!0)){h.type="star",h.star=!0,h.value+=p,h.output=G,_.backtrack=!0,_.globstar=!0,z(p);continue}let g=re();if(t.noextglob!==!0&&/^\([^?]/.test(g)){Le("star",p);continue}if(h.type==="star"){if(t.noglobstar===!0){z(p);continue}let E=h.prev,T=E.prev,D=E.type==="slash"||E.type==="bos",V=T&&(T.type==="star"||T.type==="globstar");if(t.bash===!0&&(!D||g[0]&&g[0]!=="/")){C({type:"star",value:p,output:""});continue}let M=_.braces>0&&(E.type==="comma"||E.type==="brace"),ot=P.length&&(E.type==="pipe"||E.type==="paren");if(!D&&E.type!=="paren"&&!M&&!ot){C({type:"star",value:p,output:""});continue}for(;g.slice(0,3)==="/**";){let He=s[_.index+4];if(He&&He!=="/")break;g=g.slice(3),z("/**",3)}if(E.type==="bos"&&j()){h.type="globstar",h.value+=p,h.output=K(t),_.output=h.output,_.globstar=!0,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&!V&&j()){_.output=_.output.slice(0,-(E.output+h.output).length),E.output=`(?:${E.output}`,h.type="globstar",h.output=K(t)+(t.strictSlashes?")":"|$)"),h.value+=p,_.globstar=!0,_.output+=E.output+h.output,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&g[0]==="/"){let He=g[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(E.output+h.output).length),E.output=`(?:${E.output}`,h.type="globstar",h.output=`${K(t)}${m}|${m}${He})`,h.value+=p,_.output+=E.output+h.output,_.globstar=!0,z(p+se()),C({type:"slash",value:"/",output:""});continue}if(E.type==="bos"&&g[0]==="/"){h.type="globstar",h.value+=p,h.output=`(?:^|${m}|${K(t)}${m})`,_.output=h.output,_.globstar=!0,z(p+se()),C({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-h.output.length),h.type="globstar",h.output=K(t),h.value+=p,_.output+=h.output,_.globstar=!0,z(p);continue}let O={type:"star",value:p,output:G};if(t.bash===!0){O.output=".*?",(h.type==="bos"||h.type==="slash")&&(O.output=A+O.output),C(O);continue}if(h&&(h.type==="bracket"||h.type==="paren")&&t.regex===!0){O.output=p,C(O);continue}(_.index===_.start||h.type==="slash"||h.type==="dot")&&(h.type==="dot"?(_.output+=x,h.output+=x):t.dot===!0?(_.output+=H,h.output+=H):(_.output+=A,h.output+=A),b()!=="*"&&(_.output+=y,h.output+=y)),C(O)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));_.output=X.escapeLast(_.output,"["),fe("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ee("closing",")"));_.output=X.escapeLast(_.output,"("),fe("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ee("closing","}"));_.output=X.escapeLast(_.output,"{"),fe("braces")}if(t.strictSlashes!==!0&&(h.type==="star"||h.type==="bracket")&&C({type:"maybe_slash",value:"",output:`${m}?`}),_.backtrack===!0){_.output="";for(let g of _.tokens)_.output+=g.output!=null?g.output:g.value,g.suffix&&(_.output+=g.suffix)}return _};pt.fastpaths=(s,e)=>{let t={...e},r=typeof t.maxLength=="number"?Math.min(Ue,t.maxLength):Ue,n=s.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);s=As[s]||s;let o=X.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:l,STAR:m,START_ANCHOR:y}=$e.globChars(o),w=t.dot?d:f,S=t.dot?l:f,x=t.capture?"":"?:",H={negated:!1,prefix:""},F=t.bash===!0?".*?":m;t.capture&&(F=`(${F})`);let te=A=>A.noglobstar===!0?F:`(${x}(?:(?!${y}${A.dot?u:i}).)*?)`,q=A=>{switch(A){case"*":return`${w}${c}${F}`;case".*":return`${i}${c}${F}`;case"*.*":return`${w}${F}${i}${c}${F}`;case"*/*":return`${w}${F}${a}${c}${S}${F}`;case"**":return w+te(t);case"**/*":return`(?:${w}${te(t)}${a})?${S}${c}${F}`;case"**/*.*":return`(?:${w}${te(t)}${a})?${S}${F}${i}${c}${F}`;case"**/.*":return`(?:${w}${te(t)}${a})?${i}${c}${F}`;default:{let I=/^(.*?)\.(\w+)$/.exec(A);if(!I)return;let G=q(I[1]);return G?G+i+I[2]:void 0}}},ce=X.removePrefix(s,H),K=q(ce);return K&&t.strictSlashes!==!0&&(K+=`${a}?`),K};Ss.exports=pt});var xs=v((pc,Cs)=>{"use strict";var ii=L("path"),oi=Rs(),_t=Ts(),Et=Fe(),ai=Re(),ci=s=>s&&typeof s=="object"&&!Array.isArray(s),U=(s,e,t=!1)=>{if(Array.isArray(s)){let f=s.map(l=>U(l,e,t));return l=>{for(let m of f){let y=m(l);if(y)return y}return!1}}let r=ci(s)&&s.tokens&&s.input;if(s===""||typeof s!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},o=Et.isWindows(e),i=r?U.compileRe(s,e):U.makeRe(s,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(n.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=U(n.ignore,f,t)}let u=(f,d=!1)=>{let{isMatch:l,match:m,output:y}=U.test(f,i,e,{glob:s,posix:o}),w={glob:s,state:a,regex:i,posix:o,input:f,output:y,match:m,isMatch:l};return typeof n.onResult=="function"&&n.onResult(w),l===!1?(w.isMatch=!1,d?w:!1):c(f)?(typeof n.onIgnore=="function"&&n.onIgnore(w),w.isMatch=!1,d?w:!1):(typeof n.onMatch=="function"&&n.onMatch(w),d?w:!0)};return t&&(u.state=a),u};U.test=(s,e,t,{glob:r,posix:n}={})=>{if(typeof s!="string")throw new TypeError("Expected input to be a string");if(s==="")return{isMatch:!1,output:""};let o=t||{},i=o.format||(n?Et.toPosixSlashes:null),a=s===r,c=a&&i?i(s):s;return a===!1&&(c=i?i(s):s,a=c===r),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=U.matchBase(s,e,t,n):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};U.matchBase=(s,e,t,r=Et.isWindows(t))=>(e instanceof RegExp?e:U.makeRe(e,t)).test(ii.basename(s));U.isMatch=(s,e,t)=>U(e,t)(s);U.parse=(s,e)=>Array.isArray(s)?s.map(t=>U.parse(t,e)):_t(s,{...e,fastpaths:!1});U.scan=(s,e)=>oi(s,e);U.compileRe=(s,e,t=!1,r=!1)=>{if(t===!0)return s.output;let n=e||{},o=n.contains?"":"^",i=n.contains?"":"$",a=`${o}(?:${s.output})${i}`;s&&s.negated===!0&&(a=`^(?!${a}).*$`);let c=U.toRegex(a,e);return r===!0&&(c.state=s),c};U.makeRe=(s,e={},t=!1,r=!1)=>{if(!s||typeof s!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(s[0]==="."||s[0]==="*")&&(n.output=_t.fastpaths(s,e)),n.output||(n=_t(s,e)),U.compileRe(n,e,t,r)};U.toRegex=(s,e)=>{try{let t=e||{};return new RegExp(s,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};U.constants=ai;Cs.exports=U});var gt=v((_c,bs)=>{"use strict";bs.exports=xs()});var Hs=v((Ec,Ls)=>{"use strict";var Te=L("fs"),{Readable:li}=L("stream"),Se=L("path"),{promisify:Ge}=L("util"),mt=gt(),ui=Ge(Te.readdir),fi=Ge(Te.stat),Is=Ge(Te.lstat),di=Ge(Te.realpath),hi="!",Os="READDIRP_RECURSIVE_ERROR",pi=new Set(["ENOENT","EPERM","EACCES","ELOOP",Os]),yt="files",Ps="directories",We="files_directories",Me="all",vs=[yt,Ps,We,Me],_i=s=>pi.has(s.code),[ks,Ei]=process.versions.node.split(".").slice(0,2).map(s=>Number.parseInt(s,10)),gi=process.platform==="win32"&&(ks>10||ks===10&&Ei>=5),Ns=s=>{if(s!==void 0){if(typeof s=="function")return s;if(typeof s=="string"){let e=mt(s.trim());return t=>e(t.basename)}if(Array.isArray(s)){let e=[],t=[];for(let r of s){let n=r.trim();n.charAt(0)===hi?t.push(mt(n.slice(1))):e.push(mt(n))}return t.length>0?e.length>0?r=>e.some(n=>n(r.basename))&&!t.some(n=>n(r.basename)):r=>!t.some(n=>n(r.basename)):r=>e.some(n=>n(r.basename))}}},Be=class s extends li{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:yt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...s.defaultOptions,...e},{root:r,type:n}=t;this._fileFilter=Ns(t.fileFilter),this._directoryFilter=Ns(t.directoryFilter);let o=t.lstat?Is:fi;gi?this._stat=i=>o(i,{bigint:!0}):this._stat=o,this._maxDepth=t.depth,this._wantsDir=[Ps,We,Me].includes(n),this._wantsFile=[yt,We,Me].includes(n),this._wantsEverything=n===Me,this._root=Se.resolve(r),this._isDirent="Dirent"in Te&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:t,depth:r,files:n=[]}=this.parent||{};if(n.length>0){let o=n.splice(0,e).map(i=>this._formatEntry(i,t));for(let i of await Promise.all(o)){if(this.destroyed)return;let a=await this._getEntryType(i);a==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(a==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let r;try{r=await ui(e,this._rdOptions)}catch(n){this._onError(n)}return{files:r,depth:t,path:e}}async _formatEntry(e,t){let r;try{let n=this._isDirent?e.name:e,o=Se.resolve(Se.join(t,n));r={path:Se.relative(this._root,o),fullPath:o,basename:n},r[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(n){this._onError(n)}return r}_onError(e){_i(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let r=e.fullPath;try{let n=await di(r),o=await Is(n);if(o.isFile())return"file";if(o.isDirectory()){let i=n.length;if(r.startsWith(n)&&r.substr(i,1)===Se.sep){let a=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return a.code=Os,this._onError(a)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},ge=(s,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=We),t&&(e.type=t),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!vs.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${vs.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=s,new Be(e)},mi=(s,e={})=>new Promise((t,r)=>{let n=[];ge(s,e).on("data",o=>n.push(o)).on("end",()=>t(n)).on("error",o=>r(o))});ge.promise=mi;ge.ReaddirpStream=Be;ge.default=ge;Ls.exports=ge});var wt=v((gc,Ds)=>{Ds.exports=function(s,e){if(typeof s!="string")throw new TypeError("expected path to be a string");if(s==="\\"||s==="/")return"/";var t=s.length;if(t<=1)return s;var r="";if(t>4&&s[3]==="\\"){var n=s[2];(n==="?"||n===".")&&s.slice(0,2)==="\\\\"&&(s=s.slice(2),r="//")}var o=s.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),r+o.join("/")}});var Bs=v((Ms,Ws)=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var Us=gt(),yi=wt(),Fs="!",wi={returnIndex:!1},Ri=s=>Array.isArray(s)?s:[s],Ai=(s,e)=>{if(typeof s=="function")return s;if(typeof s=="string"){let t=Us(s,e);return r=>s===r||t(r)}return s instanceof RegExp?t=>s.test(t):t=>!1},$s=(s,e,t,r)=>{let n=Array.isArray(t),o=n?t[0]:t;if(!n&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let i=yi(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(i))return r?-1:!1}let a=n&&[i].concat(t.slice(1));for(let c=0;c<s.length;c++){let u=s[c];if(n?u(...a):u(i))return r?c:!0}return r?-1:!1},Rt=(s,e,t=wi)=>{if(s==null)throw new TypeError("anymatch: specify first argument");let r=typeof t=="boolean"?{returnIndex:t}:t,n=r.returnIndex||!1,o=Ri(s),i=o.filter(c=>typeof c=="string"&&c.charAt(0)===Fs).map(c=>c.slice(1)).map(c=>Us(c,r)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==Fs).map(c=>Ai(c,r));return e==null?(c,u=!1)=>$s(a,i,c,typeof u=="boolean"?u:!1):$s(a,i,e,n)};Rt.default=Rt;Ws.exports=Rt});var qs=v((mc,Gs)=>{Gs.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var At=v((yc,js)=>{var Si=qs(),Ks={"{":"}","(":")","[":"]"},Ti=function(s){if(s[0]==="!")return!0;for(var e=0,t=-2,r=-2,n=-2,o=-2,i=-2;e<s.length;){if(s[e]==="*"||s[e+1]==="?"&&/[\].+)]/.test(s[e])||r!==-1&&s[e]==="["&&s[e+1]!=="]"&&(r<e&&(r=s.indexOf("]",e)),r>e&&(i===-1||i>r||(i=s.indexOf("\\",e),i===-1||i>r)))||n!==-1&&s[e]==="{"&&s[e+1]!=="}"&&(n=s.indexOf("}",e),n>e&&(i=s.indexOf("\\",e),i===-1||i>n))||o!==-1&&s[e]==="("&&s[e+1]==="?"&&/[:!=]/.test(s[e+2])&&s[e+3]!==")"&&(o=s.indexOf(")",e),o>e&&(i=s.indexOf("\\",e),i===-1||i>o))||t!==-1&&s[e]==="("&&s[e+1]!=="|"&&(t<e&&(t=s.indexOf("|",e)),t!==-1&&s[t+1]!==")"&&(o=s.indexOf(")",t),o>t&&(i=s.indexOf("\\",t),i===-1||i>o))))return!0;if(s[e]==="\\"){var a=s[e+1];e+=2;var c=Ks[a];if(c){var u=s.indexOf(c,e);u!==-1&&(e=u+1)}if(s[e]==="!")return!0}else e++}return!1},Ci=function(s){if(s[0]==="!")return!0;for(var e=0;e<s.length;){if(/[*?{}()[\]]/.test(s[e]))return!0;if(s[e]==="\\"){var t=s[e+1];e+=2;var r=Ks[t];if(r){var n=s.indexOf(r,e);n!==-1&&(e=n+1)}if(s[e]==="!")return!0}else e++}return!1};js.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(Si(e))return!0;var r=Ti;return t&&t.strict===!1&&(r=Ci),r(e)}});var Ys=v((wc,Vs)=>{"use strict";var xi=At(),bi=L("path").posix.dirname,Ii=L("os").platform()==="win32",St="/",vi=/\\/g,ki=/[\{\[].*[\}\]]$/,Ni=/(^|[^\\])([\{\[]|\([^\)]+$)/,Oi=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Vs.exports=function(e,t){var r=Object.assign({flipBackslashes:!0},t);r.flipBackslashes&&Ii&&e.indexOf(St)<0&&(e=e.replace(vi,St)),ki.test(e)&&(e+=St),e+="a";do e=bi(e);while(xi(e)||Ni.test(e));return e.replace(Oi,"$1")}});var qe=v(Z=>{"use strict";Z.isInteger=s=>typeof s=="number"?Number.isInteger(s):typeof s=="string"&&s.trim()!==""?Number.isInteger(Number(s)):!1;Z.find=(s,e)=>s.nodes.find(t=>t.type===e);Z.exceedsLimit=(s,e,t=1,r)=>r===!1||!Z.isInteger(s)||!Z.isInteger(e)?!1:(Number(e)-Number(s))/Number(t)>=r;Z.escapeNode=(s,e=0,t)=>{let r=s.nodes[e];r&&(t&&r.type===t||r.type==="open"||r.type==="close")&&r.escaped!==!0&&(r.value="\\"+r.value,r.escaped=!0)};Z.encloseBrace=s=>s.type!=="brace"||s.commas>>0+s.ranges>>0?!1:(s.invalid=!0,!0);Z.isInvalidBrace=s=>s.type!=="brace"?!1:s.invalid===!0||s.dollar?!0:!(s.commas>>0+s.ranges>>0)||s.open!==!0||s.close!==!0?(s.invalid=!0,!0):!1;Z.isOpenOrClose=s=>s.type==="open"||s.type==="close"?!0:s.open===!0||s.close===!0;Z.reduce=s=>s.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);Z.flatten=(...s)=>{let e=[],t=r=>{for(let n=0;n<r.length;n++){let o=r[n];Array.isArray(o)?t(o,e):o!==void 0&&e.push(o)}return e};return t(s),e}});var Ke=v((Ac,Xs)=>{"use strict";var zs=qe();Xs.exports=(s,e={})=>{let t=(r,n={})=>{let o=e.escapeInvalid&&zs.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a="";if(r.value)return(o||i)&&zs.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let c of r.nodes)a+=t(c);return a};return t(s)}});var Zs=v((Sc,Qs)=>{"use strict";Qs.exports=function(s){return typeof s=="number"?s-s===0:typeof s=="string"&&s.trim()!==""?Number.isFinite?Number.isFinite(+s):isFinite(+s):!1}});var ar=v((Tc,or)=>{"use strict";var Js=Zs(),de=(s,e,t)=>{if(Js(s)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||s===e)return String(s);if(Js(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...t};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let n=String(r.relaxZeros),o=String(r.shorthand),i=String(r.capture),a=String(r.wrap),c=s+":"+e+"="+n+o+i+a;if(de.cache.hasOwnProperty(c))return de.cache[c].result;let u=Math.min(s,e),f=Math.max(s,e);if(Math.abs(u-f)===1){let w=s+"|"+e;return r.capture?`(${w})`:r.wrap===!1?w:`(?:${w})`}let d=ir(s)||ir(e),l={min:s,max:e,a:u,b:f},m=[],y=[];if(d&&(l.isPadded=d,l.maxLen=String(l.max).length),u<0){let w=f<0?Math.abs(f):1;y=er(w,Math.abs(u),l,r),u=l.a=0}return f>=0&&(m=er(u,f,l,r)),l.negatives=y,l.positives=m,l.result=Pi(y,m,r),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&m.length+y.length>1&&(l.result=`(?:${l.result})`),de.cache[c]=l,l.result};function Pi(s,e,t){let r=Tt(s,e,"-",!1,t)||[],n=Tt(e,s,"",!1,t)||[],o=Tt(s,e,"-?",!0,t)||[];return r.concat(o).concat(n).join("|")}function Li(s,e){let t=1,r=1,n=sr(s,t),o=new Set([e]);for(;s<=n&&n<=e;)o.add(n),t+=1,n=sr(s,t);for(n=rr(e+1,r)-1;s<n&&n<=e;)o.add(n),r+=1,n=rr(e+1,r)-1;return o=[...o],o.sort(Fi),o}function Hi(s,e,t){if(s===e)return{pattern:s,count:[],digits:0};let r=Di(s,e),n=r.length,o="",i=0;for(let a=0;a<n;a++){let[c,u]=r[a];c===u?o+=c:c!=="0"||u!=="9"?o+=$i(c,u,t):i++}return i&&(o+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[i],digits:n}}function er(s,e,t,r){let n=Li(s,e),o=[],i=s,a;for(let c=0;c<n.length;c++){let u=n[c],f=Hi(String(i),String(u),r),d="";if(!t.isPadded&&a&&a.pattern===f.pattern){a.count.length>1&&a.count.pop(),a.count.push(f.count[0]),a.string=a.pattern+nr(a.count),i=u+1;continue}t.isPadded&&(d=Ui(u,t,r)),f.string=d+f.pattern+nr(f.count),o.push(f),i=u+1,a=f}return o}function Tt(s,e,t,r,n){let o=[];for(let i of s){let{string:a}=i;!r&&!tr(e,"string",a)&&o.push(t+a),r&&tr(e,"string",a)&&o.push(t+a)}return o}function Di(s,e){let t=[];for(let r=0;r<s.length;r++)t.push([s[r],e[r]]);return t}function Fi(s,e){return s>e?1:e>s?-1:0}function tr(s,e,t){return s.some(r=>r[e]===t)}function sr(s,e){return Number(String(s).slice(0,-e)+"9".repeat(e))}function rr(s,e){return s-s%Math.pow(10,e)}function nr(s){let[e=0,t=""]=s;return t||e>1?`{${e+(t?","+t:"")}}`:""}function $i(s,e,t){return`[${s}${e-s===1?"":"-"}${e}]`}function ir(s){return/^-?(0+)\d/.test(s)}function Ui(s,e,t){if(!e.isPadded)return s;let r=Math.abs(e.maxLen-String(s).length),n=t.relaxZeros!==!1;switch(r){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${r}}`:`0{${r}}`}}de.cache={};de.clearCache=()=>de.cache={};or.exports=de});var bt=v((Cc,_r)=>{"use strict";var Mi=L("util"),ur=ar(),cr=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),Wi=s=>e=>s===!0?Number(e):String(e),Ct=s=>typeof s=="number"||typeof s=="string"&&s!=="",Ce=s=>Number.isInteger(+s),xt=s=>{let e=`${s}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},Bi=(s,e,t)=>typeof s=="string"||typeof e=="string"?!0:t.stringify===!0,Gi=(s,e,t)=>{if(e>0){let r=s[0]==="-"?"-":"";r&&(s=s.slice(1)),s=r+s.padStart(r?e-1:e,"0")}return t===!1?String(s):s},lr=(s,e)=>{let t=s[0]==="-"?"-":"";for(t&&(s=s.slice(1),e--);s.length<e;)s="0"+s;return t?"-"+s:s},qi=(s,e)=>{s.negatives.sort((i,a)=>i<a?-1:i>a?1:0),s.positives.sort((i,a)=>i<a?-1:i>a?1:0);let t=e.capture?"":"?:",r="",n="",o;return s.positives.length&&(r=s.positives.join("|")),s.negatives.length&&(n=`-(${t}${s.negatives.join("|")})`),r&&n?o=`${r}|${n}`:o=r||n,e.wrap?`(${t}${o})`:o},fr=(s,e,t,r)=>{if(t)return ur(s,e,{wrap:!1,...r});let n=String.fromCharCode(s);if(s===e)return n;let o=String.fromCharCode(e);return`[${n}-${o}]`},dr=(s,e,t)=>{if(Array.isArray(s)){let r=t.wrap===!0,n=t.capture?"":"?:";return r?`(${n}${s.join("|")})`:s.join("|")}return ur(s,e,t)},hr=(...s)=>new RangeError("Invalid range arguments: "+Mi.inspect(...s)),pr=(s,e,t)=>{if(t.strictRanges===!0)throw hr([s,e]);return[]},Ki=(s,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${s}" to be a number`);return[]},ji=(s,e,t=1,r={})=>{let n=Number(s),o=Number(e);if(!Number.isInteger(n)||!Number.isInteger(o)){if(r.strictRanges===!0)throw hr([s,e]);return[]}n===0&&(n=0),o===0&&(o=0);let i=n>o,a=String(s),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let f=xt(a)||xt(c)||xt(u),d=f?Math.max(a.length,c.length,u.length):0,l=f===!1&&Bi(s,e,r)===!1,m=r.transform||Wi(l);if(r.toRegex&&t===1)return fr(lr(s,d),lr(e,d),!0,r);let y={negatives:[],positives:[]},w=H=>y[H<0?"negatives":"positives"].push(Math.abs(H)),S=[],x=0;for(;i?n>=o:n<=o;)r.toRegex===!0&&t>1?w(n):S.push(Gi(m(n,x),d,l)),n=i?n-t:n+t,x++;return r.toRegex===!0?t>1?qi(y,r):dr(S,null,{wrap:!1,...r}):S},Vi=(s,e,t=1,r={})=>{if(!Ce(s)&&s.length>1||!Ce(e)&&e.length>1)return pr(s,e,r);let n=r.transform||(l=>String.fromCharCode(l)),o=`${s}`.charCodeAt(0),i=`${e}`.charCodeAt(0),a=o>i,c=Math.min(o,i),u=Math.max(o,i);if(r.toRegex&&t===1)return fr(c,u,!1,r);let f=[],d=0;for(;a?o>=i:o<=i;)f.push(n(o,d)),o=a?o-t:o+t,d++;return r.toRegex===!0?dr(f,null,{wrap:!1,options:r}):f},je=(s,e,t,r={})=>{if(e==null&&Ct(s))return[s];if(!Ct(s)||!Ct(e))return pr(s,e,r);if(typeof t=="function")return je(s,e,1,{transform:t});if(cr(t))return je(s,e,0,t);let n={...r};return n.capture===!0&&(n.wrap=!0),t=t||n.step||1,Ce(t)?Ce(s)&&Ce(e)?ji(s,e,t,n):Vi(s,e,Math.max(Math.abs(t),1),n):t!=null&&!cr(t)?Ki(t,n):je(s,e,1,t)};_r.exports=je});var mr=v((xc,gr)=>{"use strict";var Yi=bt(),Er=qe(),zi=(s,e={})=>{let t=(r,n={})=>{let o=Er.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a=o===!0||i===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(r.isOpen===!0||r.isClose===!0)return c+r.value;if(r.type==="open")return a?c+r.value:"(";if(r.type==="close")return a?c+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=Er.reduce(r.nodes),d=Yi(...f,{...e,wrap:!1,toRegex:!0});if(d.length!==0)return f.length>1&&d.length>1?`(${d})`:d}if(r.nodes)for(let f of r.nodes)u+=t(f,r);return u};return t(s)};gr.exports=zi});var Rr=v((bc,wr)=>{"use strict";var Xi=bt(),yr=Ke(),me=qe(),he=(s="",e="",t=!1)=>{let r=[];if(s=[].concat(s),e=[].concat(e),!e.length)return s;if(!s.length)return t?me.flatten(e).map(n=>`{${n}}`):e;for(let n of s)if(Array.isArray(n))for(let o of n)r.push(he(o,e,t));else for(let o of e)t===!0&&typeof o=="string"&&(o=`{${o}}`),r.push(Array.isArray(o)?he(n,o,t):n+o);return me.flatten(r)},Qi=(s,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,r=(n,o={})=>{n.queue=[];let i=o,a=o.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(n.invalid||n.dollar){a.push(he(a.pop(),yr(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(he(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let d=me.reduce(n.nodes);if(me.exceedsLimit(...d,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=Xi(...d,e);l.length===0&&(l=yr(n,e)),a.push(he(a.pop(),l)),n.nodes=[];return}let c=me.encloseBrace(n),u=n.queue,f=n;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,u=f.queue;for(let d=0;d<n.nodes.length;d++){let l=n.nodes[d];if(l.type==="comma"&&n.type==="brace"){d===1&&u.push(""),u.push("");continue}if(l.type==="close"){a.push(he(a.pop(),u,c));continue}if(l.value&&l.type!=="open"){u.push(he(u.pop(),l.value));continue}l.nodes&&r(l,n)}return u};return me.flatten(r(s))};wr.exports=Qi});var Sr=v((Ic,Ar)=>{"use strict";Ar.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
2
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ir=v((vc,br)=>{"use strict";var Zi=Ke(),{MAX_LENGTH:Tr,CHAR_BACKSLASH:It,CHAR_BACKTICK:Ji,CHAR_COMMA:eo,CHAR_DOT:to,CHAR_LEFT_PARENTHESES:so,CHAR_RIGHT_PARENTHESES:ro,CHAR_LEFT_CURLY_BRACE:no,CHAR_RIGHT_CURLY_BRACE:io,CHAR_LEFT_SQUARE_BRACKET:Cr,CHAR_RIGHT_SQUARE_BRACKET:xr,CHAR_DOUBLE_QUOTE:oo,CHAR_SINGLE_QUOTE:ao,CHAR_NO_BREAK_SPACE:co,CHAR_ZERO_WIDTH_NOBREAK_SPACE:lo}=Sr(),uo=(s,e={})=>{if(typeof s!="string")throw new TypeError("Expected a string");let t=e||{},r=typeof t.maxLength=="number"?Math.min(Tr,t.maxLength):Tr;if(s.length>r)throw new SyntaxError(`Input length (${s.length}), exceeds max characters (${r})`);let n={type:"root",input:s,nodes:[]},o=[n],i=n,a=n,c=0,u=s.length,f=0,d=0,l,m={},y=()=>s[f++],w=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return i.nodes.push(S),S.parent=i,S.prev=a,a=S,S};for(w({type:"bos"});f<u;)if(i=o[o.length-1],l=y(),!(l===lo||l===co)){if(l===It){w({type:"text",value:(e.keepEscaping?l:"")+y()});continue}if(l===xr){w({type:"text",value:"\\"+l});continue}if(l===Cr){c++;let S=!0,x;for(;f<u&&(x=y());){if(l+=x,x===Cr){c++;continue}if(x===It){l+=y();continue}if(x===xr&&(c--,c===0))break}w({type:"text",value:l});continue}if(l===so){i=w({type:"paren",nodes:[]}),o.push(i),w({type:"text",value:l});continue}if(l===ro){if(i.type!=="paren"){w({type:"text",value:l});continue}i=o.pop(),w({type:"text",value:l}),i=o[o.length-1];continue}if(l===oo||l===ao||l===Ji){let S=l,x;for(e.keepQuotes!==!0&&(l="");f<u&&(x=y());){if(x===It){l+=x+y();continue}if(x===S){e.keepQuotes===!0&&(l+=x);break}l+=x}w({type:"text",value:l});continue}if(l===no){d++;let x={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};i=w(x),o.push(i),w({type:"open",value:l});continue}if(l===io){if(i.type!=="brace"){w({type:"text",value:l});continue}let S="close";i=o.pop(),i.close=!0,w({type:S,value:l}),d--,i=o[o.length-1];continue}if(l===eo&&d>0){if(i.ranges>0){i.ranges=0;let S=i.nodes.shift();i.nodes=[S,{type:"text",value:Zi(i)}]}w({type:"comma",value:l}),i.commas++;continue}if(l===to&&d>0&&i.commas===0){let S=i.nodes;if(d===0||S.length===0){w({type:"text",value:l});continue}if(a.type==="dot"){if(i.range=[],a.value+=l,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){S.pop();let x=S[S.length-1];x.value+=a.value+l,a=x,i.ranges--;continue}w({type:"dot",value:l});continue}w({type:"text",value:l})}do if(i=o.pop(),i.type!=="root"){i.nodes.forEach(H=>{H.nodes||(H.type==="open"&&(H.isOpen=!0),H.type==="close"&&(H.isClose=!0),H.nodes||(H.type="text"),H.invalid=!0)});let S=o[o.length-1],x=S.nodes.indexOf(i);S.nodes.splice(x,1,...i.nodes)}while(o.length>0);return w({type:"eos"}),n};br.exports=uo});var Nr=v((kc,kr)=>{"use strict";var vr=Ke(),fo=mr(),ho=Rr(),po=Ir(),Q=(s,e={})=>{let t=[];if(Array.isArray(s))for(let r of s){let n=Q.create(r,e);Array.isArray(n)?t.push(...n):t.push(n)}else t=[].concat(Q.create(s,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};Q.parse=(s,e={})=>po(s,e);Q.stringify=(s,e={})=>vr(typeof s=="string"?Q.parse(s,e):s,e);Q.compile=(s,e={})=>(typeof s=="string"&&(s=Q.parse(s,e)),fo(s,e));Q.expand=(s,e={})=>{typeof s=="string"&&(s=Q.parse(s,e));let t=ho(s,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};Q.create=(s,e={})=>s===""||s.length<3?[s]:e.expand!==!0?Q.compile(s,e):Q.expand(s,e);kr.exports=Q});var Or=v((Nc,_o)=>{_o.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var Lr=v((Oc,Pr)=>{Pr.exports=Or()});var Dr=v((Pc,Hr)=>{"use strict";var Eo=L("path"),go=Lr(),mo=new Set(go);Hr.exports=s=>mo.has(Eo.extname(s).slice(1).toLowerCase())});var Ve=v(R=>{"use strict";var{sep:yo}=L("path"),{platform:vt}=process,wo=L("os");R.EV_ALL="all";R.EV_READY="ready";R.EV_ADD="add";R.EV_CHANGE="change";R.EV_ADD_DIR="addDir";R.EV_UNLINK="unlink";R.EV_UNLINK_DIR="unlinkDir";R.EV_RAW="raw";R.EV_ERROR="error";R.STR_DATA="data";R.STR_END="end";R.STR_CLOSE="close";R.FSEVENT_CREATED="created";R.FSEVENT_MODIFIED="modified";R.FSEVENT_DELETED="deleted";R.FSEVENT_MOVED="moved";R.FSEVENT_CLONED="cloned";R.FSEVENT_UNKNOWN="unknown";R.FSEVENT_TYPE_FILE="file";R.FSEVENT_TYPE_DIRECTORY="directory";R.FSEVENT_TYPE_SYMLINK="symlink";R.KEY_LISTENERS="listeners";R.KEY_ERR="errHandlers";R.KEY_RAW="rawEmitters";R.HANDLER_KEYS=[R.KEY_LISTENERS,R.KEY_ERR,R.KEY_RAW];R.DOT_SLASH=`.${yo}`;R.BACK_SLASH_RE=/\\/g;R.DOUBLE_SLASH_RE=/\/\//;R.SLASH_OR_BACK_SLASH_RE=/[/\\]/;R.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;R.REPLACER_RE=/^\.[/\\]/;R.SLASH="/";R.SLASH_SLASH="//";R.BRACE_START="{";R.BANG="!";R.ONE_DOT=".";R.TWO_DOTS="..";R.STAR="*";R.GLOBSTAR="**";R.ROOT_GLOBSTAR="/**/*";R.SLASH_GLOBSTAR="/**";R.DIR_SUFFIX="Dir";R.ANYMATCH_OPTS={dot:!0};R.STRING_TYPE="string";R.FUNCTION_TYPE="function";R.EMPTY_STR="";R.EMPTY_FN=()=>{};R.IDENTITY_FN=s=>s;R.isWindows=vt==="win32";R.isMacos=vt==="darwin";R.isLinux=vt==="linux";R.isIBMi=wo.type()==="OS400"});var Br=v((Hc,Wr)=>{"use strict";var oe=L("fs"),W=L("path"),{promisify:ve}=L("util"),Ro=Dr(),{isWindows:Ao,isLinux:So,EMPTY_FN:To,EMPTY_STR:Co,KEY_LISTENERS:ye,KEY_ERR:kt,KEY_RAW:xe,HANDLER_KEYS:xo,EV_CHANGE:ze,EV_ADD:Ye,EV_ADD_DIR:bo,EV_ERROR:$r,STR_DATA:Io,STR_END:vo,BRACE_START:ko,STAR:No}=Ve(),Oo="watch",Po=ve(oe.open),Ur=ve(oe.stat),Lo=ve(oe.lstat),Ho=ve(oe.close),Nt=ve(oe.realpath),Do={lstat:Lo,stat:Ur},Pt=(s,e)=>{s instanceof Set?s.forEach(e):e(s)},be=(s,e,t)=>{let r=s[e];r instanceof Set||(s[e]=r=new Set([r])),r.add(t)},Fo=s=>e=>{let t=s[e];t instanceof Set?t.clear():delete s[e]},Ie=(s,e,t)=>{let r=s[e];r instanceof Set?r.delete(t):r===t&&delete s[e]},Mr=s=>s instanceof Set?s.size===0:!s,Xe=new Map;function Fr(s,e,t,r,n){let o=(i,a)=>{t(s),n(i,a,{watchedPath:s}),a&&s!==a&&Qe(W.resolve(s,a),ye,W.join(s,a))};try{return oe.watch(s,e,o)}catch(i){r(i)}}var Qe=(s,e,t,r,n)=>{let o=Xe.get(s);o&&Pt(o[e],i=>{i(t,r,n)})},$o=(s,e,t,r)=>{let{listener:n,errHandler:o,rawEmitter:i}=r,a=Xe.get(e),c;if(!t.persistent)return c=Fr(s,t,n,o,i),c.close.bind(c);if(a)be(a,ye,n),be(a,kt,o),be(a,xe,i);else{if(c=Fr(s,t,Qe.bind(null,e,ye),o,Qe.bind(null,e,xe)),!c)return;c.on($r,async u=>{let f=Qe.bind(null,e,kt);if(a.watcherUnusable=!0,Ao&&u.code==="EPERM")try{let d=await Po(s,"r");await Ho(d),f(u)}catch{}else f(u)}),a={listeners:n,errHandlers:o,rawEmitters:i,watcher:c},Xe.set(e,a)}return()=>{Ie(a,ye,n),Ie(a,kt,o),Ie(a,xe,i),Mr(a.listeners)&&(a.watcher.close(),Xe.delete(e),xo.forEach(Fo(a)),a.watcher=void 0,Object.freeze(a))}},Ot=new Map,Uo=(s,e,t,r)=>{let{listener:n,rawEmitter:o}=r,i=Ot.get(e),a=new Set,c=new Set,u=i&&i.options;return u&&(u.persistent<t.persistent||u.interval>t.interval)&&(a=i.listeners,c=i.rawEmitters,oe.unwatchFile(e),i=void 0),i?(be(i,ye,n),be(i,xe,o)):(i={listeners:n,rawEmitters:o,options:t,watcher:oe.watchFile(e,t,(f,d)=>{Pt(i.rawEmitters,m=>{m(ze,e,{curr:f,prev:d})});let l=f.mtimeMs;(f.size!==d.size||l>d.mtimeMs||l===0)&&Pt(i.listeners,m=>m(s,f))})},Ot.set(e,i)),()=>{Ie(i,ye,n),Ie(i,xe,o),Mr(i.listeners)&&(Ot.delete(e),oe.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},Lt=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let r=this.fsw.options,n=W.dirname(e),o=W.basename(e);this.fsw._getWatchedDir(n).add(o);let a=W.resolve(e),c={persistent:r.persistent};t||(t=To);let u;return r.usePolling?(c.interval=r.enableBinaryInterval&&Ro(o)?r.binaryInterval:r.interval,u=Uo(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):u=$o(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,t,r){if(this.fsw.closed)return;let n=W.dirname(e),o=W.basename(e),i=this.fsw._getWatchedDir(n),a=t;if(i.has(o))return;let c=async(f,d)=>{if(this.fsw._throttle(Oo,e,5)){if(!d||d.mtimeMs===0)try{let l=await Ur(e);if(this.fsw.closed)return;let m=l.atimeMs,y=l.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(ze,e,l),So&&a.ino!==l.ino?(this.fsw._closeFile(f),a=l,this.fsw._addPathCloser(f,this._watchWithNodeFs(e,c))):a=l}catch{this.fsw._remove(n,o)}else if(i.has(o)){let l=d.atimeMs,m=d.mtimeMs;(!l||l<=m||m!==a.mtimeMs)&&this.fsw._emit(ze,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Ye,e,0))return;this.fsw._emit(Ye,e,t)}return u}async _handleSymlink(e,t,r,n){if(this.fsw.closed)return;let o=e.fullPath,i=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await Nt(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(o)!==a&&(this.fsw._symlinkPaths.set(o,a),this.fsw._emit(ze,r,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(o,a),this.fsw._emit(Ye,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,t,r,n,o,i,a){if(e=W.join(e,Co),!r.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(r.path),u=new Set,f=this.fsw._readdirp(e,{fileFilter:d=>r.filterPath(d),directoryFilter:d=>r.filterDir(d),depth:0}).on(Io,async d=>{if(this.fsw.closed){f=void 0;return}let l=d.path,m=W.join(e,l);if(u.add(l),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,e,m,l))){if(this.fsw.closed){f=void 0;return}(l===n||!n&&!c.has(l))&&(this.fsw._incrReadyCount(),m=W.join(o,W.relative(o,m)),this._addToNodeFs(m,t,r,i+1))}}).on($r,this._boundHandleError);return new Promise(d=>f.once(vo,()=>{if(this.fsw.closed){f=void 0;return}let l=a?a.clear():!1;d(),c.getChildren().filter(m=>m!==e&&!u.has(m)&&(!r.hasGlob||r.filterPath({fullPath:W.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m)}),f=void 0,l&&this._handleRead(e,!1,r,n,o,i,a)}))}async _handleDir(e,t,r,n,o,i,a){let c=this.fsw._getWatchedDir(W.dirname(e)),u=c.has(W.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!o&&!u&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(bo,e,t),c.add(W.basename(e)),this.fsw._getWatchedDir(e);let f,d,l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(a)){if(!o&&(await this._handleRead(e,r,i,o,e,n,f),this.fsw.closed))return;d=this._watchWithNodeFs(e,(m,y)=>{y&&y.mtimeMs===0||this._handleRead(m,!1,i,o,e,n,f)})}return d}async _addToNodeFs(e,t,r,n,o){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e,n);!a.hasGlob&&r&&(a.hasGlob=r.hasGlob,a.globFilter=r.globFilter,a.filterPath=c=>r.filterPath(c),a.filterDir=c=>r.filterDir(c));try{let c=await Do[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(No)&&!e.includes(ko),f;if(c.isDirectory()){let d=W.resolve(e),l=u?await Nt(e):e;if(this.fsw.closed||(f=await this._handleDir(a.watchPath,c,t,n,o,a,l),this.fsw.closed))return;d!==l&&l!==void 0&&this.fsw._symlinkPaths.set(d,l)}else if(c.isSymbolicLink()){let d=u?await Nt(e):e;if(this.fsw.closed)return;let l=W.dirname(a.watchPath);if(this.fsw._getWatchedDir(l).add(a.watchPath),this.fsw._emit(Ye,a.watchPath,c),f=await this._handleDir(l,c,t,n,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(W.resolve(e),d)}else f=this._handleFile(a.watchPath,c,t);return i(),this.fsw._addPathCloser(e,f),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};Wr.exports=Lt});var zr=v((Dc,Bt)=>{"use strict";var Mt=L("fs"),B=L("path"),{promisify:Wt}=L("util"),we;try{we=L("fsevents")}catch(s){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(s)}if(we){let s=process.version.match(/v(\d+)\.(\d+)/);if(s&&s[1]&&s[2]){let e=Number.parseInt(s[1],10),t=Number.parseInt(s[2],10);e===8&&t<16&&(we=void 0)}}var{EV_ADD:Ht,EV_CHANGE:Mo,EV_ADD_DIR:Gr,EV_UNLINK:Ze,EV_ERROR:Wo,STR_DATA:Bo,STR_END:Go,FSEVENT_CREATED:qo,FSEVENT_MODIFIED:Ko,FSEVENT_DELETED:jo,FSEVENT_MOVED:Vo,FSEVENT_UNKNOWN:Yo,FSEVENT_TYPE_FILE:zo,FSEVENT_TYPE_DIRECTORY:ke,FSEVENT_TYPE_SYMLINK:Yr,ROOT_GLOBSTAR:qr,DIR_SUFFIX:Xo,DOT_SLASH:Kr,FUNCTION_TYPE:Dt,EMPTY_FN:Qo,IDENTITY_FN:Zo}=Ve(),Jo=s=>isNaN(s)?{}:{depth:s},$t=Wt(Mt.stat),ea=Wt(Mt.lstat),jr=Wt(Mt.realpath),ta={stat:$t,lstat:ea},pe=new Map,sa=10,ra=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),na=(s,e)=>({stop:we.watch(s,e)});function ia(s,e,t,r){let n=B.extname(e)?B.dirname(e):e,o=B.dirname(n),i=pe.get(n);oa(o)&&(n=o);let a=B.resolve(s),c=a!==e,u=(d,l,m)=>{c&&(d=d.replace(e,a)),(d===a||!d.indexOf(a+B.sep))&&t(d,l,m)},f=!1;for(let d of pe.keys())if(e.indexOf(B.resolve(d)+B.sep)===0){n=d,i=pe.get(n),f=!0;break}return i||f?i.listeners.add(u):(i={listeners:new Set([u]),rawEmitter:r,watcher:na(n,(d,l)=>{if(!i.listeners.size)return;let m=we.getInfo(d,l);i.listeners.forEach(y=>{y(d,l,m)}),i.rawEmitter(m.event,d,m)})},pe.set(n,i)),()=>{let d=i.listeners;if(d.delete(u),!d.size&&(pe.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}var oa=s=>{let e=0;for(let t of pe.keys())if(t.indexOf(s)===0&&(e++,e>=sa))return!0;return!1},aa=()=>we&&pe.size<128,Ft=(s,e)=>{let t=0;for(;!s.indexOf(e)&&(s=B.dirname(s))!==e;)t++;return t},Vr=(s,e)=>s.type===ke&&e.isDirectory()||s.type===Yr&&e.isSymbolicLink()||s.type===zo&&e.isFile(),Ut=class{constructor(e){this.fsw=e}checkIgnored(e,t){let r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return r.add(e),t&&t.isDirectory()&&r.add(e+qr),!0;r.delete(e),r.delete(e+qr)}addOrChange(e,t,r,n,o,i,a,c){let u=o.has(i)?Mo:Ht;this.handleEvent(u,e,t,r,n,o,i,a,c)}async checkExists(e,t,r,n,o,i,a,c){try{let u=await $t(e);if(this.fsw.closed)return;Vr(a,u)?this.addOrChange(e,t,r,n,o,i,a,c):this.handleEvent(Ze,e,t,r,n,o,i,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,t,r,n,o,i,a,c):this.handleEvent(Ze,e,t,r,n,o,i,a,c)}}handleEvent(e,t,r,n,o,i,a,c,u){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Ze){let f=c.type===ke;(f||i.has(a))&&this.fsw._remove(o,a,f)}else{if(e===Ht){if(c.type===ke&&this.fsw._getWatchedDir(t),c.type===Yr&&u.followSymlinks){let d=u.depth===void 0?void 0:Ft(r,n)+1;return this._addToFsEvents(t,!1,!0,d)}this.fsw._getWatchedDir(o).add(a)}let f=c.type===ke?e+Xo:e;this.fsw._emit(f,t),f===Gr&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,r,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;let o=this.fsw.options,a=ia(e,t,async(c,u,f)=>{if(this.fsw.closed||o.depth!==void 0&&Ft(c,t)>o.depth)return;let d=r(B.join(e,B.relative(e,c)));if(n&&!n(d))return;let l=B.dirname(d),m=B.basename(d),y=this.fsw._getWatchedDir(f.type===ke?d:l);if(ra.has(u)||f.event===Yo)if(typeof o.ignored===Dt){let w;try{w=await $t(d)}catch{}if(this.fsw.closed||this.checkIgnored(d,w))return;Vr(f,w)?this.addOrChange(d,c,t,l,y,m,f,o):this.handleEvent(Ze,d,c,t,l,y,m,f,o)}else this.checkExists(d,c,t,l,y,m,f,o);else switch(f.event){case qo:case Ko:return this.addOrChange(d,c,t,l,y,m,f,o);case jo:case Vo:return this.checkExists(d,c,t,l,y,m,f,o)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,r,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let o=await jr(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(o))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(o||e,i=>{let a=e;return o&&o!==Kr?a=i.replace(o,e):i!==Kr&&(a=B.join(e,i)),r(a)},!1,n)}catch(o){if(this.fsw._handleError(o))return this.fsw._emitReady()}}}emitAdd(e,t,r,n,o){let i=r(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(B.dirname(i)),u=B.basename(i);a&&this.fsw._getWatchedDir(i),!c.has(u)&&(c.add(u),(!n.ignoreInitial||o===!0)&&this.fsw._emit(a?Gr:Ht,i,t))}initWatch(e,t,r,n){if(this.fsw.closed)return;let o=this._watchWithFsEvents(r.watchPath,B.resolve(e||r.watchPath),n,r.globFilter);this.fsw._addPathCloser(t,o)}async _addToFsEvents(e,t,r,n){if(this.fsw.closed)return;let o=this.fsw.options,i=typeof t===Dt?t:Zo,a=this.fsw._getWatchHelpers(e);try{let c=await ta[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(i(e),c,i,o,r),n&&n>o.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...Jo(o.depth-(n||0))}).on(Bo,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let f=B.join(a.watchPath,u.path),{fullPath:d}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let l=o.depth===void 0?void 0:Ft(f,B.resolve(a.watchPath))+1;this._handleFsEventsSymlink(f,d,i,l)}else this.emitAdd(f,u.stats,i,o,r)}).on(Wo,Qo).on(Go,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,i,o,r),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(o.persistent&&r!==!0)if(typeof t===Dt)this.initWatch(void 0,e,a,i);else{let c;try{c=await jr(a.watchPath)}catch{}this.initWatch(c,e,a,i)}}};Bt.exports=Ut;Bt.exports.canUse=aa});var an=v(rs=>{"use strict";var{EventEmitter:ca}=L("events"),ts=L("fs"),k=L("path"),{promisify:sn}=L("util"),la=Hs(),Yt=Bs().default,ua=Ys(),Gt=At(),fa=Nr(),da=wt(),ha=Br(),Xr=zr(),{EV_ALL:qt,EV_READY:pa,EV_ADD:Je,EV_CHANGE:Ne,EV_UNLINK:Qr,EV_ADD_DIR:_a,EV_UNLINK_DIR:Ea,EV_RAW:ga,EV_ERROR:Kt,STR_CLOSE:ma,STR_END:ya,BACK_SLASH_RE:wa,DOUBLE_SLASH_RE:Zr,SLASH_OR_BACK_SLASH_RE:Ra,DOT_RE:Aa,REPLACER_RE:Sa,SLASH:jt,SLASH_SLASH:Ta,BRACE_START:Ca,BANG:zt,ONE_DOT:rn,TWO_DOTS:xa,GLOBSTAR:ba,SLASH_GLOBSTAR:Vt,ANYMATCH_OPTS:Xt,STRING_TYPE:ss,FUNCTION_TYPE:Ia,EMPTY_STR:Qt,EMPTY_FN:va,isWindows:ka,isMacos:Na,isIBMi:Oa}=Ve(),Pa=sn(ts.stat),La=sn(ts.readdir),Zt=(s=[])=>Array.isArray(s)?s:[s],nn=(s,e=[])=>(s.forEach(t=>{Array.isArray(t)?nn(t,e):e.push(t)}),e),Jr=s=>{let e=nn(Zt(s));if(!e.every(t=>typeof t===ss))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(on)},en=s=>{let e=s.replace(wa,jt),t=!1;for(e.startsWith(Ta)&&(t=!0);e.match(Zr);)e=e.replace(Zr,jt);return t&&(e=jt+e),e},on=s=>en(k.normalize(en(s))),tn=(s=Qt)=>e=>typeof e!==ss?e:on(k.isAbsolute(e)?e:k.join(s,e)),Ha=(s,e)=>k.isAbsolute(s)?s:s.startsWith(zt)?zt+k.join(e,s.slice(1)):k.join(e,s),ee=(s,e)=>s[e]===void 0,Jt=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==rn&&e!==xa&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let r=this.path;try{await La(r)}catch{this._removeWatcher&&this._removeWatcher(k.dirname(r),k.basename(r))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},Da="stat",Fa="lstat",es=class{constructor(e,t,r,n){this.fsw=n,this.path=e=e.replace(Sa,Qt),this.watchPath=t,this.fullWatchPath=k.resolve(t),this.hasGlob=t!==e,e===Qt&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?Yt(e,void 0,Xt):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=r,this.statMethod=r?Da:Fa}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return k.join(this.watchPath,k.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===Ia?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(Ca)?fa.expand(e):[e]).forEach(n=>{t.push(k.relative(this.watchPath,n).split(Ra))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),r=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((o,i)=>(o===ba&&(r=!0),r||!t[0][i]||Yt(o,t[0][i],Xt))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},et=class extends ca{constructor(e){super();let t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,ee(t,"persistent")&&(t.persistent=!0),ee(t,"ignoreInitial")&&(t.ignoreInitial=!1),ee(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),ee(t,"interval")&&(t.interval=100),ee(t,"binaryInterval")&&(t.binaryInterval=300),ee(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,ee(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),Xr.canUse()||(t.useFsEvents=!1),ee(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=Na),Oa&&(t.usePolling=!0);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let o=process.env.CHOKIDAR_INTERVAL;o&&(t.interval=Number.parseInt(o,10)),ee(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),ee(t,"followSymlinks")&&(t.followSymlinks=!0),ee(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let i=t.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=Zt(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=va,this._readyEmitted=!0,process.nextTick(()=>this.emit(pa)))},this._emitRaw=(...c)=>this.emit(ga,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new Xr(this):this._nodeFsHandler=new ha(this),Object.freeze(t)}add(e,t,r){let{cwd:n,disableGlobbing:o}=this.options;this.closed=!1;let i=Jr(e);return n&&(i=i.map(a=>{let c=Ha(a,n);return o||!Gt(a)?c:da(c)})),i=i.filter(a=>a.startsWith(zt)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Vt),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount*=2),i.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!r,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(k.dirname(c),k.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=Jr(e),{cwd:r}=this.options;return t.forEach(n=>{!k.isAbsolute(n)&&!this._closers.has(n)&&(r&&(n=k.join(r,n)),n=k.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+Vt),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(r=>{let n=r();n instanceof Promise&&e.push(n)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,r)=>{let n=this.options.cwd?k.relative(this.options.cwd,r):r;e[n||rn]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Kt&&this.emit(qt,...t)}async _emit(e,t,r,n,o){if(this.closed)return;let i=this.options;ka&&(t=k.normalize(t)),i.cwd&&(t=k.relative(i.cwd,t));let a=[e,t];o!==void 0?a.push(r,n,o):n!==void 0?a.push(r,n):r!==void 0&&a.push(r);let c=i.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(i.atomic){if(e===Qr)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((f,d)=>{this.emit(...f),this.emit(qt,...f),this._pendingUnlinks.delete(d)})},typeof i.atomic=="number"?i.atomic:100),this;e===Je&&this._pendingUnlinks.has(t)&&(e=a[0]=Ne,this._pendingUnlinks.delete(t))}if(c&&(e===Je||e===Ne)&&this._readyEmitted){let f=(d,l)=>{d?(e=a[0]=Kt,a[1]=d,this.emitWithAll(e,a)):l&&(a.length>2?a[2]=l:a.push(l),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,f),this}if(e===Ne&&!this._throttle(Ne,t,50))return this;if(i.alwaysStat&&r===void 0&&(e===Je||e===_a||e===Ne)){let f=i.cwd?k.join(i.cwd,t):t,d;try{d=await Pa(f)}catch{}if(!d||this.closed)return;a.push(d)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(Kt,e),e||this.closed}_throttle(e,t,r){this._throttled.has(e)||this._throttled.set(e,new Map);let n=this._throttled.get(e),o=n.get(t);if(o)return o.count++,!1;let i,a=()=>{let u=n.get(t),f=u?u.count:0;return n.delete(t),clearTimeout(i),u&&clearTimeout(u.timeoutObject),f};i=setTimeout(a,r);let c={timeoutObject:i,clear:a,count:0};return n.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,r,n){let o,i=e;this.options.cwd&&!k.isAbsolute(e)&&(i=k.join(this.options.cwd,e));let a=new Date,c=u=>{ts.stat(i,(f,d)=>{if(f||!this._pendingWrites.has(e)){f&&f.code!=="ENOENT"&&n(f);return}let l=Number(new Date);u&&d.size!==u.size&&(this._pendingWrites.get(e).lastChange=l);let m=this._pendingWrites.get(e);l-m.lastChange>=t?(this._pendingWrites.delete(e),n(void 0,d)):o=setTimeout(c,this.options.awaitWriteFinish.pollInterval,d)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(o),r)}),o=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&Aa.test(e))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=this.options.ignored,o=n&&n.map(tn(r)),i=Zt(o).filter(c=>typeof c===ss&&!Gt(c)).map(c=>c+Vt),a=this._getGlobIgnored().map(tn(r)).concat(o,i);this._userIgnored=Yt(a,void 0,Xt)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let r=t||this.options.disableGlobbing||!Gt(e)?e:ua(e),n=this.options.followSymlinks;return new es(e,r,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=k.resolve(e);return this._watched.has(t)||this._watched.set(t,new Jt(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,t,r){let n=k.join(e,t),o=k.resolve(n);if(r=r??(this._watched.has(n)||this._watched.has(o)),!this._throttle("remove",n,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));let c=this._getWatchedDir(e),u=c.has(t);c.remove(t),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let f=n;if(this.options.cwd&&(f=k.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===Je)return;this._watched.delete(n),this._watched.delete(o);let d=r?Ea:Qr;u&&!this._isIgnored(n)&&this._emit(d,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);let t=k.dirname(e);this._getWatchedDir(t).remove(k.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(t)}_readdirp(e,t){if(this.closed)return;let r={type:qt,alwaysStat:!0,lstat:!0,...t},n=la(e,r);return this._streams.add(n),n.once(ma,()=>{n=void 0}),n.once(ya,()=>{n&&(this._streams.delete(n),n=void 0)}),n}};rs.FSWatcher=et;var $a=(s,e)=>{let t=new et(e);return t.add(s),t};rs.watch=$a});import"only-server";import"../common/index.mjs";var un=vn(an(),1);import{existsSync as ln,promises as Ma}from"node:fs";import{basename as is,dirname as tt,join as cn,relative as st}from"node:path";import{build as Wa}from"esbuild";import{jwtDecode as Ba}from"jwt-decode";import{Issuer as Ga}from"openid-client";import{ExternalTaskWorker as qa}from"@5minds/processcube_engine_client";import{Logger as Ka}from"@5minds/processcube_engine_sdk";import{EngineClient as Ua}from"@5minds/processcube_engine_client";var ns=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",$=new Ua(ns);var ja={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},Va=.85,rt=["external_task.ts","external_task.js"],J=new Ka("processcube_app_sdk:external_task_adapter"),as=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,ue={};async function fn(s){if(s&&!ln(s))throw new Error(`Invalid customExternalTasksDirPath. The given path '${s}' does not exist`);let e=Ja(s);(0,un.watch)(e).on("add",async t=>{if(!rt.includes(is(t)))return;await dn(t,e);let r=tt(t),n=st(e,r),o=nt(n);J.info(`Started external task ${ue[t].workerId} for topic ${o}`)}).on("change",async t=>{if(!rt.includes(is(t)))return;await Ya(t,e);let r=tt(t),n=st(e,r),o=nt(n);J.info(`Restarted external task ${ue[t].workerId} for topic ${o}`)}).on("unlink",async t=>{if(!rt.includes(is(t)))return;hn(t);let r=tt(t),n=st(e,r),o=nt(n);J.info(`Stopped external task ${ue[t].workerId} for topic '${o}'`,{reason:`External Task for topic '${o}' was removed`,workerId:ue[t].workerId,topic:o}),delete ue[t]}).on("error",t=>J.info(`Watcher error: ${t}`))}async function dn(s,e,t){let r=tt(s);if(!za(r)){J.error(`Could not find external task file in directory '${r}'`);return}let o=await Xa(s),i=await Qa(o,s);if(i.default===void 0){J.info(`External task file recognized at ${s}. Please export a default handler function. For more information see https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#external-tasks-entwickeln`);return}let a=await pn(),c=_n(a),u=st(e,r),f=nt(u),d=i.default,l={identity:c,...t,...i?.config},m=new qa(ns,f,d,l);m.onWorkerError((y,w,S)=>{J.error(`Intercepted "${y}"-type error: ${w.message}`,{err:w,type:y,externalTask:S})}),m.start(),await os(a,m),ue[s]=m}async function Ya(s,e){let t=ue[s]?.workerId;hn(s),await dn(s,e,{workerId:t})}function hn(s){let e=ue[s];e&&(e.stop(),e.dispose())}async function za(s){let t=(await Ma.readdir(s)).filter(r=>rt.includes(r));if(t.length===0)return null;if(t.length>1)throw new Error(`Found more than one external task file in directory '${s}'`);return t[0]}async function pn(){if(!as)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw J.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let s=await Ga.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new s.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function _n(s){if(!as||s===null)return ja;let e=s.access_token,t=Ba(e);return{token:s.access_token,userId:t.sub}}async function os(s,e,t=5){try{if(!as||s===null||!e.pollingIsActive)return;let n=await Za(s)*Va*1e3;setTimeout(async()=>{if(!e.pollingIsActive)return;let o=await pn(),i=_n(o);e.identity=i,await os(o,e)},n)}catch(r){if(t===0)throw r;J.error(`Could not refresh identity for external task worker ${e.workerId}`,{err:r,workerId:e.workerId,retryCount:t});let n=2*1e3;setTimeout(async()=>await os(s,e,t-1),n)}}async function Xa(s){let e=await Wa({entryPoints:[s],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(e.errors.length>0)throw J.error(`Could not transpile file at '${s}'`,{errors:e.errors}),new Error(`Could not transpile file at '${s}'`);return e.warnings.length>0&&J.warn(`Transpiled file at '${s}' with warnings`,{warnings:e.warnings}),e.outputFiles[0].text}async function Qa(s,e){try{var t=module.constructor,r=new t;return r._compile(s,e),r.exports}catch(n){throw J.error("Could not require module from string",{err:n}),n}}async function Za(s){let e=s.expires_in;if(!e&&s.expires_at&&(e=Math.floor(s.expires_at-Date.now()/1e3)),e===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return e}function nt(s){return s.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function Ja(s){let e,t=[s,cn(process.cwd(),"app"),cn(process.cwd(),"src","app")];for(let r of t)if(r&&ln(r)){e=r;break}if(!e)throw new Error("Could not find external tasks directory");return e}function Jc(){return $}import{getToken as En}from"next-auth/jwt";import{ResponseCookies as ec}from"next/dist/compiled/@edge-runtime/cookies";import{cookies as it,headers as gn}from"next/headers";var tc=process.env.NEXTAUTH_URL?.startsWith("https://"),mn=`${tc?"__Secure-":""}next-auth.session-token`;async function nl(){let s=await En({req:{cookies:it(),headers:gn()}});if(s?.expiresAt&&Date.now()>=s.expiresAt*1e3){let t=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:it().toString()}}),r=new ec(t.headers),n=r.get(mn);if(n){let o=!1;try{it().set(mn,n.value,{...n})}catch{o=!0}if(s=await En({req:{cookies:o?r:it(),headers:gn()}}),s?.error)throw s.error}}if(!s?.accessToken||!s?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:s?.accessToken,userId:s?.sub}}import{DataModels as sc}from"@5minds/processcube_engine_client";async function cl(s){return await $.processInstances.query({...s?.query,state:sc.ProcessInstances.ProcessInstanceState.running},s?.options)}import{DataModels as ae}from"@5minds/processcube_engine_client";import{mapUserTask as yn,mapUserTaskList as _e}from"../common/index.mjs";async function _l(s={},e){let{correlationId:t,processInstanceId:r,flowNodeId:n}=s;return new Promise(async(o,i)=>{let a=await $.userTasks.onUserTaskWaiting(async u=>{let f=t!==void 0&&u.correlationId!==t,d=u.flowNodeInstanceId===void 0,l=r!==void 0&&u.processInstanceId!==r,m=n!==void 0&&u.flowNodeId!==n;if(f||d||l||m)return;let y=await nc(u.flowNodeInstanceId,{identity:e});return $.notification.removeSubscription(a,e),y===null?i(new Error(`UserTask with instance ID "${u.flowNodeInstanceId}" does not exist.`)):o(y)},{identity:e}),c=await rc({correlationId:t,processInstanceId:r,flowNodeId:n,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e});c.userTasks.length>0&&($.notification.removeSubscription(a,e),o(c.userTasks[0]))})}async function El(s,e={},t={},r){await $.userTasks.finishUserTask(s,t,r);let n={state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended,...e},o=await $.userTasks.query(n,{identity:r});return yn(o.userTasks[0])}async function rc(...s){let e=await $.userTasks.query(...s);return _e(e)}async function gl(s){let e=await $.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return _e(e)}async function ml(s,e){let t=await $.userTasks.query({processInstanceId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(t)}async function yl(s,e){let t=await $.userTasks.query({flowNodeId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(t)}async function nc(s,e){let t=await $.userTasks.query({flowNodeInstanceId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{...e,limit:1});return t.userTasks.length===0?null:yn(t.userTasks[0])}async function wl(s,e){let t=await $.userTasks.query({correlationId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(t)}async function Rl(s,e){let t=await $.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s,...e}),r=t.userTasks.filter(n=>n.actualOwnerId===s.userId);return t.userTasks=r,_e(t)}async function Al(s,e){let t=await $.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s,...e}),r=t.userTasks.filter(n=>n.assignedUserIds?.includes(s.userId));return t.userTasks=r,_e(t)}import{PHASE_DEVELOPMENT_SERVER as ic,PHASE_PRODUCTION_SERVER as oc}from"next/dist/shared/lib/constants";var wn=!1;function Pl(s={}){let{applicationSdk:e,...t}=s;return async(r,n)=>{let o=r===ic||r===oc;return e?.useExternalTasks&&o&&!wn&&(wn=!0,await fn(e?.customExternalTasksDirPath)),t}}import{revalidatePath as ac}from"next/cache";import{redirect as cc}from"next/navigation";function Ul(s){ac(s),cc(s)}async function Bl(...s){return await $.processModels.startProcessInstance(...s)}async function Kl(...s){await $.userTasks.finishUserTask(...s)}export{Kl as finishUserTask,El as finishUserTaskAndGetNext,cl as getActiveProcessInstances,Al as getAssignedUserTasksByIdentity,Jc as getEngineClient,nl as getIdentity,Rl as getReservedUserTasksByIdentity,rc as getUserTasks,nc as getWaitingUserTaskByFlowNodeInstanceId,gl as getWaitingUserTasks,wl as getWaitingUserTasksByCorrelationId,yl as getWaitingUserTasksByFlowNodeId,ml as getWaitingUserTasksByProcessInstanceId,Ul as navigateToUrl,Bl as startProcess,_l as waitForUserTask,Pl as withApplicationSdk};
|
|
1
|
+
var Sn=Object.create;var cs=Object.defineProperty;var Tn=Object.getOwnPropertyDescriptor;var Cn=Object.getOwnPropertyNames;var xn=Object.getPrototypeOf,bn=Object.prototype.hasOwnProperty;var L=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var v=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var In=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cn(e))!bn.call(s,n)&&n!==t&&cs(s,n,{get:()=>e[n],enumerable:!(r=Tn(e,n))||r.enumerable});return s};var vn=(s,e,t)=>(t=s!=null?Sn(xn(s)):{},In(e||!s||!s.__esModule?cs(t,"default",{value:s,enumerable:!0}):t,s));var Re=v((dc,hs)=>{"use strict";var kn=L("path"),ne="\\\\/",ls=`[^${ne}]`,ie="\\.",Nn="\\+",On="\\?",De="\\/",Pn="(?=.)",us="[^/]",at=`(?:${De}|$)`,fs=`(?:^|${De})`,ct=`${ie}{1,2}${at}`,Ln=`(?!${ie})`,Hn=`(?!${fs}${ct})`,Dn=`(?!${ie}{0,1}${at})`,Fn=`(?!${ct})`,$n=`[^.${De}]`,Un=`${us}*?`,ds={DOT_LITERAL:ie,PLUS_LITERAL:Nn,QMARK_LITERAL:On,SLASH_LITERAL:De,ONE_CHAR:Pn,QMARK:us,END_ANCHOR:at,DOTS_SLASH:ct,NO_DOT:Ln,NO_DOTS:Hn,NO_DOT_SLASH:Dn,NO_DOTS_SLASH:Fn,QMARK_NO_DOT:$n,STAR:Un,START_ANCHOR:fs},Mn={...ds,SLASH_LITERAL:`[${ne}]`,QMARK:ls,STAR:`${ls}*?`,DOTS_SLASH:`${ie}{1,2}(?:[${ne}]|$)`,NO_DOT:`(?!${ie})`,NO_DOTS:`(?!(?:^|[${ne}])${ie}{1,2}(?:[${ne}]|$))`,NO_DOT_SLASH:`(?!${ie}{0,1}(?:[${ne}]|$))`,NO_DOTS_SLASH:`(?!${ie}{1,2}(?:[${ne}]|$))`,QMARK_NO_DOT:`[^.${ne}]`,START_ANCHOR:`(?:^|[${ne}])`,END_ANCHOR:`(?:[${ne}]|$)`},Wn={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"};hs.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Wn,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:{"***":"*","**/**":"**","**/**/**":"**"},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,SEP:kn.sep,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?Mn:ds}}});var Fe=v(Y=>{"use strict";var Bn=L("path"),Gn=process.platform==="win32",{REGEX_BACKSLASH:qn,REGEX_REMOVE_BACKSLASH:Kn,REGEX_SPECIAL_CHARS:jn,REGEX_SPECIAL_CHARS_GLOBAL:Vn}=Re();Y.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s);Y.hasRegexChars=s=>jn.test(s);Y.isRegexChar=s=>s.length===1&&Y.hasRegexChars(s);Y.escapeRegex=s=>s.replace(Vn,"\\$1");Y.toPosixSlashes=s=>s.replace(qn,"/");Y.removeBackslashes=s=>s.replace(Kn,e=>e==="\\"?"":e);Y.supportsLookbehinds=()=>{let s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||s[0]===8&&s[1]>=10};Y.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:Gn===!0||Bn.sep==="\\";Y.escapeLast=(s,e,t)=>{let r=s.lastIndexOf(e,t);return r===-1?s:s[r-1]==="\\"?Y.escapeLast(s,e,r-1):`${s.slice(0,r)}\\${s.slice(r)}`};Y.removePrefix=(s,e={})=>{let t=s;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Y.wrapOutput=(s,e={},t={})=>{let r=t.contains?"":"^",n=t.contains?"":"$",o=`${r}(?:${s})${n}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var Rs=v((pc,ws)=>{"use strict";var ps=Fe(),{CHAR_ASTERISK:lt,CHAR_AT:Yn,CHAR_BACKWARD_SLASH:Ae,CHAR_COMMA:zn,CHAR_DOT:ut,CHAR_EXCLAMATION_MARK:ft,CHAR_FORWARD_SLASH:ys,CHAR_LEFT_CURLY_BRACE:dt,CHAR_LEFT_PARENTHESES:ht,CHAR_LEFT_SQUARE_BRACKET:Xn,CHAR_PLUS:Qn,CHAR_QUESTION_MARK:_s,CHAR_RIGHT_CURLY_BRACE:Zn,CHAR_RIGHT_PARENTHESES:Es,CHAR_RIGHT_SQUARE_BRACKET:Jn}=Re(),gs=s=>s===ys||s===Ae,ms=s=>{s.isPrefix!==!0&&(s.depth=s.isGlobstar?1/0:1)},ei=(s,e)=>{let t=e||{},r=s.length-1,n=t.parts===!0||t.scanToEnd===!0,o=[],i=[],a=[],c=s,u=-1,f=0,d=0,l=!1,m=!1,y=!1,R=!1,S=!1,x=!1,H=!1,F=!1,te=!1,q=!1,ce=0,K,A,I={value:"",depth:0,isGlob:!1},G=()=>u>=r,_=()=>c.charCodeAt(u+1),P=()=>(K=A,c.charCodeAt(++u));for(;u<r;){A=P();let j;if(A===Ae){H=I.backslashes=!0,A=P(),A===dt&&(x=!0);continue}if(x===!0||A===dt){for(ce++;G()!==!0&&(A=P());){if(A===Ae){H=I.backslashes=!0,P();continue}if(A===dt){ce++;continue}if(x!==!0&&A===ut&&(A=P())===ut){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(x!==!0&&A===zn){if(l=I.isBrace=!0,y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===Zn&&(ce--,ce===0)){x=!1,l=I.isBrace=!0,q=!0;break}}if(n===!0)continue;break}if(A===ys){if(o.push(u),i.push(I),I={value:"",depth:0,isGlob:!1},q===!0)continue;if(K===ut&&u===f+1){f+=2;continue}d=u+1;continue}if(t.noext!==!0&&(A===Qn||A===Yn||A===lt||A===_s||A===ft)===!0&&_()===ht){if(y=I.isGlob=!0,R=I.isExtglob=!0,q=!0,A===ft&&u===f&&(te=!0),n===!0){for(;G()!==!0&&(A=P());){if(A===Ae){H=I.backslashes=!0,A=P();continue}if(A===Es){y=I.isGlob=!0,q=!0;break}}continue}break}if(A===lt){if(K===lt&&(S=I.isGlobstar=!0),y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===_s){if(y=I.isGlob=!0,q=!0,n===!0)continue;break}if(A===Xn){for(;G()!==!0&&(j=P());){if(j===Ae){H=I.backslashes=!0,P();continue}if(j===Jn){m=I.isBracket=!0,y=I.isGlob=!0,q=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&A===ft&&u===f){F=I.negated=!0,f++;continue}if(t.noparen!==!0&&A===ht){if(y=I.isGlob=!0,n===!0){for(;G()!==!0&&(A=P());){if(A===ht){H=I.backslashes=!0,A=P();continue}if(A===Es){q=!0;break}}continue}break}if(y===!0){if(q=!0,n===!0)continue;break}}t.noext===!0&&(R=!1,y=!1);let N=c,le="",h="";f>0&&(le=c.slice(0,f),c=c.slice(f),d-=f),N&&y===!0&&d>0?(N=c.slice(0,d),h=c.slice(d)):y===!0?(N="",h=c):N=c,N&&N!==""&&N!=="/"&&N!==c&&gs(N.charCodeAt(N.length-1))&&(N=N.slice(0,-1)),t.unescape===!0&&(h&&(h=ps.removeBackslashes(h)),N&&H===!0&&(N=ps.removeBackslashes(N)));let p={prefix:le,input:s,start:f,base:N,glob:h,isBrace:l,isBracket:m,isGlob:y,isExtglob:R,isGlobstar:S,negated:F,negatedExtglob:te};if(t.tokens===!0&&(p.maxDepth=0,gs(A)||i.push(I),p.tokens=i),t.parts===!0||t.tokens===!0){let j;for(let b=0;b<o.length;b++){let se=j?j+1:f,re=o[b],z=s.slice(se,re);t.tokens&&(b===0&&f!==0?(i[b].isPrefix=!0,i[b].value=le):i[b].value=z,ms(i[b]),p.maxDepth+=i[b].depth),(b!==0||z!=="")&&a.push(z),j=re}if(j&&j+1<s.length){let b=s.slice(j+1);a.push(b),t.tokens&&(i[i.length-1].value=b,ms(i[i.length-1]),p.maxDepth+=i[i.length-1].depth)}p.slashes=o,p.parts=a}return p};ws.exports=ei});var Ts=v((_c,Ss)=>{"use strict";var $e=Re(),X=Fe(),{MAX_LENGTH:Ue,POSIX_REGEX_SOURCE:ti,REGEX_NON_SPECIAL_CHARS:si,REGEX_SPECIAL_CHARS_BACKREF:ri,REPLACEMENTS:As}=$e,ni=(s,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...s,e);s.sort();let t=`[${s.join("-")}]`;try{new RegExp(t)}catch{return s.map(n=>X.escapeRegex(n)).join("..")}return t},Ee=(s,e)=>`Missing ${s}: "${e}" - use "\\\\${e}" to match literal characters`,pt=(s,e)=>{if(typeof s!="string")throw new TypeError("Expected a string");s=As[s]||s;let t={...e},r=typeof t.maxLength=="number"?Math.min(Ue,t.maxLength):Ue,n=s.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);let o={type:"bos",value:"",output:t.prepend||""},i=[o],a=t.capture?"":"?:",c=X.isWindows(e),u=$e.globChars(c),f=$e.extglobChars(u),{DOT_LITERAL:d,PLUS_LITERAL:l,SLASH_LITERAL:m,ONE_CHAR:y,DOTS_SLASH:R,NO_DOT:S,NO_DOT_SLASH:x,NO_DOTS_SLASH:H,QMARK:F,QMARK_NO_DOT:te,STAR:q,START_ANCHOR:ce}=u,K=g=>`(${a}(?:(?!${ce}${g.dot?R:d}).)*?)`,A=t.dot?"":S,I=t.dot?F:te,G=t.bash===!0?K(t):q;t.capture&&(G=`(${G})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:s,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};s=X.removePrefix(s,_),n=s.length;let P=[],N=[],le=[],h=o,p,j=()=>_.index===n-1,b=_.peek=(g=1)=>s[_.index+g],se=_.advance=()=>s[++_.index]||"",re=()=>s.slice(_.index+1),z=(g="",O=0)=>{_.consumed+=g,_.index+=O},Oe=g=>{_.output+=g.output!=null?g.output:g.value,z(g.value)},Rn=()=>{let g=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)se(),_.start++,g++;return g%2===0?!1:(_.negated=!0,_.start++,!0)},Pe=g=>{_[g]++,le.push(g)},fe=g=>{_[g]--,le.pop()},C=g=>{if(h.type==="globstar"){let O=_.braces>0&&(g.type==="comma"||g.type==="brace"),E=g.extglob===!0||P.length&&(g.type==="pipe"||g.type==="paren");g.type!=="slash"&&g.type!=="paren"&&!O&&!E&&(_.output=_.output.slice(0,-h.output.length),h.type="star",h.value="*",h.output=G,_.output+=h.output)}if(P.length&&g.type!=="paren"&&(P[P.length-1].inner+=g.value),(g.value||g.output)&&Oe(g),h&&h.type==="text"&&g.type==="text"){h.value+=g.value,h.output=(h.output||"")+g.value;return}g.prev=h,i.push(g),h=g},Le=(g,O)=>{let E={...f[O],conditions:1,inner:""};E.prev=h,E.parens=_.parens,E.output=_.output;let T=(t.capture?"(":"")+E.open;Pe("parens"),C({type:g,value:O,output:_.output?"":y}),C({type:"paren",extglob:!0,value:se(),output:T}),P.push(E)},An=g=>{let O=g.close+(t.capture?")":""),E;if(g.type==="negate"){let T=G;if(g.inner&&g.inner.length>1&&g.inner.includes("/")&&(T=K(t)),(T!==G||j()||/^\)+$/.test(re()))&&(O=g.close=`)$))${T}`),g.inner.includes("*")&&(E=re())&&/^\.[^\\/.]+$/.test(E)){let D=pt(E,{...e,fastpaths:!1}).output;O=g.close=`)${D})${T})`}g.prev.type==="bos"&&(_.negatedExtglob=!0)}C({type:"paren",extglob:!0,value:p,output:O}),fe("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(s)){let g=!1,O=s.replace(ri,(E,T,D,V,M,ot)=>V==="\\"?(g=!0,E):V==="?"?T?T+V+(M?F.repeat(M.length):""):ot===0?I+(M?F.repeat(M.length):""):F.repeat(D.length):V==="."?d.repeat(D.length):V==="*"?T?T+V+(M?G:""):G:T?E:`\\${E}`);return g===!0&&(t.unescape===!0?O=O.replace(/\\/g,""):O=O.replace(/\\+/g,E=>E.length%2===0?"\\\\":E?"\\":"")),O===s&&t.contains===!0?(_.output=s,_):(_.output=X.wrapOutput(O,_,e),_)}for(;!j();){if(p=se(),p==="\0")continue;if(p==="\\"){let E=b();if(E==="/"&&t.bash!==!0||E==="."||E===";")continue;if(!E){p+="\\",C({type:"text",value:p});continue}let T=/^\\+/.exec(re()),D=0;if(T&&T[0].length>2&&(D=T[0].length,_.index+=D,D%2!==0&&(p+="\\")),t.unescape===!0?p=se():p+=se(),_.brackets===0){C({type:"text",value:p});continue}}if(_.brackets>0&&(p!=="]"||h.value==="["||h.value==="[^")){if(t.posix!==!1&&p===":"){let E=h.value.slice(1);if(E.includes("[")&&(h.posix=!0,E.includes(":"))){let T=h.value.lastIndexOf("["),D=h.value.slice(0,T),V=h.value.slice(T+2),M=ti[V];if(M){h.value=D+M,_.backtrack=!0,se(),!o.output&&i.indexOf(h)===1&&(o.output=y);continue}}}(p==="["&&b()!==":"||p==="-"&&b()==="]")&&(p=`\\${p}`),p==="]"&&(h.value==="["||h.value==="[^")&&(p=`\\${p}`),t.posix===!0&&p==="!"&&h.value==="["&&(p="^"),h.value+=p,Oe({value:p});continue}if(_.quotes===1&&p!=='"'){p=X.escapeRegex(p),h.value+=p,Oe({value:p});continue}if(p==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&C({type:"text",value:p});continue}if(p==="("){Pe("parens"),C({type:"paren",value:p});continue}if(p===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ee("opening","("));let E=P[P.length-1];if(E&&_.parens===E.parens+1){An(P.pop());continue}C({type:"paren",value:p,output:_.parens?")":"\\)"}),fe("parens");continue}if(p==="["){if(t.nobracket===!0||!re().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));p=`\\${p}`}else Pe("brackets");C({type:"bracket",value:p});continue}if(p==="]"){if(t.nobracket===!0||h&&h.type==="bracket"&&h.value.length===1){C({type:"text",value:p,output:`\\${p}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ee("opening","["));C({type:"text",value:p,output:`\\${p}`});continue}fe("brackets");let E=h.value.slice(1);if(h.posix!==!0&&E[0]==="^"&&!E.includes("/")&&(p=`/${p}`),h.value+=p,Oe({value:p}),t.literalBrackets===!1||X.hasRegexChars(E))continue;let T=X.escapeRegex(h.value);if(_.output=_.output.slice(0,-h.value.length),t.literalBrackets===!0){_.output+=T,h.value=T;continue}h.value=`(${a}${T}|${h.value})`,_.output+=h.value;continue}if(p==="{"&&t.nobrace!==!0){Pe("braces");let E={type:"brace",value:p,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};N.push(E),C(E);continue}if(p==="}"){let E=N[N.length-1];if(t.nobrace===!0||!E){C({type:"text",value:p,output:p});continue}let T=")";if(E.dots===!0){let D=i.slice(),V=[];for(let M=D.length-1;M>=0&&(i.pop(),D[M].type!=="brace");M--)D[M].type!=="dots"&&V.unshift(D[M].value);T=ni(V,t),_.backtrack=!0}if(E.comma!==!0&&E.dots!==!0){let D=_.output.slice(0,E.outputIndex),V=_.tokens.slice(E.tokensIndex);E.value=E.output="\\{",p=T="\\}",_.output=D;for(let M of V)_.output+=M.output||M.value}C({type:"brace",value:p,output:T}),fe("braces"),N.pop();continue}if(p==="|"){P.length>0&&P[P.length-1].conditions++,C({type:"text",value:p});continue}if(p===","){let E=p,T=N[N.length-1];T&&le[le.length-1]==="braces"&&(T.comma=!0,E="|"),C({type:"comma",value:p,output:E});continue}if(p==="/"){if(h.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",i.pop(),h=o;continue}C({type:"slash",value:p,output:m});continue}if(p==="."){if(_.braces>0&&h.type==="dot"){h.value==="."&&(h.output=d);let E=N[N.length-1];h.type="dots",h.output+=p,h.value+=p,E.dots=!0;continue}if(_.braces+_.parens===0&&h.type!=="bos"&&h.type!=="slash"){C({type:"text",value:p,output:d});continue}C({type:"dot",value:p,output:d});continue}if(p==="?"){if(!(h&&h.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){Le("qmark",p);continue}if(h&&h.type==="paren"){let T=b(),D=p;if(T==="<"&&!X.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(h.value==="("&&!/[!=<:]/.test(T)||T==="<"&&!/<([!=]|\w+>)/.test(re()))&&(D=`\\${p}`),C({type:"text",value:p,output:D});continue}if(t.dot!==!0&&(h.type==="slash"||h.type==="bos")){C({type:"qmark",value:p,output:te});continue}C({type:"qmark",value:p,output:F});continue}if(p==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){Le("negate",p);continue}if(t.nonegate!==!0&&_.index===0){Rn();continue}}if(p==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){Le("plus",p);continue}if(h&&h.value==="("||t.regex===!1){C({type:"plus",value:p,output:l});continue}if(h&&(h.type==="bracket"||h.type==="paren"||h.type==="brace")||_.parens>0){C({type:"plus",value:p});continue}C({type:"plus",value:l});continue}if(p==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){C({type:"at",extglob:!0,value:p,output:""});continue}C({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);let E=si.exec(re());E&&(p+=E[0],_.index+=E[0].length),C({type:"text",value:p});continue}if(h&&(h.type==="globstar"||h.star===!0)){h.type="star",h.star=!0,h.value+=p,h.output=G,_.backtrack=!0,_.globstar=!0,z(p);continue}let g=re();if(t.noextglob!==!0&&/^\([^?]/.test(g)){Le("star",p);continue}if(h.type==="star"){if(t.noglobstar===!0){z(p);continue}let E=h.prev,T=E.prev,D=E.type==="slash"||E.type==="bos",V=T&&(T.type==="star"||T.type==="globstar");if(t.bash===!0&&(!D||g[0]&&g[0]!=="/")){C({type:"star",value:p,output:""});continue}let M=_.braces>0&&(E.type==="comma"||E.type==="brace"),ot=P.length&&(E.type==="pipe"||E.type==="paren");if(!D&&E.type!=="paren"&&!M&&!ot){C({type:"star",value:p,output:""});continue}for(;g.slice(0,3)==="/**";){let He=s[_.index+4];if(He&&He!=="/")break;g=g.slice(3),z("/**",3)}if(E.type==="bos"&&j()){h.type="globstar",h.value+=p,h.output=K(t),_.output=h.output,_.globstar=!0,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&!V&&j()){_.output=_.output.slice(0,-(E.output+h.output).length),E.output=`(?:${E.output}`,h.type="globstar",h.output=K(t)+(t.strictSlashes?")":"|$)"),h.value+=p,_.globstar=!0,_.output+=E.output+h.output,z(p);continue}if(E.type==="slash"&&E.prev.type!=="bos"&&g[0]==="/"){let He=g[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(E.output+h.output).length),E.output=`(?:${E.output}`,h.type="globstar",h.output=`${K(t)}${m}|${m}${He})`,h.value+=p,_.output+=E.output+h.output,_.globstar=!0,z(p+se()),C({type:"slash",value:"/",output:""});continue}if(E.type==="bos"&&g[0]==="/"){h.type="globstar",h.value+=p,h.output=`(?:^|${m}|${K(t)}${m})`,_.output=h.output,_.globstar=!0,z(p+se()),C({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-h.output.length),h.type="globstar",h.output=K(t),h.value+=p,_.output+=h.output,_.globstar=!0,z(p);continue}let O={type:"star",value:p,output:G};if(t.bash===!0){O.output=".*?",(h.type==="bos"||h.type==="slash")&&(O.output=A+O.output),C(O);continue}if(h&&(h.type==="bracket"||h.type==="paren")&&t.regex===!0){O.output=p,C(O);continue}(_.index===_.start||h.type==="slash"||h.type==="dot")&&(h.type==="dot"?(_.output+=x,h.output+=x):t.dot===!0?(_.output+=H,h.output+=H):(_.output+=A,h.output+=A),b()!=="*"&&(_.output+=y,h.output+=y)),C(O)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ee("closing","]"));_.output=X.escapeLast(_.output,"["),fe("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ee("closing",")"));_.output=X.escapeLast(_.output,"("),fe("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ee("closing","}"));_.output=X.escapeLast(_.output,"{"),fe("braces")}if(t.strictSlashes!==!0&&(h.type==="star"||h.type==="bracket")&&C({type:"maybe_slash",value:"",output:`${m}?`}),_.backtrack===!0){_.output="";for(let g of _.tokens)_.output+=g.output!=null?g.output:g.value,g.suffix&&(_.output+=g.suffix)}return _};pt.fastpaths=(s,e)=>{let t={...e},r=typeof t.maxLength=="number"?Math.min(Ue,t.maxLength):Ue,n=s.length;if(n>r)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${r}`);s=As[s]||s;let o=X.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:l,STAR:m,START_ANCHOR:y}=$e.globChars(o),R=t.dot?d:f,S=t.dot?l:f,x=t.capture?"":"?:",H={negated:!1,prefix:""},F=t.bash===!0?".*?":m;t.capture&&(F=`(${F})`);let te=A=>A.noglobstar===!0?F:`(${x}(?:(?!${y}${A.dot?u:i}).)*?)`,q=A=>{switch(A){case"*":return`${R}${c}${F}`;case".*":return`${i}${c}${F}`;case"*.*":return`${R}${F}${i}${c}${F}`;case"*/*":return`${R}${F}${a}${c}${S}${F}`;case"**":return R+te(t);case"**/*":return`(?:${R}${te(t)}${a})?${S}${c}${F}`;case"**/*.*":return`(?:${R}${te(t)}${a})?${S}${F}${i}${c}${F}`;case"**/.*":return`(?:${R}${te(t)}${a})?${i}${c}${F}`;default:{let I=/^(.*?)\.(\w+)$/.exec(A);if(!I)return;let G=q(I[1]);return G?G+i+I[2]:void 0}}},ce=X.removePrefix(s,H),K=q(ce);return K&&t.strictSlashes!==!0&&(K+=`${a}?`),K};Ss.exports=pt});var xs=v((Ec,Cs)=>{"use strict";var ii=L("path"),oi=Rs(),_t=Ts(),Et=Fe(),ai=Re(),ci=s=>s&&typeof s=="object"&&!Array.isArray(s),U=(s,e,t=!1)=>{if(Array.isArray(s)){let f=s.map(l=>U(l,e,t));return l=>{for(let m of f){let y=m(l);if(y)return y}return!1}}let r=ci(s)&&s.tokens&&s.input;if(s===""||typeof s!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},o=Et.isWindows(e),i=r?U.compileRe(s,e):U.makeRe(s,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(n.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=U(n.ignore,f,t)}let u=(f,d=!1)=>{let{isMatch:l,match:m,output:y}=U.test(f,i,e,{glob:s,posix:o}),R={glob:s,state:a,regex:i,posix:o,input:f,output:y,match:m,isMatch:l};return typeof n.onResult=="function"&&n.onResult(R),l===!1?(R.isMatch=!1,d?R:!1):c(f)?(typeof n.onIgnore=="function"&&n.onIgnore(R),R.isMatch=!1,d?R:!1):(typeof n.onMatch=="function"&&n.onMatch(R),d?R:!0)};return t&&(u.state=a),u};U.test=(s,e,t,{glob:r,posix:n}={})=>{if(typeof s!="string")throw new TypeError("Expected input to be a string");if(s==="")return{isMatch:!1,output:""};let o=t||{},i=o.format||(n?Et.toPosixSlashes:null),a=s===r,c=a&&i?i(s):s;return a===!1&&(c=i?i(s):s,a=c===r),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=U.matchBase(s,e,t,n):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};U.matchBase=(s,e,t,r=Et.isWindows(t))=>(e instanceof RegExp?e:U.makeRe(e,t)).test(ii.basename(s));U.isMatch=(s,e,t)=>U(e,t)(s);U.parse=(s,e)=>Array.isArray(s)?s.map(t=>U.parse(t,e)):_t(s,{...e,fastpaths:!1});U.scan=(s,e)=>oi(s,e);U.compileRe=(s,e,t=!1,r=!1)=>{if(t===!0)return s.output;let n=e||{},o=n.contains?"":"^",i=n.contains?"":"$",a=`${o}(?:${s.output})${i}`;s&&s.negated===!0&&(a=`^(?!${a}).*$`);let c=U.toRegex(a,e);return r===!0&&(c.state=s),c};U.makeRe=(s,e={},t=!1,r=!1)=>{if(!s||typeof s!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(s[0]==="."||s[0]==="*")&&(n.output=_t.fastpaths(s,e)),n.output||(n=_t(s,e)),U.compileRe(n,e,t,r)};U.toRegex=(s,e)=>{try{let t=e||{};return new RegExp(s,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};U.constants=ai;Cs.exports=U});var gt=v((gc,bs)=>{"use strict";bs.exports=xs()});var Hs=v((mc,Ls)=>{"use strict";var Te=L("fs"),{Readable:li}=L("stream"),Se=L("path"),{promisify:Ge}=L("util"),mt=gt(),ui=Ge(Te.readdir),fi=Ge(Te.stat),Is=Ge(Te.lstat),di=Ge(Te.realpath),hi="!",Os="READDIRP_RECURSIVE_ERROR",pi=new Set(["ENOENT","EPERM","EACCES","ELOOP",Os]),yt="files",Ps="directories",We="files_directories",Me="all",vs=[yt,Ps,We,Me],_i=s=>pi.has(s.code),[ks,Ei]=process.versions.node.split(".").slice(0,2).map(s=>Number.parseInt(s,10)),gi=process.platform==="win32"&&(ks>10||ks===10&&Ei>=5),Ns=s=>{if(s!==void 0){if(typeof s=="function")return s;if(typeof s=="string"){let e=mt(s.trim());return t=>e(t.basename)}if(Array.isArray(s)){let e=[],t=[];for(let r of s){let n=r.trim();n.charAt(0)===hi?t.push(mt(n.slice(1))):e.push(mt(n))}return t.length>0?e.length>0?r=>e.some(n=>n(r.basename))&&!t.some(n=>n(r.basename)):r=>!t.some(n=>n(r.basename)):r=>e.some(n=>n(r.basename))}}},Be=class s extends li{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:yt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...s.defaultOptions,...e},{root:r,type:n}=t;this._fileFilter=Ns(t.fileFilter),this._directoryFilter=Ns(t.directoryFilter);let o=t.lstat?Is:fi;gi?this._stat=i=>o(i,{bigint:!0}):this._stat=o,this._maxDepth=t.depth,this._wantsDir=[Ps,We,Me].includes(n),this._wantsFile=[yt,We,Me].includes(n),this._wantsEverything=n===Me,this._root=Se.resolve(r),this._isDirent="Dirent"in Te&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:t,depth:r,files:n=[]}=this.parent||{};if(n.length>0){let o=n.splice(0,e).map(i=>this._formatEntry(i,t));for(let i of await Promise.all(o)){if(this.destroyed)return;let a=await this._getEntryType(i);a==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(a==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let r;try{r=await ui(e,this._rdOptions)}catch(n){this._onError(n)}return{files:r,depth:t,path:e}}async _formatEntry(e,t){let r;try{let n=this._isDirent?e.name:e,o=Se.resolve(Se.join(t,n));r={path:Se.relative(this._root,o),fullPath:o,basename:n},r[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(n){this._onError(n)}return r}_onError(e){_i(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let r=e.fullPath;try{let n=await di(r),o=await Is(n);if(o.isFile())return"file";if(o.isDirectory()){let i=n.length;if(r.startsWith(n)&&r.substr(i,1)===Se.sep){let a=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return a.code=Os,this._onError(a)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},ge=(s,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=We),t&&(e.type=t),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!vs.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${vs.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=s,new Be(e)},mi=(s,e={})=>new Promise((t,r)=>{let n=[];ge(s,e).on("data",o=>n.push(o)).on("end",()=>t(n)).on("error",o=>r(o))});ge.promise=mi;ge.ReaddirpStream=Be;ge.default=ge;Ls.exports=ge});var wt=v((yc,Ds)=>{Ds.exports=function(s,e){if(typeof s!="string")throw new TypeError("expected path to be a string");if(s==="\\"||s==="/")return"/";var t=s.length;if(t<=1)return s;var r="";if(t>4&&s[3]==="\\"){var n=s[2];(n==="?"||n===".")&&s.slice(0,2)==="\\\\"&&(s=s.slice(2),r="//")}var o=s.split(/[/\\]+/);return e!==!1&&o[o.length-1]===""&&o.pop(),r+o.join("/")}});var Bs=v((Ms,Ws)=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var Us=gt(),yi=wt(),Fs="!",wi={returnIndex:!1},Ri=s=>Array.isArray(s)?s:[s],Ai=(s,e)=>{if(typeof s=="function")return s;if(typeof s=="string"){let t=Us(s,e);return r=>s===r||t(r)}return s instanceof RegExp?t=>s.test(t):t=>!1},$s=(s,e,t,r)=>{let n=Array.isArray(t),o=n?t[0]:t;if(!n&&typeof o!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(o));let i=yi(o,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(i))return r?-1:!1}let a=n&&[i].concat(t.slice(1));for(let c=0;c<s.length;c++){let u=s[c];if(n?u(...a):u(i))return r?c:!0}return r?-1:!1},Rt=(s,e,t=wi)=>{if(s==null)throw new TypeError("anymatch: specify first argument");let r=typeof t=="boolean"?{returnIndex:t}:t,n=r.returnIndex||!1,o=Ri(s),i=o.filter(c=>typeof c=="string"&&c.charAt(0)===Fs).map(c=>c.slice(1)).map(c=>Us(c,r)),a=o.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==Fs).map(c=>Ai(c,r));return e==null?(c,u=!1)=>$s(a,i,c,typeof u=="boolean"?u:!1):$s(a,i,e,n)};Rt.default=Rt;Ws.exports=Rt});var qs=v((wc,Gs)=>{Gs.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var At=v((Rc,js)=>{var Si=qs(),Ks={"{":"}","(":")","[":"]"},Ti=function(s){if(s[0]==="!")return!0;for(var e=0,t=-2,r=-2,n=-2,o=-2,i=-2;e<s.length;){if(s[e]==="*"||s[e+1]==="?"&&/[\].+)]/.test(s[e])||r!==-1&&s[e]==="["&&s[e+1]!=="]"&&(r<e&&(r=s.indexOf("]",e)),r>e&&(i===-1||i>r||(i=s.indexOf("\\",e),i===-1||i>r)))||n!==-1&&s[e]==="{"&&s[e+1]!=="}"&&(n=s.indexOf("}",e),n>e&&(i=s.indexOf("\\",e),i===-1||i>n))||o!==-1&&s[e]==="("&&s[e+1]==="?"&&/[:!=]/.test(s[e+2])&&s[e+3]!==")"&&(o=s.indexOf(")",e),o>e&&(i=s.indexOf("\\",e),i===-1||i>o))||t!==-1&&s[e]==="("&&s[e+1]!=="|"&&(t<e&&(t=s.indexOf("|",e)),t!==-1&&s[t+1]!==")"&&(o=s.indexOf(")",t),o>t&&(i=s.indexOf("\\",t),i===-1||i>o))))return!0;if(s[e]==="\\"){var a=s[e+1];e+=2;var c=Ks[a];if(c){var u=s.indexOf(c,e);u!==-1&&(e=u+1)}if(s[e]==="!")return!0}else e++}return!1},Ci=function(s){if(s[0]==="!")return!0;for(var e=0;e<s.length;){if(/[*?{}()[\]]/.test(s[e]))return!0;if(s[e]==="\\"){var t=s[e+1];e+=2;var r=Ks[t];if(r){var n=s.indexOf(r,e);n!==-1&&(e=n+1)}if(s[e]==="!")return!0}else e++}return!1};js.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(Si(e))return!0;var r=Ti;return t&&t.strict===!1&&(r=Ci),r(e)}});var Ys=v((Ac,Vs)=>{"use strict";var xi=At(),bi=L("path").posix.dirname,Ii=L("os").platform()==="win32",St="/",vi=/\\/g,ki=/[\{\[].*[\}\]]$/,Ni=/(^|[^\\])([\{\[]|\([^\)]+$)/,Oi=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Vs.exports=function(e,t){var r=Object.assign({flipBackslashes:!0},t);r.flipBackslashes&&Ii&&e.indexOf(St)<0&&(e=e.replace(vi,St)),ki.test(e)&&(e+=St),e+="a";do e=bi(e);while(xi(e)||Ni.test(e));return e.replace(Oi,"$1")}});var qe=v(Z=>{"use strict";Z.isInteger=s=>typeof s=="number"?Number.isInteger(s):typeof s=="string"&&s.trim()!==""?Number.isInteger(Number(s)):!1;Z.find=(s,e)=>s.nodes.find(t=>t.type===e);Z.exceedsLimit=(s,e,t=1,r)=>r===!1||!Z.isInteger(s)||!Z.isInteger(e)?!1:(Number(e)-Number(s))/Number(t)>=r;Z.escapeNode=(s,e=0,t)=>{let r=s.nodes[e];r&&(t&&r.type===t||r.type==="open"||r.type==="close")&&r.escaped!==!0&&(r.value="\\"+r.value,r.escaped=!0)};Z.encloseBrace=s=>s.type!=="brace"||s.commas>>0+s.ranges>>0?!1:(s.invalid=!0,!0);Z.isInvalidBrace=s=>s.type!=="brace"?!1:s.invalid===!0||s.dollar?!0:!(s.commas>>0+s.ranges>>0)||s.open!==!0||s.close!==!0?(s.invalid=!0,!0):!1;Z.isOpenOrClose=s=>s.type==="open"||s.type==="close"?!0:s.open===!0||s.close===!0;Z.reduce=s=>s.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);Z.flatten=(...s)=>{let e=[],t=r=>{for(let n=0;n<r.length;n++){let o=r[n];Array.isArray(o)?t(o,e):o!==void 0&&e.push(o)}return e};return t(s),e}});var Ke=v((Tc,Xs)=>{"use strict";var zs=qe();Xs.exports=(s,e={})=>{let t=(r,n={})=>{let o=e.escapeInvalid&&zs.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a="";if(r.value)return(o||i)&&zs.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let c of r.nodes)a+=t(c);return a};return t(s)}});var Zs=v((Cc,Qs)=>{"use strict";Qs.exports=function(s){return typeof s=="number"?s-s===0:typeof s=="string"&&s.trim()!==""?Number.isFinite?Number.isFinite(+s):isFinite(+s):!1}});var ar=v((xc,or)=>{"use strict";var Js=Zs(),de=(s,e,t)=>{if(Js(s)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||s===e)return String(s);if(Js(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...t};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let n=String(r.relaxZeros),o=String(r.shorthand),i=String(r.capture),a=String(r.wrap),c=s+":"+e+"="+n+o+i+a;if(de.cache.hasOwnProperty(c))return de.cache[c].result;let u=Math.min(s,e),f=Math.max(s,e);if(Math.abs(u-f)===1){let R=s+"|"+e;return r.capture?`(${R})`:r.wrap===!1?R:`(?:${R})`}let d=ir(s)||ir(e),l={min:s,max:e,a:u,b:f},m=[],y=[];if(d&&(l.isPadded=d,l.maxLen=String(l.max).length),u<0){let R=f<0?Math.abs(f):1;y=er(R,Math.abs(u),l,r),u=l.a=0}return f>=0&&(m=er(u,f,l,r)),l.negatives=y,l.positives=m,l.result=Pi(y,m,r),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&m.length+y.length>1&&(l.result=`(?:${l.result})`),de.cache[c]=l,l.result};function Pi(s,e,t){let r=Tt(s,e,"-",!1,t)||[],n=Tt(e,s,"",!1,t)||[],o=Tt(s,e,"-?",!0,t)||[];return r.concat(o).concat(n).join("|")}function Li(s,e){let t=1,r=1,n=sr(s,t),o=new Set([e]);for(;s<=n&&n<=e;)o.add(n),t+=1,n=sr(s,t);for(n=rr(e+1,r)-1;s<n&&n<=e;)o.add(n),r+=1,n=rr(e+1,r)-1;return o=[...o],o.sort(Fi),o}function Hi(s,e,t){if(s===e)return{pattern:s,count:[],digits:0};let r=Di(s,e),n=r.length,o="",i=0;for(let a=0;a<n;a++){let[c,u]=r[a];c===u?o+=c:c!=="0"||u!=="9"?o+=$i(c,u,t):i++}return i&&(o+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[i],digits:n}}function er(s,e,t,r){let n=Li(s,e),o=[],i=s,a;for(let c=0;c<n.length;c++){let u=n[c],f=Hi(String(i),String(u),r),d="";if(!t.isPadded&&a&&a.pattern===f.pattern){a.count.length>1&&a.count.pop(),a.count.push(f.count[0]),a.string=a.pattern+nr(a.count),i=u+1;continue}t.isPadded&&(d=Ui(u,t,r)),f.string=d+f.pattern+nr(f.count),o.push(f),i=u+1,a=f}return o}function Tt(s,e,t,r,n){let o=[];for(let i of s){let{string:a}=i;!r&&!tr(e,"string",a)&&o.push(t+a),r&&tr(e,"string",a)&&o.push(t+a)}return o}function Di(s,e){let t=[];for(let r=0;r<s.length;r++)t.push([s[r],e[r]]);return t}function Fi(s,e){return s>e?1:e>s?-1:0}function tr(s,e,t){return s.some(r=>r[e]===t)}function sr(s,e){return Number(String(s).slice(0,-e)+"9".repeat(e))}function rr(s,e){return s-s%Math.pow(10,e)}function nr(s){let[e=0,t=""]=s;return t||e>1?`{${e+(t?","+t:"")}}`:""}function $i(s,e,t){return`[${s}${e-s===1?"":"-"}${e}]`}function ir(s){return/^-?(0+)\d/.test(s)}function Ui(s,e,t){if(!e.isPadded)return s;let r=Math.abs(e.maxLen-String(s).length),n=t.relaxZeros!==!1;switch(r){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${r}}`:`0{${r}}`}}de.cache={};de.clearCache=()=>de.cache={};or.exports=de});var bt=v((bc,_r)=>{"use strict";var Mi=L("util"),ur=ar(),cr=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),Wi=s=>e=>s===!0?Number(e):String(e),Ct=s=>typeof s=="number"||typeof s=="string"&&s!=="",Ce=s=>Number.isInteger(+s),xt=s=>{let e=`${s}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},Bi=(s,e,t)=>typeof s=="string"||typeof e=="string"?!0:t.stringify===!0,Gi=(s,e,t)=>{if(e>0){let r=s[0]==="-"?"-":"";r&&(s=s.slice(1)),s=r+s.padStart(r?e-1:e,"0")}return t===!1?String(s):s},lr=(s,e)=>{let t=s[0]==="-"?"-":"";for(t&&(s=s.slice(1),e--);s.length<e;)s="0"+s;return t?"-"+s:s},qi=(s,e)=>{s.negatives.sort((i,a)=>i<a?-1:i>a?1:0),s.positives.sort((i,a)=>i<a?-1:i>a?1:0);let t=e.capture?"":"?:",r="",n="",o;return s.positives.length&&(r=s.positives.join("|")),s.negatives.length&&(n=`-(${t}${s.negatives.join("|")})`),r&&n?o=`${r}|${n}`:o=r||n,e.wrap?`(${t}${o})`:o},fr=(s,e,t,r)=>{if(t)return ur(s,e,{wrap:!1,...r});let n=String.fromCharCode(s);if(s===e)return n;let o=String.fromCharCode(e);return`[${n}-${o}]`},dr=(s,e,t)=>{if(Array.isArray(s)){let r=t.wrap===!0,n=t.capture?"":"?:";return r?`(${n}${s.join("|")})`:s.join("|")}return ur(s,e,t)},hr=(...s)=>new RangeError("Invalid range arguments: "+Mi.inspect(...s)),pr=(s,e,t)=>{if(t.strictRanges===!0)throw hr([s,e]);return[]},Ki=(s,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${s}" to be a number`);return[]},ji=(s,e,t=1,r={})=>{let n=Number(s),o=Number(e);if(!Number.isInteger(n)||!Number.isInteger(o)){if(r.strictRanges===!0)throw hr([s,e]);return[]}n===0&&(n=0),o===0&&(o=0);let i=n>o,a=String(s),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let f=xt(a)||xt(c)||xt(u),d=f?Math.max(a.length,c.length,u.length):0,l=f===!1&&Bi(s,e,r)===!1,m=r.transform||Wi(l);if(r.toRegex&&t===1)return fr(lr(s,d),lr(e,d),!0,r);let y={negatives:[],positives:[]},R=H=>y[H<0?"negatives":"positives"].push(Math.abs(H)),S=[],x=0;for(;i?n>=o:n<=o;)r.toRegex===!0&&t>1?R(n):S.push(Gi(m(n,x),d,l)),n=i?n-t:n+t,x++;return r.toRegex===!0?t>1?qi(y,r):dr(S,null,{wrap:!1,...r}):S},Vi=(s,e,t=1,r={})=>{if(!Ce(s)&&s.length>1||!Ce(e)&&e.length>1)return pr(s,e,r);let n=r.transform||(l=>String.fromCharCode(l)),o=`${s}`.charCodeAt(0),i=`${e}`.charCodeAt(0),a=o>i,c=Math.min(o,i),u=Math.max(o,i);if(r.toRegex&&t===1)return fr(c,u,!1,r);let f=[],d=0;for(;a?o>=i:o<=i;)f.push(n(o,d)),o=a?o-t:o+t,d++;return r.toRegex===!0?dr(f,null,{wrap:!1,options:r}):f},je=(s,e,t,r={})=>{if(e==null&&Ct(s))return[s];if(!Ct(s)||!Ct(e))return pr(s,e,r);if(typeof t=="function")return je(s,e,1,{transform:t});if(cr(t))return je(s,e,0,t);let n={...r};return n.capture===!0&&(n.wrap=!0),t=t||n.step||1,Ce(t)?Ce(s)&&Ce(e)?ji(s,e,t,n):Vi(s,e,Math.max(Math.abs(t),1),n):t!=null&&!cr(t)?Ki(t,n):je(s,e,1,t)};_r.exports=je});var mr=v((Ic,gr)=>{"use strict";var Yi=bt(),Er=qe(),zi=(s,e={})=>{let t=(r,n={})=>{let o=Er.isInvalidBrace(n),i=r.invalid===!0&&e.escapeInvalid===!0,a=o===!0||i===!0,c=e.escapeInvalid===!0?"\\":"",u="";if(r.isOpen===!0||r.isClose===!0)return c+r.value;if(r.type==="open")return a?c+r.value:"(";if(r.type==="close")return a?c+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=Er.reduce(r.nodes),d=Yi(...f,{...e,wrap:!1,toRegex:!0});if(d.length!==0)return f.length>1&&d.length>1?`(${d})`:d}if(r.nodes)for(let f of r.nodes)u+=t(f,r);return u};return t(s)};gr.exports=zi});var Rr=v((vc,wr)=>{"use strict";var Xi=bt(),yr=Ke(),me=qe(),he=(s="",e="",t=!1)=>{let r=[];if(s=[].concat(s),e=[].concat(e),!e.length)return s;if(!s.length)return t?me.flatten(e).map(n=>`{${n}}`):e;for(let n of s)if(Array.isArray(n))for(let o of n)r.push(he(o,e,t));else for(let o of e)t===!0&&typeof o=="string"&&(o=`{${o}}`),r.push(Array.isArray(o)?he(n,o,t):n+o);return me.flatten(r)},Qi=(s,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,r=(n,o={})=>{n.queue=[];let i=o,a=o.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,a=i.queue;if(n.invalid||n.dollar){a.push(he(a.pop(),yr(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(he(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let d=me.reduce(n.nodes);if(me.exceedsLimit(...d,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=Xi(...d,e);l.length===0&&(l=yr(n,e)),a.push(he(a.pop(),l)),n.nodes=[];return}let c=me.encloseBrace(n),u=n.queue,f=n;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,u=f.queue;for(let d=0;d<n.nodes.length;d++){let l=n.nodes[d];if(l.type==="comma"&&n.type==="brace"){d===1&&u.push(""),u.push("");continue}if(l.type==="close"){a.push(he(a.pop(),u,c));continue}if(l.value&&l.type!=="open"){u.push(he(u.pop(),l.value));continue}l.nodes&&r(l,n)}return u};return me.flatten(r(s))};wr.exports=Qi});var Sr=v((kc,Ar)=>{"use strict";Ar.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
2
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ir=v((Nc,br)=>{"use strict";var Zi=Ke(),{MAX_LENGTH:Tr,CHAR_BACKSLASH:It,CHAR_BACKTICK:Ji,CHAR_COMMA:eo,CHAR_DOT:to,CHAR_LEFT_PARENTHESES:so,CHAR_RIGHT_PARENTHESES:ro,CHAR_LEFT_CURLY_BRACE:no,CHAR_RIGHT_CURLY_BRACE:io,CHAR_LEFT_SQUARE_BRACKET:Cr,CHAR_RIGHT_SQUARE_BRACKET:xr,CHAR_DOUBLE_QUOTE:oo,CHAR_SINGLE_QUOTE:ao,CHAR_NO_BREAK_SPACE:co,CHAR_ZERO_WIDTH_NOBREAK_SPACE:lo}=Sr(),uo=(s,e={})=>{if(typeof s!="string")throw new TypeError("Expected a string");let t=e||{},r=typeof t.maxLength=="number"?Math.min(Tr,t.maxLength):Tr;if(s.length>r)throw new SyntaxError(`Input length (${s.length}), exceeds max characters (${r})`);let n={type:"root",input:s,nodes:[]},o=[n],i=n,a=n,c=0,u=s.length,f=0,d=0,l,m={},y=()=>s[f++],R=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return i.nodes.push(S),S.parent=i,S.prev=a,a=S,S};for(R({type:"bos"});f<u;)if(i=o[o.length-1],l=y(),!(l===lo||l===co)){if(l===It){R({type:"text",value:(e.keepEscaping?l:"")+y()});continue}if(l===xr){R({type:"text",value:"\\"+l});continue}if(l===Cr){c++;let S=!0,x;for(;f<u&&(x=y());){if(l+=x,x===Cr){c++;continue}if(x===It){l+=y();continue}if(x===xr&&(c--,c===0))break}R({type:"text",value:l});continue}if(l===so){i=R({type:"paren",nodes:[]}),o.push(i),R({type:"text",value:l});continue}if(l===ro){if(i.type!=="paren"){R({type:"text",value:l});continue}i=o.pop(),R({type:"text",value:l}),i=o[o.length-1];continue}if(l===oo||l===ao||l===Ji){let S=l,x;for(e.keepQuotes!==!0&&(l="");f<u&&(x=y());){if(x===It){l+=x+y();continue}if(x===S){e.keepQuotes===!0&&(l+=x);break}l+=x}R({type:"text",value:l});continue}if(l===no){d++;let x={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||i.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};i=R(x),o.push(i),R({type:"open",value:l});continue}if(l===io){if(i.type!=="brace"){R({type:"text",value:l});continue}let S="close";i=o.pop(),i.close=!0,R({type:S,value:l}),d--,i=o[o.length-1];continue}if(l===eo&&d>0){if(i.ranges>0){i.ranges=0;let S=i.nodes.shift();i.nodes=[S,{type:"text",value:Zi(i)}]}R({type:"comma",value:l}),i.commas++;continue}if(l===to&&d>0&&i.commas===0){let S=i.nodes;if(d===0||S.length===0){R({type:"text",value:l});continue}if(a.type==="dot"){if(i.range=[],a.value+=l,a.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,a.type="text";continue}i.ranges++,i.args=[];continue}if(a.type==="range"){S.pop();let x=S[S.length-1];x.value+=a.value+l,a=x,i.ranges--;continue}R({type:"dot",value:l});continue}R({type:"text",value:l})}do if(i=o.pop(),i.type!=="root"){i.nodes.forEach(H=>{H.nodes||(H.type==="open"&&(H.isOpen=!0),H.type==="close"&&(H.isClose=!0),H.nodes||(H.type="text"),H.invalid=!0)});let S=o[o.length-1],x=S.nodes.indexOf(i);S.nodes.splice(x,1,...i.nodes)}while(o.length>0);return R({type:"eos"}),n};br.exports=uo});var Nr=v((Oc,kr)=>{"use strict";var vr=Ke(),fo=mr(),ho=Rr(),po=Ir(),Q=(s,e={})=>{let t=[];if(Array.isArray(s))for(let r of s){let n=Q.create(r,e);Array.isArray(n)?t.push(...n):t.push(n)}else t=[].concat(Q.create(s,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};Q.parse=(s,e={})=>po(s,e);Q.stringify=(s,e={})=>vr(typeof s=="string"?Q.parse(s,e):s,e);Q.compile=(s,e={})=>(typeof s=="string"&&(s=Q.parse(s,e)),fo(s,e));Q.expand=(s,e={})=>{typeof s=="string"&&(s=Q.parse(s,e));let t=ho(s,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};Q.create=(s,e={})=>s===""||s.length<3?[s]:e.expand!==!0?Q.compile(s,e):Q.expand(s,e);kr.exports=Q});var Or=v((Pc,_o)=>{_o.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var Lr=v((Lc,Pr)=>{Pr.exports=Or()});var Dr=v((Hc,Hr)=>{"use strict";var Eo=L("path"),go=Lr(),mo=new Set(go);Hr.exports=s=>mo.has(Eo.extname(s).slice(1).toLowerCase())});var Ve=v(w=>{"use strict";var{sep:yo}=L("path"),{platform:vt}=process,wo=L("os");w.EV_ALL="all";w.EV_READY="ready";w.EV_ADD="add";w.EV_CHANGE="change";w.EV_ADD_DIR="addDir";w.EV_UNLINK="unlink";w.EV_UNLINK_DIR="unlinkDir";w.EV_RAW="raw";w.EV_ERROR="error";w.STR_DATA="data";w.STR_END="end";w.STR_CLOSE="close";w.FSEVENT_CREATED="created";w.FSEVENT_MODIFIED="modified";w.FSEVENT_DELETED="deleted";w.FSEVENT_MOVED="moved";w.FSEVENT_CLONED="cloned";w.FSEVENT_UNKNOWN="unknown";w.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;w.FSEVENT_TYPE_FILE="file";w.FSEVENT_TYPE_DIRECTORY="directory";w.FSEVENT_TYPE_SYMLINK="symlink";w.KEY_LISTENERS="listeners";w.KEY_ERR="errHandlers";w.KEY_RAW="rawEmitters";w.HANDLER_KEYS=[w.KEY_LISTENERS,w.KEY_ERR,w.KEY_RAW];w.DOT_SLASH=`.${yo}`;w.BACK_SLASH_RE=/\\/g;w.DOUBLE_SLASH_RE=/\/\//;w.SLASH_OR_BACK_SLASH_RE=/[/\\]/;w.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;w.REPLACER_RE=/^\.[/\\]/;w.SLASH="/";w.SLASH_SLASH="//";w.BRACE_START="{";w.BANG="!";w.ONE_DOT=".";w.TWO_DOTS="..";w.STAR="*";w.GLOBSTAR="**";w.ROOT_GLOBSTAR="/**/*";w.SLASH_GLOBSTAR="/**";w.DIR_SUFFIX="Dir";w.ANYMATCH_OPTS={dot:!0};w.STRING_TYPE="string";w.FUNCTION_TYPE="function";w.EMPTY_STR="";w.EMPTY_FN=()=>{};w.IDENTITY_FN=s=>s;w.isWindows=vt==="win32";w.isMacos=vt==="darwin";w.isLinux=vt==="linux";w.isIBMi=wo.type()==="OS400"});var Br=v((Fc,Wr)=>{"use strict";var oe=L("fs"),W=L("path"),{promisify:ve}=L("util"),Ro=Dr(),{isWindows:Ao,isLinux:So,EMPTY_FN:To,EMPTY_STR:Co,KEY_LISTENERS:ye,KEY_ERR:kt,KEY_RAW:xe,HANDLER_KEYS:xo,EV_CHANGE:ze,EV_ADD:Ye,EV_ADD_DIR:bo,EV_ERROR:$r,STR_DATA:Io,STR_END:vo,BRACE_START:ko,STAR:No}=Ve(),Oo="watch",Po=ve(oe.open),Ur=ve(oe.stat),Lo=ve(oe.lstat),Ho=ve(oe.close),Nt=ve(oe.realpath),Do={lstat:Lo,stat:Ur},Pt=(s,e)=>{s instanceof Set?s.forEach(e):e(s)},be=(s,e,t)=>{let r=s[e];r instanceof Set||(s[e]=r=new Set([r])),r.add(t)},Fo=s=>e=>{let t=s[e];t instanceof Set?t.clear():delete s[e]},Ie=(s,e,t)=>{let r=s[e];r instanceof Set?r.delete(t):r===t&&delete s[e]},Mr=s=>s instanceof Set?s.size===0:!s,Xe=new Map;function Fr(s,e,t,r,n){let o=(i,a)=>{t(s),n(i,a,{watchedPath:s}),a&&s!==a&&Qe(W.resolve(s,a),ye,W.join(s,a))};try{return oe.watch(s,e,o)}catch(i){r(i)}}var Qe=(s,e,t,r,n)=>{let o=Xe.get(s);o&&Pt(o[e],i=>{i(t,r,n)})},$o=(s,e,t,r)=>{let{listener:n,errHandler:o,rawEmitter:i}=r,a=Xe.get(e),c;if(!t.persistent)return c=Fr(s,t,n,o,i),c.close.bind(c);if(a)be(a,ye,n),be(a,kt,o),be(a,xe,i);else{if(c=Fr(s,t,Qe.bind(null,e,ye),o,Qe.bind(null,e,xe)),!c)return;c.on($r,async u=>{let f=Qe.bind(null,e,kt);if(a.watcherUnusable=!0,Ao&&u.code==="EPERM")try{let d=await Po(s,"r");await Ho(d),f(u)}catch{}else f(u)}),a={listeners:n,errHandlers:o,rawEmitters:i,watcher:c},Xe.set(e,a)}return()=>{Ie(a,ye,n),Ie(a,kt,o),Ie(a,xe,i),Mr(a.listeners)&&(a.watcher.close(),Xe.delete(e),xo.forEach(Fo(a)),a.watcher=void 0,Object.freeze(a))}},Ot=new Map,Uo=(s,e,t,r)=>{let{listener:n,rawEmitter:o}=r,i=Ot.get(e),a=new Set,c=new Set,u=i&&i.options;return u&&(u.persistent<t.persistent||u.interval>t.interval)&&(a=i.listeners,c=i.rawEmitters,oe.unwatchFile(e),i=void 0),i?(be(i,ye,n),be(i,xe,o)):(i={listeners:n,rawEmitters:o,options:t,watcher:oe.watchFile(e,t,(f,d)=>{Pt(i.rawEmitters,m=>{m(ze,e,{curr:f,prev:d})});let l=f.mtimeMs;(f.size!==d.size||l>d.mtimeMs||l===0)&&Pt(i.listeners,m=>m(s,f))})},Ot.set(e,i)),()=>{Ie(i,ye,n),Ie(i,xe,o),Mr(i.listeners)&&(Ot.delete(e),oe.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}},Lt=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let r=this.fsw.options,n=W.dirname(e),o=W.basename(e);this.fsw._getWatchedDir(n).add(o);let a=W.resolve(e),c={persistent:r.persistent};t||(t=To);let u;return r.usePolling?(c.interval=r.enableBinaryInterval&&Ro(o)?r.binaryInterval:r.interval,u=Uo(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):u=$o(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,t,r){if(this.fsw.closed)return;let n=W.dirname(e),o=W.basename(e),i=this.fsw._getWatchedDir(n),a=t;if(i.has(o))return;let c=async(f,d)=>{if(this.fsw._throttle(Oo,e,5)){if(!d||d.mtimeMs===0)try{let l=await Ur(e);if(this.fsw.closed)return;let m=l.atimeMs,y=l.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(ze,e,l),So&&a.ino!==l.ino?(this.fsw._closeFile(f),a=l,this.fsw._addPathCloser(f,this._watchWithNodeFs(e,c))):a=l}catch{this.fsw._remove(n,o)}else if(i.has(o)){let l=d.atimeMs,m=d.mtimeMs;(!l||l<=m||m!==a.mtimeMs)&&this.fsw._emit(ze,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Ye,e,0))return;this.fsw._emit(Ye,e,t)}return u}async _handleSymlink(e,t,r,n){if(this.fsw.closed)return;let o=e.fullPath,i=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await Nt(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(o)!==a&&(this.fsw._symlinkPaths.set(o,a),this.fsw._emit(ze,r,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(o,a),this.fsw._emit(Ye,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,t,r,n,o,i,a){if(e=W.join(e,Co),!r.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(r.path),u=new Set,f=this.fsw._readdirp(e,{fileFilter:d=>r.filterPath(d),directoryFilter:d=>r.filterDir(d),depth:0}).on(Io,async d=>{if(this.fsw.closed){f=void 0;return}let l=d.path,m=W.join(e,l);if(u.add(l),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,e,m,l))){if(this.fsw.closed){f=void 0;return}(l===n||!n&&!c.has(l))&&(this.fsw._incrReadyCount(),m=W.join(o,W.relative(o,m)),this._addToNodeFs(m,t,r,i+1))}}).on($r,this._boundHandleError);return new Promise(d=>f.once(vo,()=>{if(this.fsw.closed){f=void 0;return}let l=a?a.clear():!1;d(),c.getChildren().filter(m=>m!==e&&!u.has(m)&&(!r.hasGlob||r.filterPath({fullPath:W.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m)}),f=void 0,l&&this._handleRead(e,!1,r,n,o,i,a)}))}async _handleDir(e,t,r,n,o,i,a){let c=this.fsw._getWatchedDir(W.dirname(e)),u=c.has(W.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!o&&!u&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(bo,e,t),c.add(W.basename(e)),this.fsw._getWatchedDir(e);let f,d,l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(a)){if(!o&&(await this._handleRead(e,r,i,o,e,n,f),this.fsw.closed))return;d=this._watchWithNodeFs(e,(m,y)=>{y&&y.mtimeMs===0||this._handleRead(m,!1,i,o,e,n,f)})}return d}async _addToNodeFs(e,t,r,n,o){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e,n);!a.hasGlob&&r&&(a.hasGlob=r.hasGlob,a.globFilter=r.globFilter,a.filterPath=c=>r.filterPath(c),a.filterDir=c=>r.filterDir(c));try{let c=await Do[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(No)&&!e.includes(ko),f;if(c.isDirectory()){let d=W.resolve(e),l=u?await Nt(e):e;if(this.fsw.closed||(f=await this._handleDir(a.watchPath,c,t,n,o,a,l),this.fsw.closed))return;d!==l&&l!==void 0&&this.fsw._symlinkPaths.set(d,l)}else if(c.isSymbolicLink()){let d=u?await Nt(e):e;if(this.fsw.closed)return;let l=W.dirname(a.watchPath);if(this.fsw._getWatchedDir(l).add(a.watchPath),this.fsw._emit(Ye,a.watchPath,c),f=await this._handleDir(l,c,t,n,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(W.resolve(e),d)}else f=this._handleFile(a.watchPath,c,t);return i(),this.fsw._addPathCloser(e,f),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};Wr.exports=Lt});var zr=v(($c,Bt)=>{"use strict";var Mt=L("fs"),B=L("path"),{promisify:Wt}=L("util"),we;try{we=L("fsevents")}catch(s){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(s)}if(we){let s=process.version.match(/v(\d+)\.(\d+)/);if(s&&s[1]&&s[2]){let e=Number.parseInt(s[1],10),t=Number.parseInt(s[2],10);e===8&&t<16&&(we=void 0)}}var{EV_ADD:Ht,EV_CHANGE:Mo,EV_ADD_DIR:Gr,EV_UNLINK:Ze,EV_ERROR:Wo,STR_DATA:Bo,STR_END:Go,FSEVENT_CREATED:qo,FSEVENT_MODIFIED:Ko,FSEVENT_DELETED:jo,FSEVENT_MOVED:Vo,FSEVENT_UNKNOWN:Yo,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:zo,FSEVENT_TYPE_FILE:Xo,FSEVENT_TYPE_DIRECTORY:ke,FSEVENT_TYPE_SYMLINK:Yr,ROOT_GLOBSTAR:qr,DIR_SUFFIX:Qo,DOT_SLASH:Kr,FUNCTION_TYPE:Dt,EMPTY_FN:Zo,IDENTITY_FN:Jo}=Ve(),ea=s=>isNaN(s)?{}:{depth:s},$t=Wt(Mt.stat),ta=Wt(Mt.lstat),jr=Wt(Mt.realpath),sa={stat:$t,lstat:ta},pe=new Map,ra=10,na=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),ia=(s,e)=>({stop:we.watch(s,e)});function oa(s,e,t,r){let n=B.extname(e)?B.dirname(e):e,o=B.dirname(n),i=pe.get(n);aa(o)&&(n=o);let a=B.resolve(s),c=a!==e,u=(d,l,m)=>{c&&(d=d.replace(e,a)),(d===a||!d.indexOf(a+B.sep))&&t(d,l,m)},f=!1;for(let d of pe.keys())if(e.indexOf(B.resolve(d)+B.sep)===0){n=d,i=pe.get(n),f=!0;break}return i||f?i.listeners.add(u):(i={listeners:new Set([u]),rawEmitter:r,watcher:ia(n,(d,l)=>{if(!i.listeners.size||l&zo)return;let m=we.getInfo(d,l);i.listeners.forEach(y=>{y(d,l,m)}),i.rawEmitter(m.event,d,m)})},pe.set(n,i)),()=>{let d=i.listeners;if(d.delete(u),!d.size&&(pe.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}var aa=s=>{let e=0;for(let t of pe.keys())if(t.indexOf(s)===0&&(e++,e>=ra))return!0;return!1},ca=()=>we&&pe.size<128,Ft=(s,e)=>{let t=0;for(;!s.indexOf(e)&&(s=B.dirname(s))!==e;)t++;return t},Vr=(s,e)=>s.type===ke&&e.isDirectory()||s.type===Yr&&e.isSymbolicLink()||s.type===Xo&&e.isFile(),Ut=class{constructor(e){this.fsw=e}checkIgnored(e,t){let r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return r.add(e),t&&t.isDirectory()&&r.add(e+qr),!0;r.delete(e),r.delete(e+qr)}addOrChange(e,t,r,n,o,i,a,c){let u=o.has(i)?Mo:Ht;this.handleEvent(u,e,t,r,n,o,i,a,c)}async checkExists(e,t,r,n,o,i,a,c){try{let u=await $t(e);if(this.fsw.closed)return;Vr(a,u)?this.addOrChange(e,t,r,n,o,i,a,c):this.handleEvent(Ze,e,t,r,n,o,i,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,t,r,n,o,i,a,c):this.handleEvent(Ze,e,t,r,n,o,i,a,c)}}handleEvent(e,t,r,n,o,i,a,c,u){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Ze){let f=c.type===ke;(f||i.has(a))&&this.fsw._remove(o,a,f)}else{if(e===Ht){if(c.type===ke&&this.fsw._getWatchedDir(t),c.type===Yr&&u.followSymlinks){let d=u.depth===void 0?void 0:Ft(r,n)+1;return this._addToFsEvents(t,!1,!0,d)}this.fsw._getWatchedDir(o).add(a)}let f=c.type===ke?e+Qo:e;this.fsw._emit(f,t),f===Gr&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,r,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;let o=this.fsw.options,a=oa(e,t,async(c,u,f)=>{if(this.fsw.closed||o.depth!==void 0&&Ft(c,t)>o.depth)return;let d=r(B.join(e,B.relative(e,c)));if(n&&!n(d))return;let l=B.dirname(d),m=B.basename(d),y=this.fsw._getWatchedDir(f.type===ke?d:l);if(na.has(u)||f.event===Yo)if(typeof o.ignored===Dt){let R;try{R=await $t(d)}catch{}if(this.fsw.closed||this.checkIgnored(d,R))return;Vr(f,R)?this.addOrChange(d,c,t,l,y,m,f,o):this.handleEvent(Ze,d,c,t,l,y,m,f,o)}else this.checkExists(d,c,t,l,y,m,f,o);else switch(f.event){case qo:case Ko:return this.addOrChange(d,c,t,l,y,m,f,o);case jo:case Vo:return this.checkExists(d,c,t,l,y,m,f,o)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,r,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let o=await jr(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(o))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(o||e,i=>{let a=e;return o&&o!==Kr?a=i.replace(o,e):i!==Kr&&(a=B.join(e,i)),r(a)},!1,n)}catch(o){if(this.fsw._handleError(o))return this.fsw._emitReady()}}}emitAdd(e,t,r,n,o){let i=r(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(B.dirname(i)),u=B.basename(i);a&&this.fsw._getWatchedDir(i),!c.has(u)&&(c.add(u),(!n.ignoreInitial||o===!0)&&this.fsw._emit(a?Gr:Ht,i,t))}initWatch(e,t,r,n){if(this.fsw.closed)return;let o=this._watchWithFsEvents(r.watchPath,B.resolve(e||r.watchPath),n,r.globFilter);this.fsw._addPathCloser(t,o)}async _addToFsEvents(e,t,r,n){if(this.fsw.closed)return;let o=this.fsw.options,i=typeof t===Dt?t:Jo,a=this.fsw._getWatchHelpers(e);try{let c=await sa[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(i(e),c,i,o,r),n&&n>o.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...ea(o.depth-(n||0))}).on(Bo,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let f=B.join(a.watchPath,u.path),{fullPath:d}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let l=o.depth===void 0?void 0:Ft(f,B.resolve(a.watchPath))+1;this._handleFsEventsSymlink(f,d,i,l)}else this.emitAdd(f,u.stats,i,o,r)}).on(Wo,Zo).on(Go,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,i,o,r),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(o.persistent&&r!==!0)if(typeof t===Dt)this.initWatch(void 0,e,a,i);else{let c;try{c=await jr(a.watchPath)}catch{}this.initWatch(c,e,a,i)}}};Bt.exports=Ut;Bt.exports.canUse=ca});var an=v(rs=>{"use strict";var{EventEmitter:la}=L("events"),ts=L("fs"),k=L("path"),{promisify:sn}=L("util"),ua=Hs(),Yt=Bs().default,fa=Ys(),Gt=At(),da=Nr(),ha=wt(),pa=Br(),Xr=zr(),{EV_ALL:qt,EV_READY:_a,EV_ADD:Je,EV_CHANGE:Ne,EV_UNLINK:Qr,EV_ADD_DIR:Ea,EV_UNLINK_DIR:ga,EV_RAW:ma,EV_ERROR:Kt,STR_CLOSE:ya,STR_END:wa,BACK_SLASH_RE:Ra,DOUBLE_SLASH_RE:Zr,SLASH_OR_BACK_SLASH_RE:Aa,DOT_RE:Sa,REPLACER_RE:Ta,SLASH:jt,SLASH_SLASH:Ca,BRACE_START:xa,BANG:zt,ONE_DOT:rn,TWO_DOTS:ba,GLOBSTAR:Ia,SLASH_GLOBSTAR:Vt,ANYMATCH_OPTS:Xt,STRING_TYPE:ss,FUNCTION_TYPE:va,EMPTY_STR:Qt,EMPTY_FN:ka,isWindows:Na,isMacos:Oa,isIBMi:Pa}=Ve(),La=sn(ts.stat),Ha=sn(ts.readdir),Zt=(s=[])=>Array.isArray(s)?s:[s],nn=(s,e=[])=>(s.forEach(t=>{Array.isArray(t)?nn(t,e):e.push(t)}),e),Jr=s=>{let e=nn(Zt(s));if(!e.every(t=>typeof t===ss))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(on)},en=s=>{let e=s.replace(Ra,jt),t=!1;for(e.startsWith(Ca)&&(t=!0);e.match(Zr);)e=e.replace(Zr,jt);return t&&(e=jt+e),e},on=s=>en(k.normalize(en(s))),tn=(s=Qt)=>e=>typeof e!==ss?e:on(k.isAbsolute(e)?e:k.join(s,e)),Da=(s,e)=>k.isAbsolute(s)?s:s.startsWith(zt)?zt+k.join(e,s.slice(1)):k.join(e,s),ee=(s,e)=>s[e]===void 0,Jt=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==rn&&e!==ba&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let r=this.path;try{await Ha(r)}catch{this._removeWatcher&&this._removeWatcher(k.dirname(r),k.basename(r))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},Fa="stat",$a="lstat",es=class{constructor(e,t,r,n){this.fsw=n,this.path=e=e.replace(Ta,Qt),this.watchPath=t,this.fullWatchPath=k.resolve(t),this.hasGlob=t!==e,e===Qt&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?Yt(e,void 0,Xt):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=r,this.statMethod=r?Fa:$a}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return k.join(this.watchPath,k.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===va?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(xa)?da.expand(e):[e]).forEach(n=>{t.push(k.relative(this.watchPath,n).split(Aa))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),r=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((o,i)=>(o===Ia&&(r=!0),r||!t[0][i]||Yt(o,t[0][i],Xt))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},et=class extends la{constructor(e){super();let t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,ee(t,"persistent")&&(t.persistent=!0),ee(t,"ignoreInitial")&&(t.ignoreInitial=!1),ee(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),ee(t,"interval")&&(t.interval=100),ee(t,"binaryInterval")&&(t.binaryInterval=300),ee(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,ee(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),Xr.canUse()||(t.useFsEvents=!1),ee(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=Oa),Pa&&(t.usePolling=!0);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let o=process.env.CHOKIDAR_INTERVAL;o&&(t.interval=Number.parseInt(o,10)),ee(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),ee(t,"followSymlinks")&&(t.followSymlinks=!0),ee(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let i=t.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=Zt(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=ka,this._readyEmitted=!0,process.nextTick(()=>this.emit(_a)))},this._emitRaw=(...c)=>this.emit(ma,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new Xr(this):this._nodeFsHandler=new pa(this),Object.freeze(t)}add(e,t,r){let{cwd:n,disableGlobbing:o}=this.options;this.closed=!1;let i=Jr(e);return n&&(i=i.map(a=>{let c=Da(a,n);return o||!Gt(a)?c:ha(c)})),i=i.filter(a=>a.startsWith(zt)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Vt),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!r,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(k.dirname(c),k.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=Jr(e),{cwd:r}=this.options;return t.forEach(n=>{!k.isAbsolute(n)&&!this._closers.has(n)&&(r&&(n=k.join(r,n)),n=k.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+Vt),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(r=>{let n=r();n instanceof Promise&&e.push(n)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,r)=>{let n=this.options.cwd?k.relative(this.options.cwd,r):r;e[n||rn]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Kt&&this.emit(qt,...t)}async _emit(e,t,r,n,o){if(this.closed)return;let i=this.options;Na&&(t=k.normalize(t)),i.cwd&&(t=k.relative(i.cwd,t));let a=[e,t];o!==void 0?a.push(r,n,o):n!==void 0?a.push(r,n):r!==void 0&&a.push(r);let c=i.awaitWriteFinish,u;if(c&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(i.atomic){if(e===Qr)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((f,d)=>{this.emit(...f),this.emit(qt,...f),this._pendingUnlinks.delete(d)})},typeof i.atomic=="number"?i.atomic:100),this;e===Je&&this._pendingUnlinks.has(t)&&(e=a[0]=Ne,this._pendingUnlinks.delete(t))}if(c&&(e===Je||e===Ne)&&this._readyEmitted){let f=(d,l)=>{d?(e=a[0]=Kt,a[1]=d,this.emitWithAll(e,a)):l&&(a.length>2?a[2]=l:a.push(l),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,f),this}if(e===Ne&&!this._throttle(Ne,t,50))return this;if(i.alwaysStat&&r===void 0&&(e===Je||e===Ea||e===Ne)){let f=i.cwd?k.join(i.cwd,t):t,d;try{d=await La(f)}catch{}if(!d||this.closed)return;a.push(d)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(Kt,e),e||this.closed}_throttle(e,t,r){this._throttled.has(e)||this._throttled.set(e,new Map);let n=this._throttled.get(e),o=n.get(t);if(o)return o.count++,!1;let i,a=()=>{let u=n.get(t),f=u?u.count:0;return n.delete(t),clearTimeout(i),u&&clearTimeout(u.timeoutObject),f};i=setTimeout(a,r);let c={timeoutObject:i,clear:a,count:0};return n.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,r,n){let o,i=e;this.options.cwd&&!k.isAbsolute(e)&&(i=k.join(this.options.cwd,e));let a=new Date,c=u=>{ts.stat(i,(f,d)=>{if(f||!this._pendingWrites.has(e)){f&&f.code!=="ENOENT"&&n(f);return}let l=Number(new Date);u&&d.size!==u.size&&(this._pendingWrites.get(e).lastChange=l);let m=this._pendingWrites.get(e);l-m.lastChange>=t?(this._pendingWrites.delete(e),n(void 0,d)):o=setTimeout(c,this.options.awaitWriteFinish.pollInterval,d)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(o),r)}),o=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&Sa.test(e))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=this.options.ignored,o=n&&n.map(tn(r)),i=Zt(o).filter(c=>typeof c===ss&&!Gt(c)).map(c=>c+Vt),a=this._getGlobIgnored().map(tn(r)).concat(o,i);this._userIgnored=Yt(a,void 0,Xt)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let r=t||this.options.disableGlobbing||!Gt(e)?e:fa(e),n=this.options.followSymlinks;return new es(e,r,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=k.resolve(e);return this._watched.has(t)||this._watched.set(t,new Jt(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,t,r){let n=k.join(e,t),o=k.resolve(n);if(r=r??(this._watched.has(n)||this._watched.has(o)),!this._throttle("remove",n,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));let c=this._getWatchedDir(e),u=c.has(t);c.remove(t),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let f=n;if(this.options.cwd&&(f=k.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(f)&&this._pendingWrites.get(f).cancelWait()===Je)return;this._watched.delete(n),this._watched.delete(o);let d=r?ga:Qr;u&&!this._isIgnored(n)&&this._emit(d,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);let t=k.dirname(e);this._getWatchedDir(t).remove(k.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(t)}_readdirp(e,t){if(this.closed)return;let r={type:qt,alwaysStat:!0,lstat:!0,...t},n=ua(e,r);return this._streams.add(n),n.once(ya,()=>{n=void 0}),n.once(wa,()=>{n&&(this._streams.delete(n),n=void 0)}),n}};rs.FSWatcher=et;var Ua=(s,e)=>{let t=new et(e);return t.add(s),t};rs.watch=Ua});import"only-server";import"../common/index.mjs";var un=vn(an(),1);import{existsSync as ln,promises as Wa}from"node:fs";import{basename as is,dirname as tt,join as cn,relative as st}from"node:path";import{build as Ba}from"esbuild";import{jwtDecode as Ga}from"jwt-decode";import{Issuer as qa,custom as Ka}from"openid-client";import{ExternalTaskWorker as ja}from"@5minds/processcube_engine_client";import{Logger as Va}from"@5minds/processcube_engine_sdk";import{EngineClient as Ma}from"@5minds/processcube_engine_client";var ns=process.env.PROCESSCUBE_ENGINE_URL??"http://localhost:10560",$=new Ma(ns);var Ya={token:"ZHVtbXlfdG9rZW4=",userId:"dummy_token"},za=.85,rt=["external_task.ts","external_task.js"],J=new Va("processcube_app_sdk:external_task_adapter"),as=process.env.PROCESSCUBE_AUTHORITY_URL!==void 0,ue={};async function fn(s){if(Ka.setHttpOptionsDefaults({timeout:1e5}),s&&!ln(s))throw new Error(`Invalid customExternalTasksDirPath. The given path '${s}' does not exist`);let e=tc(s);(0,un.watch)(e).on("add",async t=>{if(!rt.includes(is(t)))return;await dn(t,e);let r=tt(t),n=st(e,r),o=nt(n);J.info(`Started external task ${ue[t].workerId} for topic ${o}`)}).on("change",async t=>{if(!rt.includes(is(t)))return;await Xa(t,e);let r=tt(t),n=st(e,r),o=nt(n);J.info(`Restarted external task ${ue[t].workerId} for topic ${o}`)}).on("unlink",async t=>{if(!rt.includes(is(t)))return;hn(t);let r=tt(t),n=st(e,r),o=nt(n);J.info(`Stopped external task ${ue[t].workerId} for topic '${o}'`,{reason:`External Task for topic '${o}' was removed`,workerId:ue[t].workerId,topic:o}),delete ue[t]}).on("error",t=>J.info(`Watcher error: ${t}`))}async function dn(s,e,t){let r=tt(s);if(!Qa(r)){J.error(`Could not find external task file in directory '${r}'`);return}let o=await Za(s),i=await Ja(o,s);if(i.default===void 0){J.info(`External task file recognized at ${s}. Please export a default handler function. For more information see https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#external-tasks-entwickeln`);return}let a=await pn(),c=_n(a),u=st(e,r),f=nt(u),d=i.default,l={identity:c,...t,...i?.config},m=new ja(ns,f,d,l);m.onWorkerError((y,R,S)=>{J.error(`Intercepted "${y}"-type error: ${R.message}`,{err:R,type:y,externalTask:S})}),m.start(),await os(a,m),ue[s]=m}async function Xa(s,e){let t=ue[s]?.workerId;hn(s),await dn(s,e,{workerId:t})}function hn(s){let e=ue[s];e&&(e.stop(),e.dispose())}async function Qa(s){let t=(await Wa.readdir(s)).filter(r=>rt.includes(r));if(t.length===0)return null;if(t.length>1)throw new Error(`Found more than one external task file in directory '${s}'`);return t[0]}async function pn(){if(!as)return null;if(!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID||!process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET){let r=new Error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing. For help, please refer to our documentation on environment variables at: https://processcube.io/docs/app-sdk/samples/nextjs/external-task-adapter-with-nextjs#authority");throw J.error("Required environment variables PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID and PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET are missing",{err:r}),r}let s=await qa.discover(process.env.PROCESSCUBE_AUTHORITY_URL);return await new s.Client({client_id:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_ID,client_secret:process.env.PROCESSCUBE_EXTERNAL_TASK_WORKER_CLIENT_SECRET}).grant({grant_type:"client_credentials",scope:"engine_etw"})}function _n(s){if(!as||s===null)return Ya;let e=s.access_token,t=Ga(e);return{token:s.access_token,userId:t.sub}}async function os(s,e,t=5){try{if(!as||s===null||!e.pollingIsActive)return;let n=await ec(s)*za*1e3;setTimeout(async()=>{if(!e.pollingIsActive)return;let o=await pn(),i=_n(o);e.identity=i,await os(o,e)},n)}catch(r){if(t===0)throw r;J.error(`Could not refresh identity for external task worker ${e.workerId}`,{err:r,workerId:e.workerId,retryCount:t});let n=2*1e3;setTimeout(async()=>await os(s,e,t-1),n)}}async function Za(s){let e=await Ba({entryPoints:[s],write:!1,bundle:!0,platform:"node",target:"node18",format:"cjs",external:["@opentelemetry/api"]});if(e.errors.length>0)throw J.error(`Could not transpile file at '${s}'`,{errors:e.errors}),new Error(`Could not transpile file at '${s}'`);return e.warnings.length>0&&J.warn(`Transpiled file at '${s}' with warnings`,{warnings:e.warnings}),e.outputFiles[0].text}async function Ja(s,e){try{var t=module.constructor,r=new t;return r._compile(s,e),r.exports}catch(n){throw J.error("Could not require module from string",{err:n}),n}}async function ec(s){let e=s.expires_in;if(!e&&s.expires_at&&(e=Math.floor(s.expires_at-Date.now()/1e3)),e===void 0)throw new Error("Could not determine the time until the access token for external task workers expires");return e}function nt(s){return s.replace(/^\.\/+|\([^)]+\)|^\/*|\/*$/g,"").replace(/[\/]{2,}/g,"/")}function tc(s){let e,t=[s,cn(process.cwd(),"app"),cn(process.cwd(),"src","app")];for(let r of t)if(r&&ln(r)){e=r;break}if(!e)throw new Error("Could not find external tasks directory");return e}function tl(){return $}import{getToken as En}from"next-auth/jwt";import{ResponseCookies as sc}from"next/dist/compiled/@edge-runtime/cookies";import{cookies as it,headers as gn}from"next/headers";var rc=process.env.NEXTAUTH_URL?.startsWith("https://"),mn=`${rc?"__Secure-":""}next-auth.session-token`;async function ol(){let s=await En({req:{cookies:it(),headers:gn()}});if(s?.expiresAt&&Date.now()>=s.expiresAt*1e3){let t=await fetch(`${process.env.NEXTAUTH_URL}/api/auth/session`,{method:"GET",headers:{"Content-Type":"application/json",cookie:it().toString()}}),r=new sc(t.headers),n=r.get(mn);if(n){let o=!1;try{it().set(mn,n.value,{...n})}catch{o=!0}if(s=await En({req:{cookies:o?r:it(),headers:gn()}}),s?.error)throw s.error}}if(!s?.accessToken||!s?.sub)throw new Error("AccessToken or Sub could not be determined!");return{token:s?.accessToken,userId:s?.sub}}import{DataModels as nc}from"@5minds/processcube_engine_client";async function ul(s){return await $.processInstances.query({...s?.query,state:nc.ProcessInstances.ProcessInstanceState.running},s?.options)}import{DataModels as ae}from"@5minds/processcube_engine_client";import{mapUserTask as yn,mapUserTaskList as _e}from"../common/index.mjs";async function gl(s={},e){let{correlationId:t,processInstanceId:r,flowNodeId:n}=s;return new Promise(async(o,i)=>{let a=await $.userTasks.onUserTaskWaiting(async u=>{let f=t!==void 0&&u.correlationId!==t,d=u.flowNodeInstanceId===void 0,l=r!==void 0&&u.processInstanceId!==r,m=n!==void 0&&u.flowNodeId!==n;if(f||d||l||m)return;let y=await oc(u.flowNodeInstanceId,{identity:e});return $.notification.removeSubscription(a,e),y===null?i(new Error(`UserTask with instance ID "${u.flowNodeInstanceId}" does not exist.`)):o(y)},{identity:e}),c=await ic({correlationId:t,processInstanceId:r,flowNodeId:n,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:e});c.userTasks.length>0&&($.notification.removeSubscription(a,e),o(c.userTasks[0]))})}async function ml(s,e={},t={},r){await $.userTasks.finishUserTask(s,t,r);let n={state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended,...e},o=await $.userTasks.query(n,{identity:r});return yn(o.userTasks[0])}async function ic(...s){let e=await $.userTasks.query(...s);return _e(e)}async function yl(s){let e=await $.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},s);return _e(e)}async function wl(s,e){let t=await $.userTasks.query({processInstanceId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(t)}async function Rl(s,e){let t=await $.userTasks.query({flowNodeId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(t)}async function oc(s,e){let t=await $.userTasks.query({flowNodeInstanceId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{...e,limit:1});return t.userTasks.length===0?null:yn(t.userTasks[0])}async function Al(s,e){let t=await $.userTasks.query({correlationId:s,state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},e);return _e(t)}async function Sl(s,e){let t=await $.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s,...e}),r=t.userTasks.filter(n=>n.actualOwnerId===s.userId);return t.userTasks=r,_e(t)}async function Tl(s,e){let t=await $.userTasks.query({state:ae.FlowNodeInstances.FlowNodeInstanceState.suspended},{identity:s,...e}),r=t.userTasks.filter(n=>n.assignedUserIds?.includes(s.userId));return t.userTasks=r,_e(t)}import{PHASE_DEVELOPMENT_SERVER as ac,PHASE_PRODUCTION_SERVER as cc}from"next/dist/shared/lib/constants";var wn=!1;function Hl(s={}){let{applicationSdk:e,...t}=s;return async(r,n)=>{let o=r===ac||r===cc;return e?.useExternalTasks&&o&&!wn&&(wn=!0,await fn(e?.customExternalTasksDirPath)),t}}import{revalidatePath as lc}from"next/cache";import{redirect as uc}from"next/navigation";function Wl(s){lc(s),uc(s)}async function ql(...s){return await $.processModels.startProcessInstance(...s)}async function Vl(...s){await $.userTasks.finishUserTask(...s)}export{Vl as finishUserTask,ml as finishUserTaskAndGetNext,ul as getActiveProcessInstances,Tl as getAssignedUserTasksByIdentity,tl as getEngineClient,ol as getIdentity,Sl as getReservedUserTasksByIdentity,ic as getUserTasks,oc as getWaitingUserTaskByFlowNodeInstanceId,yl as getWaitingUserTasks,Al as getWaitingUserTasksByCorrelationId,Rl as getWaitingUserTasksByFlowNodeId,wl as getWaitingUserTasksByProcessInstanceId,Wl as navigateToUrl,ql as startProcess,gl as waitForUserTask,Hl as withApplicationSdk};
|
|
3
3
|
/*! Bundled license information:
|
|
4
4
|
|
|
5
5
|
normalize-path/index.js:
|
package/package.json
CHANGED