@cyberskill/shared 1.103.0 → 1.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var h=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var I=function(e,t){return h(e,"name",{value:t,configurable:!0})};var w=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!b.call(e,s)&&s!==n&&h(e,s,{get:function(){return t[s]},enumerable:!(r=v(t,s))||r.enumerable})};for(var c=x(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var E=function(e,t,n){return n=e!=null?y(j(e)):{},w(t||!e||!e.__esModule?h(n,"default",{value:e,enumerable:!0}):n,e)};var S=E(require("process"),1),C=require("yargs/helpers"),O=E(require("yargs/yargs"),1);var _={name:"@cyberskill/shared",type:"module",version:"1.102.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.3","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var T=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var k=require("child_process"),G=E(require("process"),1),R=E(require("util"),1);var N=".cyberskill-storage";var L=E(require("dotenv"),1),q=require("envalid"),D=E(require("os"),1),M=E(require("path"),1),P=E(require("process"),1);L.default.config();function A(){var e={DEBUG:P.default.env.DEBUG||!1,CWD:P.default.env.CWD||P.default.cwd(),CYBERSKILL_STORAGE_DIRECTORY:P.default.env.CYBERSKILL_STORAGE_DIRECTORY||M.default.join(D.default.homedir(),N)};return(0,q.cleanEnv)(e,{DEBUG:(0,q.bool)(),CWD:(0,q.str)(),CYBERSKILL_STORAGE_DIRECTORY:(0,q.str)()})}I(A,"getEnv");var F=function(e){return e.Error="error",e.Warning="warning",e}({});var U=E(require("chalk"),1),B=E(require("consola"),1),K=require("graphql");var W=A();W.DEBUG||(B.default.level=4);function Y(e){var t=U.default[e];return typeof t=="function"?t:U.default.green}I(Y,"chalkKeyword");var H={silent:B.default.silent,level:B.default.level,fatal:B.default.fatal,error:B.default.error,warn:B.default.warn,log:B.default.log,info:B.default.info,success:B.default.success,ready:B.default.ready,start:B.default.start,box:B.default.box,debug:B.default.debug,trace:B.default.trace,verbose:B.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){B.default.box(U.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;B.default.log("".concat(U.default.gray("File:")," ").concat(U.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&B.default.log(" ".concat(Y(n)("Rule:")," ").concat(s)),B.default.log(" ".concat(Y(n)("Message:")," ").concat(i))}),B.default.box(Y(n)("".concat(e," : ").concat(t.length))),B.default.log(U.default.gray("─".repeat(40)))}};var J={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var $=E(require("node-fetch"),1);var V=E(require("fs-extra"),1),z=require("path");var Q=V.default,X=Q.readFileSync,Z=Q.writeFileSync,ee=Q.pathExistsSync,et=Q.appendFileSync,en=Q.copySync,er=Q.removeSync,es=Q.statSync,ei=V.default.readJsonSync,eo=V.default.writeJsonSync;function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return ee(e)})}I(ea,"existsSync");function ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ee(e)&&er(e)})}I(ec,"removeSync");var eu=require("path");var el=A();function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,eu.resolve).apply(this,[el.CWD].concat(p(t)))}I(ed,"resolveWorkingPath");function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,eu.join).apply(this,p(t))}I(ep,"join");var ef=A(),eg=ef.CWD,em="@cyberskill/shared",ey="node_modules",eh="dist",ev="package.json",ex="package-lock.json",ej="tsconfig.json",eb=".gitignore",eI=".simple-git-hooks.json",ew="pnpm-lock.yaml",eE=".git/hooks/",eS=".git/COMMIT_EDITMSG",eC=".migrate-mongo.config.js",eO=ep(eg,ey,em,eh),e_="cyberskill",eT="src/nodejs/cli/index.ts",ek="eslint",eG="eslint",eR="vitest",eN="playwright",eL="vitest",eq="@commitlint/cli",eD="commitlint",eM="lint-staged",eP="lint-staged",eA="typescript",eF="tsc",eU="tsx",eB="git",eK="pnpm",eW="pnpm exec",eY="simple-git-hooks",eH="simple-git-hooks",eJ="@eslint/config-inspector",e$="eslint-config-inspector",eV="node-modules-inspector",ez="node-modules-inspector",eQ="migrate-mongo",eX="./node_modules/migrate-mongo/bin/migrate-mongo",eZ={CYBERSKILL_DIRECTORY:eO,WORKING_DIRECTORY:eg,TS_CONFIG:ed(ej),GIT_IGNORE:ed(eb),GIT_HOOK:ed(eE),GIT_COMMIT_MSG:ed(eS),SIMPLE_GIT_HOOKS_JSON:ed(eI),PACKAGE_JSON:ed(ev),PACKAGE_LOCK_JSON:ed(ex),PNPM_LOCK_YAML:ed(ew),NODE_MODULES:ed(ey),MIGRATE_MONGO_CONFIG:ed(eC),LINT_STAGED_CONFIG:ed("".concat(eO,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ed("".concat(eO,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ed("".concat(eO,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ed("".concat(eO,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ed("".concat(eO,"/react/vitest/vitest.e2e.js"))};function e0(e){var t=e.isCurrentProject;return l({"pre-commit":eP,"commit-msg":eD},t&&{"pre-push":tw("".concat(eB," pull"))})}I(e0,"createGitHooksConfig");function e1(e,t,n){return e2.apply(this,arguments)}function e2(){e2=s(function(e,t,n){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case T.CLI:return[3,1];case T.STRING:return[3,3]}return[3,4];case 1:return[4,tr(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tS(tw("".concat(eW," ").concat(n))))];case 3:return[2,tS(tw(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return e2.apply(this,arguments)}I(e1,"buildCommand");function e4(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,e1(e,t,n)]})})}I(e4,"commandFactory");var e3={simpleGitHooks:e4(T.CLI,eY,eH),eslintInspect:e4(T.CLI,eJ,e$),nodeModulesInspect:e4(T.CLI,eV,ez),eslintCheck:e4(T.CLI,ek,"".concat(eG," ").concat(eZ.WORKING_DIRECTORY)),eslintFix:e4(T.CLI,ek,"".concat(eG," ").concat(eZ.WORKING_DIRECTORY," --fix")),typescriptCheck:e4(T.CLI,eA,"".concat(eF," -p ").concat(eZ.TS_CONFIG," --noEmit")),configureGitHook:e4(T.STRING,"".concat(eB," config core.hooksPath ").concat(eZ.GIT_HOOK)),testUnit:e4(T.CLI,eR,"".concat(eL," --config ").concat(eZ.UNIT_TEST_CONFIG)),testE2e:e4(T.CLI,"".concat(eR," ").concat(eN),"".concat(eL," --config ").concat(eZ.E2E_TEST_CONFIG)),mongoMigrateCreate:I(function(e){return e4(T.CLI,eQ,"".concat(eU," ").concat(eX," create ").concat(e," -f ").concat(eZ.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," up -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," down -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),mongoMigrateStatus:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," status -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),commitLint:e4(T.CLI,eq,"".concat(eD," --edit ").concat(eZ.GIT_COMMIT_MSG," --config ").concat(eZ.COMMITLINT_CONFIG)),lintStaged:e4(T.CLI,eM,"".concat(eP," --config ").concat(eZ.LINT_STAGED_CONFIG)),stageBuildDirectory:e4(T.STRING,"".concat(eB," add ").concat(eh)),build:e4(T.STRING,"".concat(eK," run build")),pnpmInstallStandard:e4(T.STRING,"".concat(eK," install")),pnpmInstallLegacy:e4(T.STRING,"".concat(eK," install --legacy-peer-deps")),pnpmInstallForce:e4(T.STRING,"".concat(eK," install --force"))};var e8=A();function e5(e){var t=ep(e8.CWD,ev);if(!ea(t))return!1;try{var n=ei(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return H.warn("Failed to read package.json: ".concat(e.message)),!1}}I(e5,"getPackage");function e6(e){return e9.apply(this,arguments)}function e9(){e9=s(function(e){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,$.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw H.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return e9.apply(this,arguments)}I(e6,"getLatestPackageVersion");function e7(e,t){return te.apply(this,arguments)}function te(){te=s(function(e,t){var n,r,s,i,o,a,c,u,d,p,f,g,y,h,v,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e5(e);if(!n)return[2,l({},J)];c=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(s=u.devDependencies)!==null&&s!==void 0?s:{},h=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(a=y[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];j=h;return[3,3];case 1:return[4,e6(e)];case 2:j=m.sent();m.label=3;case 3:v=j,x=d||h===v;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=p?"dependencies":f?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==v&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=v,eo(c,u),H.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(H.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},J))];case 5:return[2]}})});return te.apply(this,arguments)}I(e7,"checkPackage");function tt(){return tn.apply(this,arguments)}function tn(){tn=s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:I(function(){return e3.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:I(function(){return e3.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:I(function(){return e3.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,a()];case 4:u=p.sent();return[4,t_("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();H.warn("Installation attempt failed: ".concat(c)),H.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tn.apply(this,arguments)}I(tt,"installDependencies");function tr(e,t){return ts.apply(this,arguments)}function ts(){ts=s(function(e,t){var n,r,s,i,o,a,c,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!ea(eZ.PACKAGE_JSON)){H.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e7(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,tt()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;a=f;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw H.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return ts.apply(this,arguments)}I(tr,"setupPackages");var ti=E(require("node-persist"),1);var to=A();function ta(){return tc.apply(this,arguments)}function tc(){tc=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=ti.default.defaultInstance;if(e)return[3,2];return[4,ti.default.init({dir:to.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return tc.apply(this,arguments)}I(ta,"initNodePersist");var tu={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:r.sent();return[4,ti.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(H.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:r.sent();return[4,ti.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();H.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:n.sent();return[4,ti.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();H.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:n.sent();return[4,ti.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(H.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(H.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(to.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(H.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tl=A(),td=R.promisify(k.exec);function tp(e){return"error_list:".concat(e)}I(tp,"getErrorListKey");function tf(e){return tg.apply(this,arguments)}function tg(){tg=s(function(e){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tp(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,tu.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tu.getLogLink(n)];case 1:e=t.sent();e&&H.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();H.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tg.apply(this,arguments)}I(tf,"saveErrorListToStorage");function tm(){return ty.apply(this,arguments)}function ty(){ty=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,tu.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(H.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return ty.apply(this,arguments)}I(tm,"getStoredErrorLists");function th(){return tv.apply(this,arguments)}function tv(){tv=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tu.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();H.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tv.apply(this,arguments)}I(th,"clearAllErrorLists");function tx(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,y,h,v,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===F.Error?F.Error:F.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(y=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&y!==void 0?y:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===F.Error?F.Error:F.Warning,message:(v=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):g.length?t.push({file:"commitlint",type:F.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tf(t),tl.DEBUG&&n.length&&(H.warn("Unmatched lines:"),n.forEach(function(e){return H.info(" ".concat(e))}))}I(tx,"parseTextErrors");function tj(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?F.Error:F.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tf(n)}catch(t){tx(e)}}I(tj,"parseCommandOutput");function tb(e){return tI.apply(this,arguments)}function tI(){tI=s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tj;n=new AbortController;G.default.on("SIGINT",function(){H.warn("Process interrupted. Terminating..."),n.abort(),G.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,td(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&H.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return tI.apply(this,arguments)}I(tb,"executeCommand");function tw(e){return{raw:!0,cmd:e}}I(tw,"rawCommand");function tE(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eW," ").concat(em," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eW," ").concat(eU," ").concat(eT," ").concat(e):"".concat(eW," ").concat(e_," ").concat(e)}I(tE,"formatCLI");function tS(e,t){return typeof e=="function"?tE(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tE(e,t):e}I(tS,"formatCommand");function tC(e){return tO.apply(this,arguments)}function tO(){tO=s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e7(em)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tS(r,i)]}))]}})});return tO.apply(this,arguments)}I(tC,"resolveCommands");function t_(e,t){return tT.apply(this,arguments)}function tT(){tT=s(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);H.start("".concat(e)),tl.DEBUG&&H.info("→ ".concat(t));return[4,tb(t)];case 1:r.sent(),H.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw H.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tT.apply(this,arguments)}I(t_,"runCommand");function tk(){return tG.apply(this,arguments)}function tG(){tG=s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!ea(eZ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e3.typescriptCheck()];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=H.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tG.apply(this,arguments)}I(tk,"checkTypescript");function tR(){return tN.apply(this,arguments)}function tN(){tN=s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e3.eslintFix()];case 1:return[4,t_.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e3.eslintCheck()];case 4:return[4,t_.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tN.apply(this,arguments)}I(tR,"checkEslint");function tL(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";H.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}I(tL,"printIssues");function tq(){return tD.apply(this,arguments)}function tD(){tD=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tm()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===F.Error}),n=e.filter(function(e){return e.type===F.Warning});!t.length&&!n.length?H.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tL("Warnings",n),tL("Errors",t),(t.length>0||n.length>0)&&S.default.exit(1));return[2]}})});return tD.apply(this,arguments)}I(tq,"showCheckResult");function tM(){return tP.apply(this,arguments)}function tP(){tP=s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,th()];case 1:o.sent();return[4,e7(em)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(em)];return[4,e3.build()];case 4:return[4,t_.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e3.stageBuildDirectory()];case 6:return[4,t_.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw H.error("Error building and staging ".concat(em,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e3.lintStaged()];case 10:return[4,t_.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tq();return[2]}})});return tP.apply(this,arguments)}I(tM,"lintStaged");function tA(){return tF.apply(this,arguments)}function tF(){tF=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e3.eslintInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tF.apply(this,arguments)}I(tA,"inspectLint");function tU(){return tB.apply(this,arguments)}function tB(){tB=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,th()];case 1:e.sent();return[4,Promise.all([tk(),tR()])];case 2:e.sent(),tq();return[2]}})});return tB.apply(this,arguments)}I(tU,"lintCheck");function tK(){return tW.apply(this,arguments)}function tW(){tW=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,th()];case 1:e.sent();return[4,Promise.all([tk(),tR(!0)])];case 2:e.sent(),tq();return[2]}})});return tW.apply(this,arguments)}I(tK,"lintFix");function tY(){return tH.apply(this,arguments)}function tH(){tH=s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,th()];case 1:t.sent();e=["Validating commit message"];return[4,e3.commitLint()];case 2:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tq();return[2]}})});return tH.apply(this,arguments)}I(tY,"commitLint");function tJ(){return t$.apply(this,arguments)}function t$(){t$=s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e3.configureGitHook()];case 1:return[4,t_.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ec(eZ.GIT_HOOK);return[4,tC(e0)];case 3:t=s.sent();eo(eZ.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(eI,"\n");ea(eZ.GIT_IGNORE)?X(eZ.GIT_IGNORE,"utf-8").split("\n").includes(eI)||et(eZ.GIT_IGNORE,n,"utf-8"):Z(eZ.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,e3.simpleGitHooks()];case 4:return[4,t_.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return t$.apply(this,arguments)}I(tJ,"setupGitHook");function tV(){return tz.apply(this,arguments)}function tz(){tz=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tr([em],{update:!0,postInstallActions:[tJ]})];case 1:e.sent();return[2]}})});return tz.apply(this,arguments)}I(tV,"setup");function tQ(){return tX.apply(this,arguments)}function tX(){tX=s(function(){return m(this,function(e){switch(e.label){case 0:ec(eZ.NODE_MODULES,eZ.PNPM_LOCK_YAML);return[4,tt()];case 1:e.sent();return[4,tJ()];case 2:e.sent();return[2]}})});return tX.apply(this,arguments)}I(tQ,"reset");function tZ(){return t0.apply(this,arguments)}function t0(){t0=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e3.nodeModulesInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t0.apply(this,arguments)}I(tZ,"inspect");function t1(){return t2.apply(this,arguments)}function t2(){t2=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e3.testUnit()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t2.apply(this,arguments)}I(t1,"testUnit");function t4(){return t3.apply(this,arguments)}function t3(){t3=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e3.testE2e()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t3.apply(this,arguments)}I(t4,"testE2E");function t8(e){return t5.apply(this,arguments)}function t5(){t5=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e3.mongoMigrateCreate(e)];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return t5.apply(this,arguments)}I(t8,"mongoMigrateCreate");function t6(){return t9.apply(this,arguments)}function t9(){t9=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e3.mongoMigrateUp()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t9.apply(this,arguments)}I(t6,"mongoMigrateUp");function t7(){return ne.apply(this,arguments)}function ne(){ne=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e3.mongoMigrateDown()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return ne.apply(this,arguments)}I(t7,"mongoMigrateDown");function nt(){return nn.apply(this,arguments)}function nn(){nn=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Checking MongoDB migration status"];return[4,e3.mongoMigrateStatus()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return nn.apply(this,arguments)}I(nt,"mongoMigrateStatus");s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,O.default)((0,C.hideBin)(S.default.argv)).scriptName(e_).usage("$0 <command> [options]").command("lint","Check code for linting issues",tU).command("lint:fix","Fix linting issues automatically",tK).command("lint:inspect","View active ESLint configuration",tA).command("lint-staged","Run lint checks on staged files",tM).command("commitlint","Validate commit message format",tY).command("setup","Initialize project setup and dependencies",tV).command("reset","Reset the project and reinstall dependencies",tQ).command("inspect","Analyze installed project dependencies",tZ).command("test:unit","Run unit test suite",t1).command("test:e2e","Run end-to-end test suite",t4).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=s(function(e){return m(this,function(t){switch(t.label){case 0:if(!e.name){H.error("Migration name is required.");return[2]}return[4,t8(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",t6).command("mongo:migrate:down","Rollback last MongoDB migration",t7).command("mongo:migrate:status","Check MongoDB migration status",nt).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(_.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();H.error("Fatal: ".concat(e.message)),S.default.exit(1);return[3,3];case 3:return[2]}})})();
2
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var h=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var I=function(e,t){return h(e,"name",{value:t,configurable:!0})};var w=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!b.call(e,s)&&s!==n&&h(e,s,{get:function(){return t[s]},enumerable:!(r=v(t,s))||r.enumerable})};for(var c=x(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var E=function(e,t,n){return n=e!=null?y(j(e)):{},w(t||!e||!e.__esModule?h(n,"default",{value:e,enumerable:!0}):n,e)};var S=E(require("process"),1),C=require("yargs/helpers"),O=E(require("yargs/yargs"),1);var _={name:"@cyberskill/shared",type:"module",version:"1.103.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.3","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var T=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var k=require("child_process"),G=E(require("process"),1),R=E(require("util"),1);var N=".cyberskill-storage";var L=E(require("dotenv"),1),q=require("envalid"),D=E(require("os"),1),M=E(require("path"),1),P=E(require("process"),1);L.default.config();function A(){var e={DEBUG:P.default.env.DEBUG||!1,CWD:P.default.env.CWD||P.default.cwd(),CYBERSKILL_STORAGE_DIRECTORY:P.default.env.CYBERSKILL_STORAGE_DIRECTORY||M.default.join(D.default.homedir(),N)};return(0,q.cleanEnv)(e,{DEBUG:(0,q.bool)(),CWD:(0,q.str)(),CYBERSKILL_STORAGE_DIRECTORY:(0,q.str)()})}I(A,"getEnv");var F=function(e){return e.Error="error",e.Warning="warning",e}({});var U=E(require("chalk"),1),B=E(require("consola"),1),K=require("graphql");var W=A();W.DEBUG||(B.default.level=4);function Y(e){var t=U.default[e];return typeof t=="function"?t:U.default.green}I(Y,"chalkKeyword");var H={silent:B.default.silent,level:B.default.level,fatal:B.default.fatal,error:B.default.error,warn:B.default.warn,log:B.default.log,info:B.default.info,success:B.default.success,ready:B.default.ready,start:B.default.start,box:B.default.box,debug:B.default.debug,trace:B.default.trace,verbose:B.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){B.default.box(U.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;B.default.log("".concat(U.default.gray("File:")," ").concat(U.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&B.default.log(" ".concat(Y(n)("Rule:")," ").concat(s)),B.default.log(" ".concat(Y(n)("Message:")," ").concat(i))}),B.default.box(Y(n)("".concat(e," : ").concat(t.length))),B.default.log(U.default.gray("─".repeat(40)))}};var J={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var $=E(require("node-fetch"),1);var V=E(require("fs-extra"),1),z=require("path");var Q=V.default,X=Q.readFileSync,Z=Q.writeFileSync,ee=Q.pathExistsSync,et=Q.appendFileSync,en=Q.copySync,er=Q.removeSync,es=Q.statSync,ei=V.default.readJsonSync,eo=V.default.writeJsonSync;function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return ee(e)})}I(ea,"existsSync");function ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ee(e)&&er(e)})}I(ec,"removeSync");var eu=require("path");var el=A();function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,eu.resolve).apply(this,[el.CWD].concat(p(t)))}I(ed,"resolveWorkingPath");function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,eu.join).apply(this,p(t))}I(ep,"join");var ef=A(),eg=ef.CWD,em="@cyberskill/shared",ey="node_modules",eh="dist",ev="package.json",ex="package-lock.json",ej="tsconfig.json",eb=".gitignore",eI=".simple-git-hooks.json",ew="pnpm-lock.yaml",eE=".git/hooks/",eS=".git/COMMIT_EDITMSG",eC=".migrate-mongo.config.js",eO=ep(eg,ey,em,eh),e_="cyberskill",eT="src/nodejs/cli/index.ts",ek="eslint",eG="eslint",eR="vitest",eN="playwright",eL="vitest",eq="@commitlint/cli",eD="commitlint",eM="lint-staged",eP="lint-staged",eA="typescript",eF="tsc",eU="tsx",eB="git",eK="pnpm",eW="pnpm exec",eY="simple-git-hooks",eH="simple-git-hooks",eJ="@eslint/config-inspector",e$="eslint-config-inspector",eV="node-modules-inspector",ez="node-modules-inspector",eQ="migrate-mongo",eX="./node_modules/migrate-mongo/bin/migrate-mongo",eZ={CYBERSKILL_DIRECTORY:eO,WORKING_DIRECTORY:eg,TS_CONFIG:ed(ej),GIT_IGNORE:ed(eb),GIT_HOOK:ed(eE),GIT_COMMIT_MSG:ed(eS),SIMPLE_GIT_HOOKS_JSON:ed(eI),PACKAGE_JSON:ed(ev),PACKAGE_LOCK_JSON:ed(ex),PNPM_LOCK_YAML:ed(ew),NODE_MODULES:ed(ey),MIGRATE_MONGO_CONFIG:ed(eC),LINT_STAGED_CONFIG:ed("".concat(eO,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ed("".concat(eO,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ed("".concat(eO,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ed("".concat(eO,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ed("".concat(eO,"/react/vitest/vitest.e2e.js"))};function e0(e){var t=e.isCurrentProject;return l({"pre-commit":eP,"commit-msg":eD},t&&{"pre-push":tw("".concat(eB," pull"))})}I(e0,"createGitHooksConfig");function e1(e,t,n){return e2.apply(this,arguments)}function e2(){e2=s(function(e,t,n){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case T.CLI:return[3,1];case T.STRING:return[3,3]}return[3,4];case 1:return[4,tr(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tS(tw("".concat(eW," ").concat(n))))];case 3:return[2,tS(tw(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return e2.apply(this,arguments)}I(e1,"buildCommand");function e4(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,e1(e,t,n)]})})}I(e4,"commandFactory");var e3={simpleGitHooks:e4(T.CLI,eY,eH),eslintInspect:e4(T.CLI,eJ,e$),nodeModulesInspect:e4(T.CLI,eV,ez),eslintCheck:e4(T.CLI,ek,"".concat(eG," ").concat(eZ.WORKING_DIRECTORY)),eslintFix:e4(T.CLI,ek,"".concat(eG," ").concat(eZ.WORKING_DIRECTORY," --fix")),typescriptCheck:e4(T.CLI,eA,"".concat(eF," -p ").concat(eZ.TS_CONFIG," --noEmit")),configureGitHook:e4(T.STRING,"".concat(eB," config core.hooksPath ").concat(eZ.GIT_HOOK)),testUnit:e4(T.CLI,eR,"".concat(eL," --config ").concat(eZ.UNIT_TEST_CONFIG)),testE2e:e4(T.CLI,"".concat(eR," ").concat(eN),"".concat(eL," --config ").concat(eZ.E2E_TEST_CONFIG)),mongoMigrateCreate:I(function(e){return e4(T.CLI,eQ,"".concat(eU," ").concat(eX," create ").concat(e," -f ").concat(eZ.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," up -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," down -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),mongoMigrateStatus:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," status -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),commitLint:e4(T.CLI,eq,"".concat(eD," --edit ").concat(eZ.GIT_COMMIT_MSG," --config ").concat(eZ.COMMITLINT_CONFIG)),lintStaged:e4(T.CLI,eM,"".concat(eP," --config ").concat(eZ.LINT_STAGED_CONFIG)),stageBuildDirectory:e4(T.STRING,"".concat(eB," add ").concat(eh)),build:e4(T.STRING,"".concat(eK," run build")),pnpmInstallStandard:e4(T.STRING,"".concat(eK," install")),pnpmInstallLegacy:e4(T.STRING,"".concat(eK," install --legacy-peer-deps")),pnpmInstallForce:e4(T.STRING,"".concat(eK," install --force"))};var e8=A();function e5(e){var t=ep(e8.CWD,ev);if(!ea(t))return!1;try{var n=ei(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return H.warn("Failed to read package.json: ".concat(e.message)),!1}}I(e5,"getPackage");function e6(e){return e9.apply(this,arguments)}function e9(){e9=s(function(e){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,$.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw H.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return e9.apply(this,arguments)}I(e6,"getLatestPackageVersion");function e7(e,t){return te.apply(this,arguments)}function te(){te=s(function(e,t){var n,r,s,i,o,a,c,u,d,p,f,g,y,h,v,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e5(e);if(!n)return[2,l({},J)];c=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(s=u.devDependencies)!==null&&s!==void 0?s:{},h=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(a=y[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];j=h;return[3,3];case 1:return[4,e6(e)];case 2:j=m.sent();m.label=3;case 3:v=j,x=d||h===v;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=p?"dependencies":f?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==v&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=v,eo(c,u),H.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(H.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},J))];case 5:return[2]}})});return te.apply(this,arguments)}I(e7,"checkPackage");function tt(){return tn.apply(this,arguments)}function tn(){tn=s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:I(function(){return e3.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:I(function(){return e3.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:I(function(){return e3.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,a()];case 4:u=p.sent();return[4,t_("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();H.warn("Installation attempt failed: ".concat(c)),H.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tn.apply(this,arguments)}I(tt,"installDependencies");function tr(e,t){return ts.apply(this,arguments)}function ts(){ts=s(function(e,t){var n,r,s,i,o,a,c,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!ea(eZ.PACKAGE_JSON)){H.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e7(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,tt()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;a=f;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw H.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return ts.apply(this,arguments)}I(tr,"setupPackages");var ti=E(require("node-persist"),1);var to=A();function ta(){return tc.apply(this,arguments)}function tc(){tc=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=ti.default.defaultInstance;if(e)return[3,2];return[4,ti.default.init({dir:to.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return tc.apply(this,arguments)}I(ta,"initNodePersist");var tu={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:r.sent();return[4,ti.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(H.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:r.sent();return[4,ti.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();H.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:n.sent();return[4,ti.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();H.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:n.sent();return[4,ti.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(H.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(H.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(to.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(H.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tl=A(),td=R.promisify(k.exec);function tp(e){return"error_list:".concat(e)}I(tp,"getErrorListKey");function tf(e){return tg.apply(this,arguments)}function tg(){tg=s(function(e){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tp(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,tu.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tu.getLogLink(n)];case 1:e=t.sent();e&&H.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();H.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tg.apply(this,arguments)}I(tf,"saveErrorListToStorage");function tm(){return ty.apply(this,arguments)}function ty(){ty=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,tu.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(H.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return ty.apply(this,arguments)}I(tm,"getStoredErrorLists");function th(){return tv.apply(this,arguments)}function tv(){tv=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tu.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();H.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tv.apply(this,arguments)}I(th,"clearAllErrorLists");function tx(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,y,h,v,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===F.Error?F.Error:F.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(y=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&y!==void 0?y:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===F.Error?F.Error:F.Warning,message:(v=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):g.length?t.push({file:"commitlint",type:F.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tf(t),tl.DEBUG&&n.length&&(H.warn("Unmatched lines:"),n.forEach(function(e){return H.info(" ".concat(e))}))}I(tx,"parseTextErrors");function tj(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?F.Error:F.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tf(n)}catch(t){tx(e)}}I(tj,"parseCommandOutput");function tb(e){return tI.apply(this,arguments)}function tI(){tI=s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tj;n=new AbortController;G.default.on("SIGINT",function(){H.warn("Process interrupted. Terminating..."),n.abort(),G.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,td(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&H.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return tI.apply(this,arguments)}I(tb,"executeCommand");function tw(e){return{raw:!0,cmd:e}}I(tw,"rawCommand");function tE(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eW," ").concat(em," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eW," ").concat(eU," ").concat(eT," ").concat(e):"".concat(eW," ").concat(e_," ").concat(e)}I(tE,"formatCLI");function tS(e,t){return typeof e=="function"?tE(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tE(e,t):e}I(tS,"formatCommand");function tC(e){return tO.apply(this,arguments)}function tO(){tO=s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e7(em)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tS(r,i)]}))]}})});return tO.apply(this,arguments)}I(tC,"resolveCommands");function t_(e,t){return tT.apply(this,arguments)}function tT(){tT=s(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);H.start("".concat(e)),tl.DEBUG&&H.info("→ ".concat(t));return[4,tb(t)];case 1:r.sent(),H.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw H.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tT.apply(this,arguments)}I(t_,"runCommand");function tk(){return tG.apply(this,arguments)}function tG(){tG=s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!ea(eZ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e3.typescriptCheck()];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=H.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tG.apply(this,arguments)}I(tk,"checkTypescript");function tR(){return tN.apply(this,arguments)}function tN(){tN=s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e3.eslintFix()];case 1:return[4,t_.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e3.eslintCheck()];case 4:return[4,t_.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tN.apply(this,arguments)}I(tR,"checkEslint");function tL(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";H.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}I(tL,"printIssues");function tq(){return tD.apply(this,arguments)}function tD(){tD=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tm()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===F.Error}),n=e.filter(function(e){return e.type===F.Warning});!t.length&&!n.length?H.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tL("Warnings",n),tL("Errors",t),(t.length>0||n.length>0)&&S.default.exit(1));return[2]}})});return tD.apply(this,arguments)}I(tq,"showCheckResult");function tM(){return tP.apply(this,arguments)}function tP(){tP=s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,th()];case 1:o.sent();return[4,e7(em)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(em)];return[4,e3.build()];case 4:return[4,t_.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e3.stageBuildDirectory()];case 6:return[4,t_.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw H.error("Error building and staging ".concat(em,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e3.lintStaged()];case 10:return[4,t_.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tq();return[2]}})});return tP.apply(this,arguments)}I(tM,"lintStaged");function tA(){return tF.apply(this,arguments)}function tF(){tF=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e3.eslintInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tF.apply(this,arguments)}I(tA,"inspectLint");function tU(){return tB.apply(this,arguments)}function tB(){tB=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,th()];case 1:e.sent();return[4,Promise.all([tk(),tR()])];case 2:e.sent(),tq();return[2]}})});return tB.apply(this,arguments)}I(tU,"lintCheck");function tK(){return tW.apply(this,arguments)}function tW(){tW=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,th()];case 1:e.sent();return[4,Promise.all([tk(),tR(!0)])];case 2:e.sent(),tq();return[2]}})});return tW.apply(this,arguments)}I(tK,"lintFix");function tY(){return tH.apply(this,arguments)}function tH(){tH=s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,th()];case 1:t.sent();e=["Validating commit message"];return[4,e3.commitLint()];case 2:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tq();return[2]}})});return tH.apply(this,arguments)}I(tY,"commitLint");function tJ(){return t$.apply(this,arguments)}function t$(){t$=s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e3.configureGitHook()];case 1:return[4,t_.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ec(eZ.GIT_HOOK);return[4,tC(e0)];case 3:t=s.sent();eo(eZ.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(eI,"\n");ea(eZ.GIT_IGNORE)?X(eZ.GIT_IGNORE,"utf-8").split("\n").includes(eI)||et(eZ.GIT_IGNORE,n,"utf-8"):Z(eZ.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,e3.simpleGitHooks()];case 4:return[4,t_.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return t$.apply(this,arguments)}I(tJ,"setupGitHook");function tV(){return tz.apply(this,arguments)}function tz(){tz=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tr([em],{update:!0,postInstallActions:[tJ]})];case 1:e.sent();return[2]}})});return tz.apply(this,arguments)}I(tV,"setup");function tQ(){return tX.apply(this,arguments)}function tX(){tX=s(function(){return m(this,function(e){switch(e.label){case 0:ec(eZ.NODE_MODULES,eZ.PNPM_LOCK_YAML);return[4,tt()];case 1:e.sent();return[4,tJ()];case 2:e.sent();return[2]}})});return tX.apply(this,arguments)}I(tQ,"reset");function tZ(){return t0.apply(this,arguments)}function t0(){t0=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e3.nodeModulesInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t0.apply(this,arguments)}I(tZ,"inspect");function t1(){return t2.apply(this,arguments)}function t2(){t2=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e3.testUnit()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t2.apply(this,arguments)}I(t1,"testUnit");function t4(){return t3.apply(this,arguments)}function t3(){t3=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e3.testE2e()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t3.apply(this,arguments)}I(t4,"testE2E");function t8(e){return t5.apply(this,arguments)}function t5(){t5=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e3.mongoMigrateCreate(e)];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return t5.apply(this,arguments)}I(t8,"mongoMigrateCreate");function t6(){return t9.apply(this,arguments)}function t9(){t9=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e3.mongoMigrateUp()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t9.apply(this,arguments)}I(t6,"mongoMigrateUp");function t7(){return ne.apply(this,arguments)}function ne(){ne=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e3.mongoMigrateDown()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return ne.apply(this,arguments)}I(t7,"mongoMigrateDown");function nt(){return nn.apply(this,arguments)}function nn(){nn=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Checking MongoDB migration status"];return[4,e3.mongoMigrateStatus()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return nn.apply(this,arguments)}I(nt,"mongoMigrateStatus");s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,O.default)((0,C.hideBin)(S.default.argv)).scriptName(e_).usage("$0 <command> [options]").command("lint","Check code for linting issues",tU).command("lint:fix","Fix linting issues automatically",tK).command("lint:inspect","View active ESLint configuration",tA).command("lint-staged","Run lint checks on staged files",tM).command("commitlint","Validate commit message format",tY).command("setup","Initialize project setup and dependencies",tV).command("reset","Reset the project and reinstall dependencies",tQ).command("inspect","Analyze installed project dependencies",tZ).command("test:unit","Run unit test suite",t1).command("test:e2e","Run end-to-end test suite",t4).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=s(function(e){return m(this,function(t){switch(t.label){case 0:if(!e.name){H.error("Migration name is required.");return[2]}return[4,t8(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",t6).command("mongo:migrate:down","Rollback last MongoDB migration",t7).command("mongo:migrate:status","Check MongoDB migration status",nt).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(_.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();H.error("Fatal: ".concat(e.message)),S.default.exit(1);return[3,3];case 3:return[2]}})})();
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var h=Object.defineProperty;var y=function(e,t){return h(e,"name",{value:t,configurable:!0})};import v from"node:process";import{hideBin as x}from"yargs/helpers";import j from"yargs/yargs";var b={name:"@cyberskill/shared",type:"module",version:"1.102.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.3","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var I=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as w}from"node:child_process";import E from"node:process";import*as S from"node:util";var C=".cyberskill-storage";import O from"dotenv";import{bool as _,cleanEnv as T,str as k}from"envalid";import G from"node:os";import R from"node:path";import L from"node:process";O.config();function N(){var e={DEBUG:L.env.DEBUG||!1,CWD:L.env.CWD||L.cwd(),CYBERSKILL_STORAGE_DIRECTORY:L.env.CYBERSKILL_STORAGE_DIRECTORY||R.join(G.homedir(),C)};return T(e,{DEBUG:_(),CWD:k(),CYBERSKILL_STORAGE_DIRECTORY:k()})}y(N,"getEnv");var D=function(e){return e.Error="error",e.Warning="warning",e}({});import M from"chalk";import P from"consola";import{GraphQLError as A}from"graphql";var q=N();q.DEBUG||(P.level=4);function F(e){var t=M[e];return typeof t=="function"?t:M.green}y(F,"chalkKeyword");var U={silent:P.silent,level:P.level,fatal:P.fatal,error:P.error,warn:P.warn,log:P.log,info:P.info,success:P.success,ready:P.ready,start:P.start,box:P.box,debug:P.debug,trace:P.trace,verbose:P.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){P.box(M.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;P.log("".concat(M.gray("File:")," ").concat(M.blue("".concat(t).concat(r?":".concat(r):"")))),s&&P.log(" ".concat(F(n)("Rule:")," ").concat(s)),P.log(" ".concat(F(n)("Message:")," ").concat(i))}),P.box(F(n)("".concat(e," : ").concat(t.length))),P.log(M.gray("─".repeat(40)))}};var B={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import K from"node-fetch";import W from"fs-extra";var Y=W.readFileSync,H=W.writeFileSync,J=W.pathExistsSync,$=W.appendFileSync,V=W.copySync,z=W.removeSync,Q=W.statSync,X=W.readJsonSync,Z=W.writeJsonSync;function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return J(e)})}y(ee,"existsSync");function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){J(e)&&z(e)})}y(et,"removeSync");import{join as en,resolve as er}from"node:path";var es=N();function ei(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return er.apply(void 0,[es.CWD].concat(p(t)))}y(ei,"resolveWorkingPath");function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return en.apply(void 0,p(t))}y(eo,"join");var ec=N(),ea=ec.CWD,eu="@cyberskill/shared",el="node_modules",ed="dist",ep="package.json",ef="package-lock.json",eg="tsconfig.json",em=".gitignore",eh=".simple-git-hooks.json",ey="pnpm-lock.yaml",ev=".git/hooks/",ex=".git/COMMIT_EDITMSG",ej=".migrate-mongo.config.js",eb=eo(ea,el,eu,ed),eI="cyberskill",ew="src/nodejs/cli/index.ts",eE="eslint",eS="eslint",eC="vitest",eO="playwright",e_="vitest",eT="@commitlint/cli",ek="commitlint",eG="lint-staged",eR="lint-staged",eL="typescript",eN="tsc",eD="tsx",eM="git",eP="pnpm",eA="pnpm exec",eq="simple-git-hooks",eF="simple-git-hooks",eU="@eslint/config-inspector",eB="eslint-config-inspector",eK="node-modules-inspector",eW="node-modules-inspector",eY="migrate-mongo",eH="./node_modules/migrate-mongo/bin/migrate-mongo",eJ={CYBERSKILL_DIRECTORY:eb,WORKING_DIRECTORY:ea,TS_CONFIG:ei(eg),GIT_IGNORE:ei(em),GIT_HOOK:ei(ev),GIT_COMMIT_MSG:ei(ex),SIMPLE_GIT_HOOKS_JSON:ei(eh),PACKAGE_JSON:ei(ep),PACKAGE_LOCK_JSON:ei(ef),PNPM_LOCK_YAML:ei(ey),NODE_MODULES:ei(el),MIGRATE_MONGO_CONFIG:ei(ej),LINT_STAGED_CONFIG:ei("".concat(eb,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ei("".concat(eb,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ei("".concat(eb,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ei("".concat(eb,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ei("".concat(eb,"/react/vitest/vitest.e2e.js"))};function e$(e){var t=e.isCurrentProject;return l({"pre-commit":eR,"commit-msg":ek},t&&{"pre-push":ty("".concat(eM," pull"))})}y(e$,"createGitHooksConfig");function eV(e,t,n){return ez.apply(this,arguments)}function ez(){ez=s(function(e,t,n){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case I.CLI:return[3,1];case I.STRING:return[3,3]}return[3,4];case 1:return[4,e6(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tx(ty("".concat(eA," ").concat(n))))];case 3:return[2,tx(ty(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ez.apply(this,arguments)}y(eV,"buildCommand");function eQ(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,eV(e,t,n)]})})}y(eQ,"commandFactory");var eX={simpleGitHooks:eQ(I.CLI,eq,eF),eslintInspect:eQ(I.CLI,eU,eB),nodeModulesInspect:eQ(I.CLI,eK,eW),eslintCheck:eQ(I.CLI,eE,"".concat(eS," ").concat(eJ.WORKING_DIRECTORY)),eslintFix:eQ(I.CLI,eE,"".concat(eS," ").concat(eJ.WORKING_DIRECTORY," --fix")),typescriptCheck:eQ(I.CLI,eL,"".concat(eN," -p ").concat(eJ.TS_CONFIG," --noEmit")),configureGitHook:eQ(I.STRING,"".concat(eM," config core.hooksPath ").concat(eJ.GIT_HOOK)),testUnit:eQ(I.CLI,eC,"".concat(e_," --config ").concat(eJ.UNIT_TEST_CONFIG)),testE2e:eQ(I.CLI,"".concat(eC," ").concat(eO),"".concat(e_," --config ").concat(eJ.E2E_TEST_CONFIG)),mongoMigrateCreate:y(function(e){return eQ(I.CLI,eY,"".concat(eD," ").concat(eH," create ").concat(e," -f ").concat(eJ.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," up -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," down -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),mongoMigrateStatus:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," status -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),commitLint:eQ(I.CLI,eT,"".concat(ek," --edit ").concat(eJ.GIT_COMMIT_MSG," --config ").concat(eJ.COMMITLINT_CONFIG)),lintStaged:eQ(I.CLI,eG,"".concat(eR," --config ").concat(eJ.LINT_STAGED_CONFIG)),stageBuildDirectory:eQ(I.STRING,"".concat(eM," add ").concat(ed)),build:eQ(I.STRING,"".concat(eP," run build")),pnpmInstallStandard:eQ(I.STRING,"".concat(eP," install")),pnpmInstallLegacy:eQ(I.STRING,"".concat(eP," install --legacy-peer-deps")),pnpmInstallForce:eQ(I.STRING,"".concat(eP," install --force"))};var eZ=N();function e0(e){var t=eo(eZ.CWD,ep);if(!ee(t))return!1;try{var n=X(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return U.warn("Failed to read package.json: ".concat(e.message)),!1}}y(e0,"getPackage");function e1(e){return e2.apply(this,arguments)}function e2(){e2=s(function(e){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,K("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw U.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return e2.apply(this,arguments)}y(e1,"getLatestPackageVersion");function e4(e,t){return e3.apply(this,arguments)}function e3(){e3=s(function(e,t){var n,r,s,i,o,c,a,u,d,p,f,g,h,y,v,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e0(e);if(!n)return[2,l({},B)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},h=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=h[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];j=y;return[3,3];case 1:return[4,e1(e)];case 2:j=m.sent();m.label=3;case 3:v=j,x=d||y===v;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=p?"dependencies":f?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==v&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=v,Z(a,u),U.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(U.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},B))];case 5:return[2]}})});return e3.apply(this,arguments)}y(e4,"checkPackage");function e8(){return e5.apply(this,arguments)}function e5(){e5=s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:y(function(){return eX.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return eX.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return eX.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tI("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();U.warn("Installation attempt failed: ".concat(a)),U.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return e5.apply(this,arguments)}y(e8,"installDependencies");function e6(e,t){return e9.apply(this,arguments)}function e9(){e9=s(function(e,t){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!ee(eJ.PACKAGE_JSON)){U.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e4(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e8()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw U.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return e9.apply(this,arguments)}y(e6,"setupPackages");import e7 from"node-persist";var te=N();function tt(){return tn.apply(this,arguments)}function tn(){tn=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e7.defaultInstance;if(e)return[3,2];return[4,e7.init({dir:te.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return tn.apply(this,arguments)}y(tt,"initNodePersist");var tr={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e7.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(U.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e7.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();U.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e7.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();U.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e7.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(U.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(U.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(te.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(U.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ts=N(),ti=S.promisify(w);function to(e){return"error_list:".concat(e)}y(to,"getErrorListKey");function tc(e){return ta.apply(this,arguments)}function ta(){ta=s(function(e){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=to(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,tr.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tr.getLogLink(n)];case 1:e=t.sent();e&&U.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();U.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return ta.apply(this,arguments)}y(tc,"saveErrorListToStorage");function tu(){return tl.apply(this,arguments)}function tl(){tl=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tr.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,tr.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(U.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return tl.apply(this,arguments)}y(tu,"getStoredErrorLists");function td(){return tp.apply(this,arguments)}function tp(){tp=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tr.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tr.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();U.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tp.apply(this,arguments)}y(td,"clearAllErrorLists");function tf(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,h,y,v,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===D.Error?D.Error:D.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(h=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&h!==void 0?h:""}):f.length?t.push({file:(y=f===null||f===void 0?void 0:f[1])!==null&&y!==void 0?y:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===D.Error?D.Error:D.Warning,message:(v=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):g.length?t.push({file:"commitlint",type:D.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tc(t),ts.DEBUG&&n.length&&(U.warn("Unmatched lines:"),n.forEach(function(e){return U.info(" ".concat(e))}))}y(tf,"parseTextErrors");function tg(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?D.Error:D.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&tc(n)}catch(t){tf(e)}}y(tg,"parseCommandOutput");function tm(e){return th.apply(this,arguments)}function th(){th=s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tg;n=new AbortController;E.on("SIGINT",function(){U.warn("Process interrupted. Terminating..."),n.abort(),E.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ti(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&U.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return th.apply(this,arguments)}y(tm,"executeCommand");function ty(e){return{raw:!0,cmd:e}}y(ty,"rawCommand");function tv(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eA," ").concat(eu," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eA," ").concat(eD," ").concat(ew," ").concat(e):"".concat(eA," ").concat(eI," ").concat(e)}y(tv,"formatCLI");function tx(e,t){return typeof e=="function"?tv(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tv(e,t):e}y(tx,"formatCommand");function tj(e){return tb.apply(this,arguments)}function tb(){tb=s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e4(eu)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tx(r,i)]}))]}})});return tb.apply(this,arguments)}y(tj,"resolveCommands");function tI(e,t){return tw.apply(this,arguments)}function tw(){tw=s(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);U.start("".concat(e)),ts.DEBUG&&U.info("→ ".concat(t));return[4,tm(t)];case 1:r.sent(),U.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw U.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tw.apply(this,arguments)}y(tI,"runCommand");function tE(){return tS.apply(this,arguments)}function tS(){tS=s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!ee(eJ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eX.typescriptCheck()];case 1:return[4,tI.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=U.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tS.apply(this,arguments)}y(tE,"checkTypescript");function tC(){return tO.apply(this,arguments)}function tO(){tO=s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eX.eslintFix()];case 1:return[4,tI.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eX.eslintCheck()];case 4:return[4,tI.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tO.apply(this,arguments)}y(tC,"checkEslint");function t_(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";U.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(t_,"printIssues");function tT(){return tk.apply(this,arguments)}function tk(){tk=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tu()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===D.Error}),n=e.filter(function(e){return e.type===D.Warning});!t.length&&!n.length?U.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(t_("Warnings",n),t_("Errors",t),(t.length>0||n.length>0)&&v.exit(1));return[2]}})});return tk.apply(this,arguments)}y(tT,"showCheckResult");function tG(){return tR.apply(this,arguments)}function tR(){tR=s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,td()];case 1:o.sent();return[4,e4(eu)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(eu)];return[4,eX.build()];case 4:return[4,tI.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eX.stageBuildDirectory()];case 6:return[4,tI.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw U.error("Error building and staging ".concat(eu,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eX.lintStaged()];case 10:return[4,tI.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tT();return[2]}})});return tR.apply(this,arguments)}y(tG,"lintStaged");function tL(){return tN.apply(this,arguments)}function tN(){tN=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eX.eslintInspect()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tN.apply(this,arguments)}y(tL,"inspectLint");function tD(){return tM.apply(this,arguments)}function tM(){tM=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tE(),tC()])];case 2:e.sent(),tT();return[2]}})});return tM.apply(this,arguments)}y(tD,"lintCheck");function tP(){return tA.apply(this,arguments)}function tA(){tA=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tE(),tC(!0)])];case 2:e.sent(),tT();return[2]}})});return tA.apply(this,arguments)}y(tP,"lintFix");function tq(){return tF.apply(this,arguments)}function tF(){tF=s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,eX.commitLint()];case 2:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tT();return[2]}})});return tF.apply(this,arguments)}y(tq,"commitLint");function tU(){return tB.apply(this,arguments)}function tB(){tB=s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eX.configureGitHook()];case 1:return[4,tI.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),et(eJ.GIT_HOOK);return[4,tj(e$)];case 3:t=s.sent();Z(eJ.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(eh,"\n");ee(eJ.GIT_IGNORE)?Y(eJ.GIT_IGNORE,"utf-8").split("\n").includes(eh)||$(eJ.GIT_IGNORE,n,"utf-8"):H(eJ.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,eX.simpleGitHooks()];case 4:return[4,tI.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return tB.apply(this,arguments)}y(tU,"setupGitHook");function tK(){return tW.apply(this,arguments)}function tW(){tW=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e6([eu],{update:!0,postInstallActions:[tU]})];case 1:e.sent();return[2]}})});return tW.apply(this,arguments)}y(tK,"setup");function tY(){return tH.apply(this,arguments)}function tH(){tH=s(function(){return m(this,function(e){switch(e.label){case 0:et(eJ.NODE_MODULES,eJ.PNPM_LOCK_YAML);return[4,e8()];case 1:e.sent();return[4,tU()];case 2:e.sent();return[2]}})});return tH.apply(this,arguments)}y(tY,"reset");function tJ(){return t$.apply(this,arguments)}function t$(){t$=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eX.nodeModulesInspect()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t$.apply(this,arguments)}y(tJ,"inspect");function tV(){return tz.apply(this,arguments)}function tz(){tz=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eX.testUnit()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tz.apply(this,arguments)}y(tV,"testUnit");function tQ(){return tX.apply(this,arguments)}function tX(){tX=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eX.testE2e()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tX.apply(this,arguments)}y(tQ,"testE2E");function tZ(e){return t0.apply(this,arguments)}function t0(){t0=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eX.mongoMigrateCreate(e)];case 1:return[4,tI.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return t0.apply(this,arguments)}y(tZ,"mongoMigrateCreate");function t1(){return t2.apply(this,arguments)}function t2(){t2=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eX.mongoMigrateUp()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t2.apply(this,arguments)}y(t1,"mongoMigrateUp");function t4(){return t3.apply(this,arguments)}function t3(){t3=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eX.mongoMigrateDown()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t3.apply(this,arguments)}y(t4,"mongoMigrateDown");function t8(){return t5.apply(this,arguments)}function t5(){t5=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Checking MongoDB migration status"];return[4,eX.mongoMigrateStatus()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t5.apply(this,arguments)}y(t8,"mongoMigrateStatus");s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j(x(v.argv)).scriptName(eI).usage("$0 <command> [options]").command("lint","Check code for linting issues",tD).command("lint:fix","Fix linting issues automatically",tP).command("lint:inspect","View active ESLint configuration",tL).command("lint-staged","Run lint checks on staged files",tG).command("commitlint","Validate commit message format",tq).command("setup","Initialize project setup and dependencies",tK).command("reset","Reset the project and reinstall dependencies",tY).command("inspect","Analyze installed project dependencies",tJ).command("test:unit","Run unit test suite",tV).command("test:e2e","Run end-to-end test suite",tQ).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=s(function(e){return m(this,function(t){switch(t.label){case 0:if(!e.name){U.error("Migration name is required.");return[2]}return[4,tZ(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",t1).command("mongo:migrate:down","Rollback last MongoDB migration",t4).command("mongo:migrate:status","Check MongoDB migration status",t8).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();U.error("Fatal: ".concat(e.message)),v.exit(1);return[3,3];case 3:return[2]}})})();
2
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var h=Object.defineProperty;var y=function(e,t){return h(e,"name",{value:t,configurable:!0})};import v from"node:process";import{hideBin as x}from"yargs/helpers";import j from"yargs/yargs";var b={name:"@cyberskill/shared",type:"module",version:"1.103.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.3","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var I=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as w}from"node:child_process";import E from"node:process";import*as S from"node:util";var C=".cyberskill-storage";import O from"dotenv";import{bool as _,cleanEnv as T,str as k}from"envalid";import G from"node:os";import R from"node:path";import L from"node:process";O.config();function N(){var e={DEBUG:L.env.DEBUG||!1,CWD:L.env.CWD||L.cwd(),CYBERSKILL_STORAGE_DIRECTORY:L.env.CYBERSKILL_STORAGE_DIRECTORY||R.join(G.homedir(),C)};return T(e,{DEBUG:_(),CWD:k(),CYBERSKILL_STORAGE_DIRECTORY:k()})}y(N,"getEnv");var D=function(e){return e.Error="error",e.Warning="warning",e}({});import M from"chalk";import P from"consola";import{GraphQLError as A}from"graphql";var q=N();q.DEBUG||(P.level=4);function F(e){var t=M[e];return typeof t=="function"?t:M.green}y(F,"chalkKeyword");var U={silent:P.silent,level:P.level,fatal:P.fatal,error:P.error,warn:P.warn,log:P.log,info:P.info,success:P.success,ready:P.ready,start:P.start,box:P.box,debug:P.debug,trace:P.trace,verbose:P.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){P.box(M.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;P.log("".concat(M.gray("File:")," ").concat(M.blue("".concat(t).concat(r?":".concat(r):"")))),s&&P.log(" ".concat(F(n)("Rule:")," ").concat(s)),P.log(" ".concat(F(n)("Message:")," ").concat(i))}),P.box(F(n)("".concat(e," : ").concat(t.length))),P.log(M.gray("─".repeat(40)))}};var B={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import K from"node-fetch";import W from"fs-extra";var Y=W.readFileSync,H=W.writeFileSync,J=W.pathExistsSync,$=W.appendFileSync,V=W.copySync,z=W.removeSync,Q=W.statSync,X=W.readJsonSync,Z=W.writeJsonSync;function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return J(e)})}y(ee,"existsSync");function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){J(e)&&z(e)})}y(et,"removeSync");import{join as en,resolve as er}from"node:path";var es=N();function ei(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return er.apply(void 0,[es.CWD].concat(p(t)))}y(ei,"resolveWorkingPath");function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return en.apply(void 0,p(t))}y(eo,"join");var ec=N(),ea=ec.CWD,eu="@cyberskill/shared",el="node_modules",ed="dist",ep="package.json",ef="package-lock.json",eg="tsconfig.json",em=".gitignore",eh=".simple-git-hooks.json",ey="pnpm-lock.yaml",ev=".git/hooks/",ex=".git/COMMIT_EDITMSG",ej=".migrate-mongo.config.js",eb=eo(ea,el,eu,ed),eI="cyberskill",ew="src/nodejs/cli/index.ts",eE="eslint",eS="eslint",eC="vitest",eO="playwright",e_="vitest",eT="@commitlint/cli",ek="commitlint",eG="lint-staged",eR="lint-staged",eL="typescript",eN="tsc",eD="tsx",eM="git",eP="pnpm",eA="pnpm exec",eq="simple-git-hooks",eF="simple-git-hooks",eU="@eslint/config-inspector",eB="eslint-config-inspector",eK="node-modules-inspector",eW="node-modules-inspector",eY="migrate-mongo",eH="./node_modules/migrate-mongo/bin/migrate-mongo",eJ={CYBERSKILL_DIRECTORY:eb,WORKING_DIRECTORY:ea,TS_CONFIG:ei(eg),GIT_IGNORE:ei(em),GIT_HOOK:ei(ev),GIT_COMMIT_MSG:ei(ex),SIMPLE_GIT_HOOKS_JSON:ei(eh),PACKAGE_JSON:ei(ep),PACKAGE_LOCK_JSON:ei(ef),PNPM_LOCK_YAML:ei(ey),NODE_MODULES:ei(el),MIGRATE_MONGO_CONFIG:ei(ej),LINT_STAGED_CONFIG:ei("".concat(eb,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ei("".concat(eb,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ei("".concat(eb,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ei("".concat(eb,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ei("".concat(eb,"/react/vitest/vitest.e2e.js"))};function e$(e){var t=e.isCurrentProject;return l({"pre-commit":eR,"commit-msg":ek},t&&{"pre-push":ty("".concat(eM," pull"))})}y(e$,"createGitHooksConfig");function eV(e,t,n){return ez.apply(this,arguments)}function ez(){ez=s(function(e,t,n){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case I.CLI:return[3,1];case I.STRING:return[3,3]}return[3,4];case 1:return[4,e6(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tx(ty("".concat(eA," ").concat(n))))];case 3:return[2,tx(ty(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ez.apply(this,arguments)}y(eV,"buildCommand");function eQ(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,eV(e,t,n)]})})}y(eQ,"commandFactory");var eX={simpleGitHooks:eQ(I.CLI,eq,eF),eslintInspect:eQ(I.CLI,eU,eB),nodeModulesInspect:eQ(I.CLI,eK,eW),eslintCheck:eQ(I.CLI,eE,"".concat(eS," ").concat(eJ.WORKING_DIRECTORY)),eslintFix:eQ(I.CLI,eE,"".concat(eS," ").concat(eJ.WORKING_DIRECTORY," --fix")),typescriptCheck:eQ(I.CLI,eL,"".concat(eN," -p ").concat(eJ.TS_CONFIG," --noEmit")),configureGitHook:eQ(I.STRING,"".concat(eM," config core.hooksPath ").concat(eJ.GIT_HOOK)),testUnit:eQ(I.CLI,eC,"".concat(e_," --config ").concat(eJ.UNIT_TEST_CONFIG)),testE2e:eQ(I.CLI,"".concat(eC," ").concat(eO),"".concat(e_," --config ").concat(eJ.E2E_TEST_CONFIG)),mongoMigrateCreate:y(function(e){return eQ(I.CLI,eY,"".concat(eD," ").concat(eH," create ").concat(e," -f ").concat(eJ.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," up -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," down -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),mongoMigrateStatus:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," status -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),commitLint:eQ(I.CLI,eT,"".concat(ek," --edit ").concat(eJ.GIT_COMMIT_MSG," --config ").concat(eJ.COMMITLINT_CONFIG)),lintStaged:eQ(I.CLI,eG,"".concat(eR," --config ").concat(eJ.LINT_STAGED_CONFIG)),stageBuildDirectory:eQ(I.STRING,"".concat(eM," add ").concat(ed)),build:eQ(I.STRING,"".concat(eP," run build")),pnpmInstallStandard:eQ(I.STRING,"".concat(eP," install")),pnpmInstallLegacy:eQ(I.STRING,"".concat(eP," install --legacy-peer-deps")),pnpmInstallForce:eQ(I.STRING,"".concat(eP," install --force"))};var eZ=N();function e0(e){var t=eo(eZ.CWD,ep);if(!ee(t))return!1;try{var n=X(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return U.warn("Failed to read package.json: ".concat(e.message)),!1}}y(e0,"getPackage");function e1(e){return e2.apply(this,arguments)}function e2(){e2=s(function(e){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,K("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw U.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return e2.apply(this,arguments)}y(e1,"getLatestPackageVersion");function e4(e,t){return e3.apply(this,arguments)}function e3(){e3=s(function(e,t){var n,r,s,i,o,c,a,u,d,p,f,g,h,y,v,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e0(e);if(!n)return[2,l({},B)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},h=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=h[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];j=y;return[3,3];case 1:return[4,e1(e)];case 2:j=m.sent();m.label=3;case 3:v=j,x=d||y===v;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=p?"dependencies":f?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==v&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=v,Z(a,u),U.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(U.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},B))];case 5:return[2]}})});return e3.apply(this,arguments)}y(e4,"checkPackage");function e8(){return e5.apply(this,arguments)}function e5(){e5=s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:y(function(){return eX.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return eX.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return eX.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tI("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();U.warn("Installation attempt failed: ".concat(a)),U.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return e5.apply(this,arguments)}y(e8,"installDependencies");function e6(e,t){return e9.apply(this,arguments)}function e9(){e9=s(function(e,t){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!ee(eJ.PACKAGE_JSON)){U.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e4(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e8()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw U.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return e9.apply(this,arguments)}y(e6,"setupPackages");import e7 from"node-persist";var te=N();function tt(){return tn.apply(this,arguments)}function tn(){tn=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e7.defaultInstance;if(e)return[3,2];return[4,e7.init({dir:te.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return tn.apply(this,arguments)}y(tt,"initNodePersist");var tr={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e7.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(U.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tt()];case 1:r.sent();return[4,e7.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();U.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e7.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();U.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tt()];case 1:n.sent();return[4,e7.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(U.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(U.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(te.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(U.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ts=N(),ti=S.promisify(w);function to(e){return"error_list:".concat(e)}y(to,"getErrorListKey");function tc(e){return ta.apply(this,arguments)}function ta(){ta=s(function(e){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=to(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,tr.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tr.getLogLink(n)];case 1:e=t.sent();e&&U.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();U.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return ta.apply(this,arguments)}y(tc,"saveErrorListToStorage");function tu(){return tl.apply(this,arguments)}function tl(){tl=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tr.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,tr.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(U.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return tl.apply(this,arguments)}y(tu,"getStoredErrorLists");function td(){return tp.apply(this,arguments)}function tp(){tp=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tr.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return tr.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();U.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tp.apply(this,arguments)}y(td,"clearAllErrorLists");function tf(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,h,y,v,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===D.Error?D.Error:D.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(h=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&h!==void 0?h:""}):f.length?t.push({file:(y=f===null||f===void 0?void 0:f[1])!==null&&y!==void 0?y:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===D.Error?D.Error:D.Warning,message:(v=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):g.length?t.push({file:"commitlint",type:D.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tc(t),ts.DEBUG&&n.length&&(U.warn("Unmatched lines:"),n.forEach(function(e){return U.info(" ".concat(e))}))}y(tf,"parseTextErrors");function tg(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?D.Error:D.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&tc(n)}catch(t){tf(e)}}y(tg,"parseCommandOutput");function tm(e){return th.apply(this,arguments)}function th(){th=s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tg;n=new AbortController;E.on("SIGINT",function(){U.warn("Process interrupted. Terminating..."),n.abort(),E.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ti(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&U.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return th.apply(this,arguments)}y(tm,"executeCommand");function ty(e){return{raw:!0,cmd:e}}y(ty,"rawCommand");function tv(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eA," ").concat(eu," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eA," ").concat(eD," ").concat(ew," ").concat(e):"".concat(eA," ").concat(eI," ").concat(e)}y(tv,"formatCLI");function tx(e,t){return typeof e=="function"?tv(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tv(e,t):e}y(tx,"formatCommand");function tj(e){return tb.apply(this,arguments)}function tb(){tb=s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e4(eu)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tx(r,i)]}))]}})});return tb.apply(this,arguments)}y(tj,"resolveCommands");function tI(e,t){return tw.apply(this,arguments)}function tw(){tw=s(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);U.start("".concat(e)),ts.DEBUG&&U.info("→ ".concat(t));return[4,tm(t)];case 1:r.sent(),U.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw U.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tw.apply(this,arguments)}y(tI,"runCommand");function tE(){return tS.apply(this,arguments)}function tS(){tS=s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!ee(eJ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eX.typescriptCheck()];case 1:return[4,tI.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=U.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tS.apply(this,arguments)}y(tE,"checkTypescript");function tC(){return tO.apply(this,arguments)}function tO(){tO=s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eX.eslintFix()];case 1:return[4,tI.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eX.eslintCheck()];case 4:return[4,tI.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tO.apply(this,arguments)}y(tC,"checkEslint");function t_(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";U.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(t_,"printIssues");function tT(){return tk.apply(this,arguments)}function tk(){tk=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tu()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===D.Error}),n=e.filter(function(e){return e.type===D.Warning});!t.length&&!n.length?U.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(t_("Warnings",n),t_("Errors",t),(t.length>0||n.length>0)&&v.exit(1));return[2]}})});return tk.apply(this,arguments)}y(tT,"showCheckResult");function tG(){return tR.apply(this,arguments)}function tR(){tR=s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,td()];case 1:o.sent();return[4,e4(eu)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(eu)];return[4,eX.build()];case 4:return[4,tI.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eX.stageBuildDirectory()];case 6:return[4,tI.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw U.error("Error building and staging ".concat(eu,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eX.lintStaged()];case 10:return[4,tI.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tT();return[2]}})});return tR.apply(this,arguments)}y(tG,"lintStaged");function tL(){return tN.apply(this,arguments)}function tN(){tN=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eX.eslintInspect()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tN.apply(this,arguments)}y(tL,"inspectLint");function tD(){return tM.apply(this,arguments)}function tM(){tM=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tE(),tC()])];case 2:e.sent(),tT();return[2]}})});return tM.apply(this,arguments)}y(tD,"lintCheck");function tP(){return tA.apply(this,arguments)}function tA(){tA=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tE(),tC(!0)])];case 2:e.sent(),tT();return[2]}})});return tA.apply(this,arguments)}y(tP,"lintFix");function tq(){return tF.apply(this,arguments)}function tF(){tF=s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,eX.commitLint()];case 2:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tT();return[2]}})});return tF.apply(this,arguments)}y(tq,"commitLint");function tU(){return tB.apply(this,arguments)}function tB(){tB=s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eX.configureGitHook()];case 1:return[4,tI.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),et(eJ.GIT_HOOK);return[4,tj(e$)];case 3:t=s.sent();Z(eJ.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(eh,"\n");ee(eJ.GIT_IGNORE)?Y(eJ.GIT_IGNORE,"utf-8").split("\n").includes(eh)||$(eJ.GIT_IGNORE,n,"utf-8"):H(eJ.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,eX.simpleGitHooks()];case 4:return[4,tI.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return tB.apply(this,arguments)}y(tU,"setupGitHook");function tK(){return tW.apply(this,arguments)}function tW(){tW=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e6([eu],{update:!0,postInstallActions:[tU]})];case 1:e.sent();return[2]}})});return tW.apply(this,arguments)}y(tK,"setup");function tY(){return tH.apply(this,arguments)}function tH(){tH=s(function(){return m(this,function(e){switch(e.label){case 0:et(eJ.NODE_MODULES,eJ.PNPM_LOCK_YAML);return[4,e8()];case 1:e.sent();return[4,tU()];case 2:e.sent();return[2]}})});return tH.apply(this,arguments)}y(tY,"reset");function tJ(){return t$.apply(this,arguments)}function t$(){t$=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eX.nodeModulesInspect()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t$.apply(this,arguments)}y(tJ,"inspect");function tV(){return tz.apply(this,arguments)}function tz(){tz=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eX.testUnit()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tz.apply(this,arguments)}y(tV,"testUnit");function tQ(){return tX.apply(this,arguments)}function tX(){tX=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eX.testE2e()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tX.apply(this,arguments)}y(tQ,"testE2E");function tZ(e){return t0.apply(this,arguments)}function t0(){t0=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eX.mongoMigrateCreate(e)];case 1:return[4,tI.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return t0.apply(this,arguments)}y(tZ,"mongoMigrateCreate");function t1(){return t2.apply(this,arguments)}function t2(){t2=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eX.mongoMigrateUp()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t2.apply(this,arguments)}y(t1,"mongoMigrateUp");function t4(){return t3.apply(this,arguments)}function t3(){t3=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eX.mongoMigrateDown()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t3.apply(this,arguments)}y(t4,"mongoMigrateDown");function t8(){return t5.apply(this,arguments)}function t5(){t5=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Checking MongoDB migration status"];return[4,eX.mongoMigrateStatus()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t5.apply(this,arguments)}y(t8,"mongoMigrateStatus");s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j(x(v.argv)).scriptName(eI).usage("$0 <command> [options]").command("lint","Check code for linting issues",tD).command("lint:fix","Fix linting issues automatically",tP).command("lint:inspect","View active ESLint configuration",tL).command("lint-staged","Run lint checks on staged files",tG).command("commitlint","Validate commit message format",tq).command("setup","Initialize project setup and dependencies",tK).command("reset","Reset the project and reinstall dependencies",tY).command("inspect","Analyze installed project dependencies",tJ).command("test:unit","Run unit test suite",tV).command("test:e2e","Run end-to-end test suite",tQ).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=s(function(e){return m(this,function(t){switch(t.label){case 0:if(!e.name){U.error("Migration name is required.");return[2]}return[4,tZ(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",t1).command("mongo:migrate:down","Rollback last MongoDB migration",t4).command("mongo:migrate:status","Check MongoDB migration status",t8).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();U.error("Fatal: ".concat(e.message)),v.exit(1);return[3,3];case 3:return[2]}})})();