@cyberskill/shared 1.135.0 → 1.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/node/cli/cli.util.cjs +1 -1
- package/dist/node/cli/cli.util.js +1 -1
- package/dist/node/cli/index.cjs +1 -1
- package/dist/node/cli/index.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(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 i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return _(e,T()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(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 d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)N(e,t)}function p(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E(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 g(){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 v(){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 h(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){l(e,t,n[t])})}return e}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=C(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function C(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function _(e,t){if(t&&(D(t)==="object"||typeof t==="function")){return t}return r(e)}function N(e,t){N=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return N(e,t)}function I(e,n){return t(e)||E(e,n)||A(e,n)||g()}function b(e){return n(e)||m(e)||A(e)||v()}function D(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}function x(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 w=Object.defineProperty;var R=function(e,t,n){return t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var G=function(e,t){return w(e,"name",{value:t,configurable:!0})};var P=function(e,t,n){return R(e,(typeof t==="undefined"?"undefined":D(t))!="symbol"?t+"":t,n)};var M={extends:["@commitlint/config-conventional"],ignores:[function(e){return e.includes("[\uD83D\uDE80 CI - Deploy]")}]};var L=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});import k from"@antfu/eslint-config";import j from"@vitejs/plugin-react-swc";import{defineConfig as U}from"vitest/config";function F(e){return U(h({plugins:[j()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}G(F,"vitestE2E");import q from"@vitejs/plugin-react-swc";import{defineConfig as V}from"vitest/config";import Y from"fs-extra";var B=".cyberskill-storage";import K from"@dotenvx/dotenvx";import{bool as H,cleanEnv as W,str as z}from"envalid";import Q from"node:os";import J from"node:path";import $ from"node:process";var X=!1;function Z(){X||(K.config(),X=!0)}G(Z,"loadEnvFile");function ee(){Z();var e=W($.env,{CWD:z({default:$.cwd()}),DEBUG:H({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:z({default:J.join(Q.homedir(),B)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}G(ee,"getEnv");var et=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as en}from"node:child_process";import er from"node:process";import*as es from"node:util";var ei=function(e){return e.Error="error",e.Warning="warning",e}({});import eo from"chalk";import ea from"consola";import{GraphQLError as ec}from"graphql";var eu={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var el=ee();function ed(e){var t=e.message,n=e.status,r=n===void 0?eu.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new ec(a,{extensions:{code:r.CODE}}):new Error(a)}G(ed,"throwError");el.DEBUG||(ea.level=4);function ef(e){var t=eo[e];return typeof t=="function"?t:eo.green}G(ef,"chalkKeyword");var ep={silent:ea.silent,level:ea.level,fatal:ea.fatal,error:ea.error,warn:ea.warn,log:ea.log,info:ea.info,success:ea.success,ready:ea.ready,start:ea.start,box:ea.box,debug:ea.debug,trace:ea.trace,verbose:ea.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)){ea.box(eo.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;ea.log("".concat(eo.gray("File:")," ").concat(eo.blue("".concat(t).concat(r?":".concat(r):"")))),s&&ea.log(" ".concat(ef(n)("Rule:")," ").concat(s)),ea.log(" ".concat(ef(n)("Message:")," ").concat(i))}),ea.box(ef(n)("".concat(e," : ").concat(t.length))),ea.log(eo.gray("─".repeat(40)))}};function em(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=p(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&ep.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:eu.INTERNAL_SERVER_ERROR.CODE}}G(em,"catchErrorNode");var eE=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import eg from"node-fetch";import ev from"fs-extra";import eh from"node:path";var ey=ev,eS=ev.lstatSync,eO=ev.readdirSync,eC=ev.mkdirSync,e_=ev.readFileSync,eN=ev.unlinkSync,eI=ev.statSync,eb=ev.readJsonSync;function eD(e,t,n){ev.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}G(eD,"writeFileSync");function eA(e,t,n){ev.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}G(eA,"appendFileSync");function eT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return ev.pathExistsSync(e)})}G(eT,"pathExistsSync");function ex(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eT(e)&&ev.removeSync(e)})}G(ex,"removeSync");function ew(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);ev.copySync(e,t,h({filter:G(function(e){return eI(e).isDirectory()||!r||r.length===0?!0:r.includes(eh.extname(e))},"filter")},s))}G(ew,"copySync");var eR=ee();function eG(e){return i(function(){var t,n,r,s;return x(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,eg("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,{success:!0,result:r}];case 3:s=i.sent();return[2,em(s)];case 4:return[2]}})})()}G(eG,"getLatestPackageVersion");function eP(e){return i(function(){var t,n,r,s,i,o,a,c,u,l,d,f,p,m,E,g,v,h,y;return x(this,function(S){switch(S.label){case 0:S.trys.push([0,2,,3]);if(!eT(tU.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eE.DEPENDENCY,isDevDependency:e.type===eE.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=eb(tU.PACKAGE_JSON),n=t.name,r=t.version,s=r===void 0?"":r,i=t.dependencies,o=i===void 0?{}:i,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===eE.DEPENDENCY,isDevDependency:e.type===eE.DEV_DEPENDENCY,installedPath:tU.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,eG(e.name)];case 1:d=S.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eE.DEPENDENCY,isDevDependency:e.type===eE.DEV_DEPENDENCY,installedPath:"",file:{}}}];m=(p=(f=o[e.name])!==null&&f!==void 0?f:c[e.name])!==null&&p!==void 0?p:"",E=e6(eR.CWD,tt,e.name,tr);if(!eT(E))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];g=eb(E),v=g.version,h=v===void 0?"":v;return[2,m!==h?{success:!0,result:{name:e.name,currentVersion:h||m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:E,file:g}}:{success:!0,result:{name:e.name,currentVersion:m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:m===d.result,isDependency:u,isDevDependency:l,installedPath:E,file:g}}];case 2:y=S.sent();return[2,em(y)];case 3:return[2]}})})()}G(eP,"getPackage");function eM(e){return i(function(){var t,n,r,s,i;return x(this,function(o){try{;r=eb(tU.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),eD(tU.PACKAGE_JSON,JSON.stringify(r,null,4)),ep.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){em(e)}return[2]})})()}G(eM,"updatePackage");function eL(){return i(function(){var e,t,n,r,s,i,o,a,c,u,l,d,f;return x(this,function(p){switch(p.label){case 0:p.trys.push([0,12,,13]);e=[{command:G(function(){return tV.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:G(function(){return tV.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:G(function(){return tV.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,e1("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();em(l);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:return[3,13];case 12:f=p.sent();em(f);return[3,13];case 13:return[2]}})})()}G(eL,"installDependencies");function ek(e,t){return i(function(){var n,r,s,i,o,a,c,u,l,d,f,p;return x(this,function(m){switch(m.label){case 0:if(!eT(tU.PACKAGE_JSON)){ep.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,16,,17]);return[4,Promise.all(e.map(eP))];case 2:n=m.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?eM(e.result):Promise.resolve()}))];case 3:m.sent();return[4,eL()];case 4:m.sent();s=["Running ESLint with auto-fix"];return[4,tV.eslintFix()];case 5:return[4,e1.apply(void 0,s.concat([m.sent()]))];case 6:r=m.sent();m.label=7;case 7:r;o=true,a=false,c=undefined;m.label=8;case 8:m.trys.push([8,13,14,15]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();m.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:m.sent();m.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:f=m.sent();a=true;c=f;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:p=m.sent();em(p);return[3,17];case 17:return[2]}})})()}G(ek,"setupPackages");import ej from"node-persist";var eU=ee();function eF(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=ej.defaultInstance;if(e)return[3,2];return[4,ej.init({dir:eU.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]}})})()}G(eF,"initNodePersist");var eq={get:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eF()];case 1:r.sent();return[4,ej.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,em(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eF()];case 1:r.sent();return[4,ej.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();em(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eF()];case 1:n.sent();return[4,ej.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();em(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eF()];case 1:n.sent();return[4,ej.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(ep.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,em(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return x(this,function(t){try{return[2,"".concat(eU.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,em(e,{returnValue:null})]}return[2]})})()}};var eV=ee(),eY=es.promisify(en);function eB(e){return"error_list:".concat(e)}G(eB,"getErrorListKey");function eK(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=eB(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,eq.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(function(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,eq.getLogLink(n)];case 1:e=t.sent();e&&ep.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=s.sent();em(r);return[3,4];case 4:return[2]}})})()}G(eK,"saveErrorListToStorage");function eH(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eq.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 i(function(){var t;return x(this,function(n){switch(n.label){case 0:return[4,eq.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,em(n,{returnValue:[]})];case 4:return[2]}})})()}G(eH,"getStoredErrorLists");function eW(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eq.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 eq.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();em(n);return[3,4];case 4:return[2]}})})()}G(eW,"clearAllErrorLists");function ez(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 f=s.exec(e)||[],p=i.exec(e)||[],m=o.exec(e)||[];var E,g,v,h,y,S;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===ei.Error?ei.Error:ei.Warning,message:(E=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&E!==void 0?E:"",rule:(g=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(v=p===null||p===void 0?void 0:p[1])!==null&&v!==void 0?v:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===ei.Error?ei.Error:ei.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):m.length?t.push({file:"commitlint",type:ei.Error,message:(y=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&y!==void 0?y:"",rule:(S=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&eK(t),eV.DEBUG&&n.length&&(ep.warn("Unmatched lines:"),n.forEach(function(e){return ep.info(" ".concat(e))}))}G(ez,"parseTextErrors");function eQ(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?ei.Error:ei.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&eK(n)}catch(t){ez(e)}}G(eQ,"parseCommandOutput");function eJ(e){return i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return x(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eQ;n=new AbortController;er.on("SIGINT",function(){ep.warn("Process interrupted. Terminating..."),n.abort(),er.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,eY(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&&ep.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}G(eJ,"executeCommand");function e$(e){return{raw:!0,cmd:e}}G(e$,"rawCommand");function eX(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tx," ").concat(tD," ").concat(tm," ").concat(e):"".concat(tx," ").concat(tp," ").concat(e)}G(eX,"formatCLI");function eZ(e,t){return typeof e=="function"?eX(e(t),t):(typeof e==="undefined"?"undefined":D(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eX(e,t):e}G(eZ,"formatCommand");function e0(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,eP({name:te})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=I(e,2),r=t[0],s=t[1];return[r,eZ(s,n)]}))]}return[2]}})})()}G(e0,"resolveCommands");function e1(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);ep.start("".concat(e)),eV.DEBUG&&ep.info("→ ".concat(t));return[4,eJ(t)];case 1:r.sent(),ep.success("".concat(e," done."));return[3,3];case 2:n=r.sent();em(n);return[3,3];case 3:return[2]}})})()}G(e1,"runCommand");import e2 from"node:path";var e4=ee(),e3=e2;function e5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=e3).resolve.apply(r,[e4.CWD].concat(b(t)))}G(e5,"resolveWorkingPath");function e8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=e3).resolve.apply(r,b(t))}G(e8,"resolve");function e6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=e3).join.apply(r,b(t))}G(e6,"join");var e7=ee(),e9=e7.CWD,te="@cyberskill/shared",tt="node_modules",tn="dist",tr="package.json",ts="package-lock.json",ti="tsconfig.json",to=".gitignore",ta=".simple-git-hooks.json",tc="pnpm-lock.yaml",tu=".git/hooks/",tl=".git/COMMIT_EDITMSG",td=".migrate-mongo.config.js",tf=function(){var e=Y.readJsonSync(e5(tr)).name===te?e9:e6(e9,tt,te);return e6(e,tn)}(),tp="cyberskill",tm="src/node/cli/index.ts",tE="eslint",tg="eslint",tv="vitest",th="playwright",ty="vitest",tS="@commitlint/cli",tO="@commitlint/config-conventional",tC="commitlint",t_="lint-staged",tN="lint-staged",tI="typescript",tb="tsc",tD="tsx",tA="git",tT="pnpm",tx="pnpm exec",tw="simple-git-hooks",tR="simple-git-hooks",tG="@eslint/config-inspector",tP="eslint-config-inspector",tM="node-modules-inspector",tL="node-modules-inspector",tk="migrate-mongo",tj="./node_modules/migrate-mongo/bin/migrate-mongo",tU={CYBERSKILL_DIRECTORY:tf,WORKING_DIRECTORY:e9,TS_CONFIG:e5(ti),GIT_IGNORE:e5(to),GIT_HOOK:e5(tu),GIT_COMMIT_MSG:e5(tl),SIMPLE_GIT_HOOKS_JSON:e5(ta),PACKAGE_JSON:e5(tr),PACKAGE_LOCK_JSON:e5(ts),PNPM_LOCK_YAML:e5(tc),NODE_MODULES:e5(tt),MIGRATE_MONGO_CONFIG:e5(td),LINT_STAGED_CONFIG:e5("".concat(tf,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:e5("".concat(tf,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:e5("".concat(tf,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:e5("".concat(tf,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:e5("".concat(tf,"/react/vitest/vitest.e2e.js"))};function tF(e){var t=e.isCurrentProject;return h({"pre-commit":tN,"commit-msg":tC},t&&{"pre-push":e$("".concat(tA," pull"))})}G(tF,"createGitHooksConfig");function tq(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return x(this,function(n){switch(n.label){case 0:switch(t){case et.CLI:return[3,1];case et.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,ek(s,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,eZ(e$("".concat(tx," ").concat(r))))];case 4:return[2,eZ(e$(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}G(tq,"buildCommand");var tV={simpleGitHooks:tq({type:et.CLI,packages:[{name:tw,type:eE.DEV_DEPENDENCY}],command:tR}),eslintInspect:tq({type:et.CLI,packages:[{name:tG,type:eE.DEV_DEPENDENCY}],command:tP}),nodeModulesInspect:tq({type:et.CLI,packages:[{name:tM,type:eE.DEV_DEPENDENCY}],command:tL}),eslintCheck:tq({type:et.CLI,packages:[{name:tE,type:eE.DEV_DEPENDENCY}],command:"".concat(tg," ").concat(tU.WORKING_DIRECTORY," --no-cache")}),eslintFix:tq({type:et.CLI,packages:[{name:tE,type:eE.DEV_DEPENDENCY}],command:"".concat(tg," ").concat(tU.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tq({type:et.CLI,packages:[{name:tI,type:eE.DEPENDENCY}],command:"".concat(tb," -p ").concat(tU.TS_CONFIG," --noEmit")}),testUnit:tq({type:et.CLI,packages:[{name:tv,type:eE.DEV_DEPENDENCY}],command:"".concat(ty," --config ").concat(tU.UNIT_TEST_CONFIG)}),testE2e:tq({type:et.CLI,packages:[{name:tv,type:eE.DEV_DEPENDENCY}],command:"".concat(ty," --config ").concat(tU.E2E_TEST_CONFIG)}),mongoMigrateCreate:G(function(e){return tq({type:et.CLI,packages:[{name:tk,type:eE.DEPENDENCY}],command:"".concat(tD," ").concat(tj," create ").concat(e," -f ").concat(tU.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tq({type:et.CLI,packages:[{name:tk,type:eE.DEPENDENCY}],command:"".concat(tD," ").concat(tj," up -f ").concat(tU.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tq({type:et.CLI,packages:[{name:tk,type:eE.DEPENDENCY}],command:"".concat(tD," ").concat(tj," down -f ").concat(tU.MIGRATE_MONGO_CONFIG)}),commitLint:tq({type:et.CLI,packages:[{name:tS,type:eE.DEV_DEPENDENCY},{name:tO,type:eE.DEV_DEPENDENCY}],command:"".concat(tC," --edit ").concat(tU.GIT_COMMIT_MSG," --config ").concat(tU.COMMITLINT_CONFIG)}),lintStaged:tq({type:et.CLI,packages:[{name:t_,type:eE.DEV_DEPENDENCY}],command:"".concat(tN," --config ").concat(tU.LINT_STAGED_CONFIG)}),configureGitHook:tq({type:et.STRING,command:"".concat(tA," config core.hooksPath ").concat(tU.GIT_HOOK)}),stageBuildDirectory:tq({type:et.STRING,command:"".concat(tA," add ").concat(tn)}),build:tq({type:et.STRING,command:"".concat(tT," run --if-present build")}),pnpmInstallStandard:tq({type:et.STRING,command:"".concat(tT," install --no-frozen-lockfile")}),pnpmInstallLegacy:tq({type:et.STRING,command:"".concat(tT," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:tq({type:et.STRING,command:"".concat(tT," install --no-frozen-lockfile --force")})};function tY(e){return V(h({plugins:[q()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tU.UNIT_TEST_SETUP_CONFIG]}},e))}G(tY,"vitestUnit");function tB(e){try{return JSON.parse(e),!0}catch(e){return!1}}G(tB,"isJson");function tK(e){return(typeof e==="undefined"?"undefined":D(e))=="object"&&e!==null&&!Array.isArray(e)}G(tK,"isObject");function tH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r={};var s=true,i=false,o=undefined,a=true,c=false,u=undefined;try{for(var l=t.flat()[Symbol.iterator](),d;!(a=(d=l.next()).done);a=true){var f=d.value;try{for(var p=Object.entries(f)[Symbol.iterator](),m;!(s=(m=p.next()).done);s=true){var E=I(m.value,2),g=E[0],v=E[1];var h=r[g];if(Array.isArray(v)){var y=Array.isArray(h)?h:[];r[g]=b(new Set(b(y).concat(b(v))));continue}if(tK(v)){r[g]=tH(tK(h)?h:{},v);continue}r[g]=v}}catch(e){i=true;o=e}finally{try{if(!s&&p.return!=null){p.return()}}finally{if(i){throw o}}}}}catch(e){c=true;u=e}finally{try{if(!a&&l.return!=null){l.return()}}finally{if(c){throw u}}}return r}G(tH,"deepMerge");import*as tW from"globals";var tz=[{languageOptions:{globals:h({},tW.node,tW.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}],"dot-notation":"off"},ignores:["build","dist"]}];var tQ;var tJ=G(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r=tH.apply(void 0,[tz].concat(b(t.map(function(e){return e})))),s=r.ignores,i=O(r,["ignores"]),o=Array.isArray(s)&&s.every(function(e){return typeof e=="string"})?{ignores:s}:void 0,a=[i].concat(b(o?[o]:[]));return k.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(b(a)))},"handleESLint"),t$=(tQ={},l(tQ,L.ESLINT,function(e){return tJ(e)}),l(tQ,L.COMMITLINT,function(e){return tH(e)}),l(tQ,L.LINT_STAGED,function(e){return tH(e)}),l(tQ,L.VITEST_REACT_UNIT,function(e){return tY(e)}),l(tQ,L.VITEST_REACT_E2E,function(e){return F(e)}),tQ);function tX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var s=t$[e];if(!n||n.length===0)return s({});if(!s)throw new Error("Unknown config type: ".concat(e));return s.apply(void 0,b(n))}G(tX,"mergeConfigs");import{defineConfig as tZ}from"@eddeee888/gcg-typescript-resolver-files";Z();function t0(e){var t=e.uri,n=e.from,r=e.to,s=e.target,i=s===void 0?"client":s;var o=i==="client",a=i==="server";return S(h({schema:t,ignoreNoDocuments:!0,overwrite:!0},o&&{documents:[n]}),{generates:h({},o&&l({},r,{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0}}),a&&l({},r,tZ()))})}G(t0,"createGraphqlCodegenConfig");var t1={"*":["eslint --fix"]};var t2=(typeof window==="undefined"?"undefined":D(window))<"u";import{ApolloServer as t4}from"@apollo/server";import{expressMiddleware as t3}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as t5}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as t8,ApolloServerPluginLandingPageProductionDefault as t6}from"@apollo/server/plugin/landingPage/default";function t7(e){return new t4(h({schema:e.schema,plugins:[e.isDev?t8():t6(),t5({httpServer:e.server})].concat(b(e.drainServer?[{serverWillStart:function t(){return i(function(){return x(this,function(t){return[2,{drainServer:function t(){return i(function(){var t;return x(this,function(n){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),ep.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}G(t7,"createApolloServer");import t9 from"node:process";import{hideBin as ne}from"yargs/helpers";import nt from"yargs/yargs";var nn={name:"@cyberskill/shared",type:"module",version:"1.135.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/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/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"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/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/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint","lint-staged":"tsx src/node/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.7","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@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","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.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-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",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.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",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","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};function nr(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:if(!eT(tU.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tV.typescriptCheck()];case 1:return[4,e1.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=ep.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}G(nr,"checkTypescript");function ns(){return i(function(){var e,t,n,r;var s=arguments;return x(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,tV.eslintFix()];case 1:return[4,e1.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tV.eslintCheck()];case 4:return[4,e1.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}G(ns,"checkEslint");function ni(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";ep.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}G(ni,"printIssues");function no(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:return[4,eH()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===ei.Error}),n=e.filter(function(e){return e.type===ei.Warning});!t.length&&!n.length?ep.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ni("Warnings",n),ni("Errors",t),(t.length>0||n.length>0)&&t9.exit(1));return[2]}})})()}G(no,"showCheckResult");function na(){return i(function(){var e,t,n,r,s;return x(this,function(i){switch(i.label){case 0:return[4,eW()];case 1:i.sent();return[4,eP({name:te})];case 2:e=i.sent();if(!e.success){ep.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(te)];return[4,tV.build()];case 3:return[4,e1.apply(void 0,n.concat([i.sent()]))];case 4:i.sent();r=["Staging build artifacts"];return[4,tV.stageBuildDirectory()];case 5:return[4,e1.apply(void 0,r.concat([i.sent()]))];case 6:t=i.sent();i.label=7;case 7:t;s=["Executing lint-staged"];return[4,tV.lintStaged()];case 8:return[4,e1.apply(void 0,s.concat([i.sent()]))];case 9:i.sent(),no();return[2]}})})()}G(na,"lintStaged");function nc(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tV.eslintInspect()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nc,"inspectLint");function nu(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,eW()];case 1:e.sent();return[4,Promise.all([nr(),ns()])];case 2:e.sent(),no();return[2]}})})()}G(nu,"lintCheck");function nl(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,eW()];case 1:e.sent();return[4,Promise.all([nr(),ns(!0)])];case 2:e.sent(),no();return[2]}})})()}G(nl,"lintFix");function nd(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,eW()];case 1:t.sent();e=["Validating commit message"];return[4,tV.commitLint()];case 2:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),no();return[2]}})})()}G(nd,"commitLint");function nf(){return i(function(){var e,t,n,r;return x(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tV.configureGitHook()];case 1:return[4,e1.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ex(tU.GIT_HOOK);return[4,e0(tF)];case 3:t=s.sent();eD(tU.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ta,"\n");eT(tU.GIT_IGNORE)?e_(tU.GIT_IGNORE,"utf-8").split("\n").includes(ta)||eA(tU.GIT_IGNORE,n):eD(tU.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tV.simpleGitHooks()];case 4:return[4,e1.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}G(nf,"setupGitHook");function np(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,ek([{name:te,type:eE.DEPENDENCY}],{update:!0,postInstallActions:[nf]})];case 1:e.sent();return[2]}})})()}G(np,"prepare");function nm(){return i(function(){return x(this,function(e){switch(e.label){case 0:ex(tU.NODE_MODULES,tU.PNPM_LOCK_YAML);return[4,eL()];case 1:e.sent();return[4,nf()];case 2:e.sent();return[2]}})})()}G(nm,"reset");function nE(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tV.nodeModulesInspect()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nE,"inspect");function ng(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tV.testUnit()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(ng,"testUnit");function nv(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tV.testE2e()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nv,"testE2E");function nh(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tV.mongoMigrateCreate(e)];case 1:return[4,e1.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}G(nh,"mongoMigrateCreate");function ny(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tV.mongoMigrateUp()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(ny,"mongoMigrateUp");function nS(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tV.mongoMigrateDown()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nS,"mongoMigrateDown");(function(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,nt(ne(t9.argv)).scriptName(tp).usage("$0 <command> [options]").command("lint","Check code for linting issues",nu).command("lint:fix","Fix linting issues automatically",nl).command("lint:inspect","View active ESLint configuration",nc).command("lint-staged","Run lint checks on staged files",na).command("commitlint","Validate commit message format",nd).command("prepare","Initialize project and dependencies",np).command("reset","Reset the project and reinstall dependencies",nm).command("inspect","Analyze installed project dependencies",nE).command("test:unit","Run unit test suite",ng).command("test:e2e","Run end-to-end test suite",nv).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return x(this,function(t){switch(t.label){case 0:if(!e.name){ep.error("Migration name is required.");return[2]}return[4,nh(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",ny).command("mongo:migrate:down","Rollback last MongoDB migration",nS).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(nn.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();em(e),t9.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as nO}from"express";import{NestFactory as nC}from"@nestjs/core";import n_ from"body-parser";import nN from"compression";import nI from"cookie-parser";import nb from"cors";import nD from"express";import nA from"express-session";import nT from"express-useragent";function nx(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return h({origin:G(function(e,r){t||(n===null||n===void 0?void 0:n.includes(e!==null&&e!==void 0?e:""))?r(null,!0):r(new Error("Not allowed by CORS"),!1)},"origin"),credentials:!0},r)}G(nx,"createCorsOptions");function nw(e){return nb(nx(e))}G(nw,"createCors");function nR(e){return nA(e)}G(nR,"createSession");function nG(e){var t=nD();return t.set("trust proxy",1),t.use(nI()),t.use(nD.urlencoded({extended:!0})),t.use(nN()),t.use(nT.express()),(e===null||e===void 0?void 0:e.staticFolder)&&t.use(nD.static(e.staticFolder)),t}G(nG,"createExpress");function nP(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,nC.create(e.module)];case 1:r=s.sent();return[2,(r.getHttpAdapter().getInstance().set("trust proxy",1),r.use(nD.urlencoded({extended:!0})),r.use(nI()),r.use(nN()),r.use(nT.express()),e.staticFolder&&r.use(nD.static(e.staticFolder)),e.filters&&(t=r).useGlobalFilters.apply(t,b(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,b(e.pipes)),r)]}})})()}G(nP,"createNest");var nM="MONGO_MIGRATE_OPTIONS";import{Collection as nL,Db as nk}from"mongodb";import{Document as nj,Model as nU}from"mongoose";var nF=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nk);G(nF,"C_Db");var nq=nF,nV=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nj);G(nV,"C_Document");var nY=nV,nB=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nU);G(nB,"C_Model");var nK=nB,nH=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nL);G(nH,"C_Collection");var nW=nH;import{format as nz}from"date-fns";import nQ from"migrate-mongo";import{Document as nJ}from"mongoose";import n$ from"mongoose-aggregate-paginate-v2";import nX from"mongoose-paginate-v2";import{v4 as nZ}from"uuid";import n0 from"unorm";var n1={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},n2=Object.entries(n1).reduce(function(e,t){var n=I(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function n4(e){e=n0.nfkc(e);var t=h({},n1,n2);var n=true,r=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),o;!(n=(o=i.next()).done);n=true){var a=I(o.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return e}G(n4,"regexSearchMapper");function n3(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}G(n3,"removeAccent");var n5={Date:{is:G(function(e){return p(e,Date)},"is"),serialize:G(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:G(function(e){return new Date(e)},"deserialize")},Map:{is:G(function(e){return p(e,Map)},"is"),serialize:G(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:G(function(e){return new Map(e)},"deserialize")},Set:{is:G(function(e){return p(e,Set)},"is"),serialize:G(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:G(function(e){return new Set(e)},"deserialize")},RegExp:{is:G(function(e){return p(e,RegExp)},"is"),serialize:G(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:G(function(e){var t=e.source,n=e.flags;return new RegExp(t,n)},"deserialize")},BigInt:{is:G(function(e){return(typeof e==="undefined"?"undefined":D(e))=="bigint"},"is"),serialize:G(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:G(function(e){return BigInt(e)},"deserialize")}},n8={serialize:function e(e){return JSON.stringify(e,function(e,t){var n=true,r=false,s=undefined;try{for(var i=Object.keys(n5)[Symbol.iterator](),o;!(n=(o=i.next()).done);n=true){var a=o.value;var c=n5[a];if(c.is(t))return c.serialize(t)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return t})},deserialize:function e(e){return JSON.parse(e,function(e,t){if(t&&(typeof t==="undefined"?"undefined":D(t))=="object"&&"__type"in t&&typeof t.__type=="string"){var n=t.__type,r=n5[n];if(r)return r.deserialize(t.value)}return t})}};import n6 from"crypto-js";import n7 from"slugify";var n9=n7.default||n7;function re(e,t){var n=G(function(e){var n,r;return n9(e!==null&&e!==void 0?e:"",h({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(tK(e)){var r={};var s=true,i=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),c;!(s=(c=a.next()).done);s=true){var u=I(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;o=e}finally{try{if(!s&&a.return!=null){a.return()}}finally{if(i){throw o}}}return r}return n(e)}G(re,"generateSlug");function rt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return n6.SHA256(e).toString(n6.enc.Hex).slice(0,t)}G(rt,"generateShortId");function rn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:8;var t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?",n="";for(var r=0;r<e;r++){var s=Math.floor(Math.random()*t.length);n+=t.charAt(s)}return n}G(rn,"generateRandomPassword");function rr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e.split(/[?#]/)[0]||"",r=n.substring(n.lastIndexOf("/")+1);if(t)return r;var s=r.lastIndexOf(".");return s>0?r.slice(0,s):r}G(rr,"getFileName");function rs(e,t,n){var r=e.indexOf(t);if(r===-1)return"";var s=r+t.length,i=e.indexOf(n,s);return i===-1?"":e.slice(s,i)}G(rs,"substringBetween");var ri={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":D(e))=="object"?p(e,Date)?!1:p(e,Map)||p(e,Set)?e.size===0:p(e,WeakMap)||p(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var ro={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return nz(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?ro.getDateTime():new Date;return{id:nZ(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:nZ,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n,{strict:!0});return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(ro.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var f=ro.createSchema({mongoose:t,schema:r,virtuals:u});return ro.applyPlugins(f,[i&&nX,a&&n$]),ro.applyMiddlewares(f,d),t.model(n,f)},validator:{isEmpty:function e(){return function(e){return i(function(){return x(this,function(t){return[2,!ri.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return i(function(){return x(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!p(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:S(h({},nQ),{setConfig:G(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eD(tU.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(td,"\n");eT(tU.GIT_IGNORE)?e_(tU.GIT_IGNORE,"utf-8").split("\n").includes(td)||eA(tU.GIT_IGNORE,n):eD(tU.GIT_IGNORE,n)},"setConfig")})},ra=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);P(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=h({},ro.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,this.collection.insertOne(t)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=e.map(function(e){return h({},ro.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=s.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:eu.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,em(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,em(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}}]);return e}();G(ra,"MongoController");var rc=ra,ru=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);P(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.findOne(e,t,n);r&&s.populate(r);return[4,s.exec()];case 2:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:eu.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,em(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.find(e,t,n);r&&s.populate(r);i={success:!0};return[4,s.exec()];case 2:return[2,(i.result=c.sent(),i)];case 3:o=c.sent();return[2,em(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,em(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=i.sent().map(function(e){return p(e,nJ)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,h({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:eu.NOT_FOUND.CODE}];case 3:s=o.sent();return[2,em(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:s=o.sent();return[2,em(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=i.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:eu.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=i.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:eu.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return i(function(){var n,r,s,i,o;return x(this,function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);n=new Set;r=0;a.label=1;case 1:if(!(r<10))return[3,5];s=rt(e,r+t);i=!n.has(s);if(!i)return[3,3];n.add(s);return[4,this.model.exists({shortId:s})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:s}];a.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:eu.INTERNAL_SERVER_ERROR.CODE}];case 6:o=a.sent();return[2,em(o)];case 7:return[2]}})}).call(this)}},{key:"createSlug",value:function e(e,t,n){return i(function(){var r,s,o,a,c,u,d,f,p,m;return x(this,function(E){switch(E.label){case 0:r=this;E.label=1;case 1:E.trys.push([1,5,,6]);s=t[e],o=tK(s),a=G(function(t){var r=h({},n!==null&&n!==void 0?n:{});return o?S(h({},r),{$or:[l({},"slug.".concat(e),t),{slugHistory:{$elemMatch:l({},"slug.".concat(e),t)}}]}):S(h({},r),{$or:[{slug:t},{slugHistory:t}]})},"generateSlugQuery"),c=G(function(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:t=e,n=1;r.label=1;case 1:return[4,this.model.exists(a(t))];case 2:if(!r.sent())return[3,4];t="".concat(e,"-").concat(n++);r.label=3;case 3:return[3,1];case 4:return[2,t]}})}).call(r)},"generateUniqueSlug");if(!o)return[3,3];u={success:!0};d=Object.fromEntries;return[4,Promise.all(Object.entries(s).map(function(e){var t=I(e,2),n=t[0],r=t[1];return i(function(){var e,t;return x(this,function(s){switch(s.label){case 0:e=re(r);t=[n];return[4,c(e)];case 1:return[2,t.concat([s.sent()])]}})})()}))];case 2:return[2,(u.result=d.apply(Object,[E.sent()]),u)];case 3:f=re(s);p={success:!0};return[4,c(f)];case 4:return[2,(p.result=E.sent(),p)];case 5:m=E.sent();return[2,em(m)];case 6:return[2]}})}).call(this)}},{key:"aggregate",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}}]);return e}();G(ru,"MongooseController");var rl=ru;import{useServer as rd}from"graphql-ws/use/ws";import{WebSocketServer as rf}from"ws";function rp(e){return new rf({server:e.server,path:e.path})}G(rp,"createWSServer");function rm(e){return rd({schema:e.schema},e.server)}G(rm,"initGraphQLWS");import{ApolloClient as rE,ApolloError as rg,ApolloLink as rv,ApolloProvider as rh,from as ry,HttpLink as rS,InMemoryCache as rO,split as rC}from"@apollo/client";import{onError as r_}from"@apollo/client/link/error";import{removeTypenameFromVariables as rN}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as rI}from"@apollo/client/link/subscriptions";import{getMainDefinition as rb}from"@apollo/client/utilities";import{createClient as rD}from"graphql-ws";import rA,{useMemo as rT}from"react";import{FaInfo as rx}from"react-icons/fa6";import rw,{use as rR}from"react";import{FaRepeat as rG}from"react-icons/fa6";import{createContext as rP}from"react";var rM=rP(void 0);import rL from"./react/apollo-error/apollo-error.module.scss";function rk(){var e=rR(rM),t=e===null||e===void 0?void 0:e.error;if(!t)return null;var n=G(function(e,t){return(t===null||t===void 0?void 0:t.length)?rw.createElement("div",null,rw.createElement("strong",null,e,":"),rw.createElement("ul",null,t.map(function(e){return rw.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return rw.createElement("div",{className:rL["modal-backdrop"]},rw.createElement("div",{className:rL["modal-content"]},rw.createElement("button",{type:"button",className:rL["btn-close"],onClick:e.hideError},"✕"),rw.createElement("div",{className:rL["error-title"]},rw.createElement("button",{type:"button",className:rL["btn-retry"],onClick:G(function(){return window.location.reload()},"onClick")},rw.createElement(rG,null))," ",t.message),rw.createElement("div",{className:rL["error-details"]},t.networkError&&rw.createElement("pre",{className:"network"},rw.createElement("strong",null,"Network Error:")," ",t.networkError.message),n("GraphQL Errors",b(t.graphQLErrors)),n("Protocol Errors",b(t.protocolErrors)),n("Client Errors",b(t.clientErrors)),t.extraInfo&&rw.createElement("pre",{className:"extra"},rw.createElement("strong",null,"Extra Info:")," ",JSON.stringify(t.extraInfo,null,4)))))}G(rk,"ApolloError");import{use as rj}from"react";function rU(){var e=rj(rM);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}G(rU,"useApolloError");import rF,{useEffect as rq,useMemo as rV,useState as rY}from"react";var rB=null;function rK(e){rB=e}G(rK,"setGlobalApolloErrorCallback");function rH(e){rB===null||rB===void 0?void 0:rB(e)}G(rH,"showGlobalApolloError");function rW(e){var t=e.children;var n=I(rY(null),2),r=n[0],s=n[1];rq(function(){rK(s)},[]);var i=rV(function(){return{error:r,showError:s,hideError:G(function(){return s(null)},"hideError")}},[r]);return rF.createElement(rM,{value:i},t)}G(rW,"ApolloErrorProvider");import{consola as rz}from"consola/browser";var rQ={silent:rz.silent,level:rz.level,fatal:rz.fatal,error:rz.error,warn:rz.warn,log:rz.log,info:rz.info,success:rz.success,ready:rz.ready,start:rz.start,box:rz.box,debug:rz.debug,trace:rz.trace,verbose:rz.verbose};function rJ(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=p(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&rQ.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:eu.INTERNAL_SERVER_ERROR.CODE}}G(rJ,"catchError");import{toast as r$,Toaster as rX}from"react-hot-toast";var rZ="/graphql";var r0,r1=(r0=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);var e;e=o(this,t,arguments);P(e,"count",0);return e}u(t,[{key:"request",value:function e(e,t){var n=this;var r=Date.now();return this.count+=1,t(e).map(function(t){var s=Date.now()-r,i=e.operationName||"Unnamed";return rQ.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(s,"ms)")),t})}}]);return t}(rv),G(r0,"DevLoggerLink"),r0);function r2(e){var t=e.uri,n=e.wsUrl,r=e.customLinks,s=new r1,i=r_(function(e){var t=e.graphQLErrors,n=e.networkError,r=e.protocolErrors,s=e.operation;var i=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(t&&t.forEach(function(e){var t=e.message,n=e.locations,r=e.path;rQ.error("[GraphQL error] ".concat(i,": ").concat(t,", Location: ").concat(JSON.stringify(n,null,4),", Path: ").concat(r))}),r&&r.forEach(function(e){var t=e.message,n=e.extensions;rQ.error("[Protocol error]: ".concat(t,", Extensions: ").concat(JSON.stringify(n,null,4)))}),n&&rQ.error("[Network error]: ".concat(n)),t||r||n){var o,a;var c=(t===null||t===void 0?void 0:(o=t[0])===null||o===void 0?void 0:o.message)||(r===null||r===void 0?void 0:(a=r[0])===null||a===void 0?void 0:a.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",u=new rg({graphQLErrors:t||[],protocolErrors:r||[],clientErrors:[],networkError:n||null,errorMessage:c,extraInfo:{operation:s}});r$.error(function(e){return rA.createElement(rA.Fragment,null,c,"\xa0",rA.createElement(rx,{cursor:"pointer",onClick:G(function(){setTimeout(function(){rH(u)},0),r$.dismiss(e.id)},"onClick")}))})}}),o=rN();t||rQ.warn('[Apollo] No GraphQL URI provided — using "'.concat(rZ,'" as default'));var a=new rS({uri:t!==null&&t!==void 0?t:rZ,credentials:"include"}),c=n?new rI(rD({url:n})):rv.empty(),u=p(c,rv)?rC(function(e){var t=e.query;var n=rb(t);return n.kind==="OperationDefinition"&&n.operation==="subscription"},c,a):a;return u===a&&n&&rQ.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[s,i,o].concat(b(r!==null&&r!==void 0?r:[]),[u])}G(r2,"createApolloLinks");function r4(e){var t=e.isNextJS,n=e.options,r=e.children,s=e.client,i=e.provider,o=e.cache;var a=n||{},c=a.uri,u=a.wsUrl,l=a.customLinks,d=O(a,["uri","wsUrl","customLinks"]),f=s!==null&&s!==void 0?s:rE;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var m=i||rh,E=rT(function(){return ry(r2({uri:c!==null&&c!==void 0?c:rZ,wsUrl:u!==null&&u!==void 0?u:"",customLinks:l!==null&&l!==void 0?l:[]}))},[c,u,l]),g=rT(function(){return p(o,rO)?o:new rO},[o]),v=rT(function(){return new f(h({link:E,cache:g},d))},[f,E,g,d]),y=t?rA.createElement(m,{makeClient:G(function(){return v},"makeClient")},r):rA.createElement(m,{client:v},r);return rA.createElement(rA.Fragment,null,rA.createElement(rW,null,y,rA.createElement(rk,null)),rA.createElement(rX,{position:"top-right"}))}G(r4,"ApolloProvider");import{useTranslation as r3}from"react-i18next";var r5=r3;import r8 from"i18next";import{initReactI18next as r6}from"react-i18next";function r7(e){return r8.use(r6).init(e)}G(r7,"initI18next");import r9 from"classnames";import se from"react";import st from"./react/loading/loading.module.scss";function sn(e){var t=e.full,n=t===void 0?!1:t,r=e.block,s=r===void 0?!1:r,i=e.className,o=i===void 0?"":i,a=e.message,c=a===void 0?"Loading":a,u=O(e,["full","block","className","message"]);function l(){return se.createElement("div",h({className:st.container},u),se.createElement("div",{className:st.ring}),se.createElement("div",{className:st.ring}),se.createElement("div",{className:st.ring}),se.createElement("div",{className:st.ring}),c&&se.createElement("div",{className:st.message},c))}return G(l,"_renderLoading"),n?se.createElement("div",{className:r9(st.fullscreen,o)},l()):s?se.createElement("div",{className:r9(st.block,o)},l()):l()}G(sn,"Loading");import{createContext as sr}from"react";var ss=sr(void 0);import{use as si}from"react";function so(){var e=si(ss);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}G(so,"useLoading");import sa,{useCallback as sc,useMemo as su,useState as sl}from"react";function sd(e){var t=e.children;var n=I(sl(!1),2),r=n[0],s=n[1],i=I(sl(!1),2),o=i[0],a=i[1],c=sc(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),a(e)},[]),u=sc(function(){s(!1),a(!1)},[]),l=su(function(){return{isLoading:r,isGlobalLoading:o,showLoading:c,hideLoading:u}},[r,o,c,u]);return sa.createElement(ss,{value:l},r?sa.createElement(sn,{full:o}):t)}G(sd,"LoadingProvider");import{enUS as sf}from"date-fns/locale";var sp={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:sf,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};import{createContext as sm}from"react";var sE=sm(void 0);import{NextIntlClientProvider as sg}from"next-intl";import sv from"react";import{useTranslations as sh}from"next-intl";import{use as sy}from"react";function sS(){var e=sy(sE);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}G(sS,"useNextIntl");var sO=sh;function sC(e){var t=G(function(t){var n;var r;var s=sS(),i=s.currentLanguage,o=t.messages,a=t.languages,c="en",u=o[(i===null||i===void 0?void 0:i.value)||c],l=(r=(n=a.find(function(e){return e.value===(i===null||i===void 0?void 0:i.value)}))===null||n===void 0?void 0:n.timezone)!==null&&r!==void 0?r:sp.timezone;return o?sv.createElement(sg,{locale:(i===null||i===void 0?void 0:i.value)||c,messages:u||null,timeZone:l},sv.createElement(e,t)):(rQ.warn("Missing messages for language: ".concat((i===null||i===void 0?void 0:i.value)||c)),null)},"PageWithI18n");return t.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),t}G(sC,"withNextIntl");import s_,{useMemo as sN}from"react";import{useCallback as sI,useEffect as sb,useState as sD}from"react";import sA from"localforage";var sT={get:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sA.getItem(e)];case 1:return[2,n.sent()];case 2:t=n.sent();return[2,rJ(t,{returnValue:null})];case 3:return[2]}})})()},set:function e(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sA.setItem(e,t)];case 1:r.sent();return[3,3];case 2:n=r.sent();rJ(n);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sA.removeItem(e)];case 1:n.sent();return[3,3];case 2:t=n.sent();rJ(t);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sA.keys()];case 1:return[2,(e=n.sent())!==null&&e!==void 0?e:[]];case 2:t=n.sent();return[2,rJ(t,{returnValue:[]})];case 3:return[2]}})})()}};function sx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n8;var r=I(sD(t),2),s=r[0],o=r[1],a=I(sD(!1),2),c=a[0],u=a[1];sb(function(){var r=!0;return G(function(){return i(function(){var s,i,a,c;return x(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,sT.get(e)];case 1:s=l.sent();if(!r)return[3,5];if(!(s!==null))return[3,2];i=n.deserialize(s);o(i);return[3,5];case 2:if(!(t!==void 0))return[3,4];a=n.serialize(t);return[4,sT.set(e,a)];case 3:l.sent(),o(t);return[3,5];case 4:o(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();rJ(c),r&&o(t);return[3,8];case 7:r&&u(!0);return[7];case 8:return[2]}})})()},"loadValue")(),function(){r=!1,u(!1)}},[e,t,n]),sb(function(){if(!c)return;G(function(){return i(function(){var t,r;return x(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];t=n.serialize(s);return[4,sT.set(e,t)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:r=i.sent();rJ(r);return[3,4];case 4:return[2]}})})()},"saveValue")()},[s,e,n,c]);var l=sI(function(e){o(function(t){return typeof e=="function"?e(t):e})},[]),d=sI(function(){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sT.remove(e)];case 1:n.sent(),o(void 0);return[3,3];case 2:t=n.sent();rJ(t);return[3,3];case 3:return[2]}})})()},[e]);return{value:s,set:l,remove:d}}G(sx,"useStorage");function sw(e){var t=e.children;return s_.createElement(s_.Fragment,null,t)}G(sw,"LanguageWrapperBase");var sR=sC(sw);function sG(e){var t=e.children,n=e.languages,r=e.messages;var s=sx("lang",n[0]),i=s.value,o=s.set,a=sN(function(){return{languages:n,currentLanguage:i!==null&&i!==void 0?i:sp,setCurrentLanguage:o}},[n,o,i]);return s_.createElement(sE,{value:a},s_.createElement(sR,{languages:n,messages:r},t))}G(sG,"NextIntlProvider");export{rk as ApolloError,rM as ApolloErrorContext,rW as ApolloErrorProvider,r4 as ApolloProvider,tn as BUILD_DIRECTORY,tC as COMMIT_LINT_CLI,tO as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,tS as COMMIT_LINT_PACKAGE_NAME,tp as CYBERSKILL_CLI,tm as CYBERSKILL_CLI_PATH,tf as CYBERSKILL_DIRECTORY,te as CYBERSKILL_PACKAGE_NAME,B as CYBERSKILL_STORAGE_DIRECTORY,nW as C_Collection,nq as C_Db,nY as C_Document,nK as C_Model,tg as ESLINT_CLI,tP as ESLINT_INSPECT_CLI,tG as ESLINT_INSPECT_PACKAGE_NAME,tE as ESLINT_PACKAGE_NAME,et as E_CommandType,L as E_ConfigType,ei as E_IssueType,eE as E_PackageType,tA as GIT_CLI,tl as GIT_COMMIT_EDITMSG,tu as GIT_HOOK,to as GIT_IGNORE,rZ as GRAPHQL_URI_DEFAULT,t2 as IS_BROWSER,tN as LINT_STAGED_CLI,t_ as LINT_STAGED_PACKAGE_NAME,sn as Loading,ss as LoadingContext,sd as LoadingProvider,tj as MIGRATE_MONGO_CLI,td as MIGRATE_MONGO_CONFIG,tk as MIGRATE_MONGO_PACKAGE_NAME,nM as MONGO_MIGRATE_OPTIONS,rc as MongoController,rl as MongooseController,sp as NEXT_INTL_DEFAULT_LANGUAGE,tt as NODE_MODULES,tL as NODE_MODULES_INSPECT_CLI,tM as NODE_MODULES_INSPECT_PACKAGE_NAME,sE as NextIntlContext,sG as NextIntlProvider,tr as PACKAGE_JSON,ts as PACKAGE_LOCK_JSON,tU as PATH,th as PLAYWRIGHT_PACKAGE_NAME,tT as PNPM_CLI,tx as PNPM_EXEC_CLI,tc as PNPM_LOCK_YAML,eu as RESPONSE_STATUS,nO as Router,tw as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tR as SIMPLE_GIT_HOOK_CLI,ta as SIMPLE_GIT_HOOK_JSON,ti as TSCONFIG_JSON,tb as TSC_CLI,tI as TSC_PACKAGE_NAME,tD as TSX_CLI,rX as Toaster,ty as VITEST_CLI,tv as VITEST_PACKAGE_NAME,e9 as WORKING_DIRECTORY,n$ as aggregatePaginate,eA as appendFileSync,n_ as bodyParser,rJ as catchError,em as catchErrorNode,eW as clearAllErrorLists,tV as command,M as commitlintConfig,ew as copySync,t7 as createApolloServer,nw as createCors,nx as createCorsOptions,nG as createExpress,tF as createGitHooksConfig,t0 as createGraphqlCodegenConfig,nP as createNest,nR as createSession,rp as createWSServer,tH as deepMerge,tz as eslintConfig,nD as express,t3 as expressMiddleware,eZ as formatCommand,ey as fs,rn as generateRandomPassword,rt as generateShortId,re as generateSlug,ee as getEnv,rr as getFileName,eG as getLatestPackageVersion,eP as getPackage,eH as getStoredErrorLists,rm as initGraphQLWS,r7 as initI18next,eL as installDependencies,tB as isJson,tK as isObject,e6 as join,t1 as lintStagedConfig,Z as loadEnvFile,rQ as log,ep as logNode,eS as lstatSync,tX as mergeConfigs,eC as mkdirSync,ro as mongo,nX as mongoosePaginate,e3 as path,eT as pathExistsSync,e$ as rawCommand,e_ as readFileSync,eb as readJsonSync,eO as readdirSync,n4 as regexSearchMapper,n3 as removeAccent,ex as removeSync,e8 as resolve,e0 as resolveCommands,e5 as resolveWorkingPath,e1 as runCommand,n8 as serializer,rK as setGlobalApolloErrorCallback,ek as setupPackages,rH as showGlobalApolloError,eI as statSync,sT as storage,eq as storageNode,rs as substringBetween,ed as throwError,r$ as toast,eN as unlinkSync,eM as updatePackage,rU as useApolloError,so as useLoading,sS as useNextIntl,sx as useStorage,r5 as useTranslateI18next,sO as useTranslateNextIntl,ri as validate,F as vitestE2E,tY as vitestUnit,sC as withNextIntl,eD as writeFileSync};
|
|
1
|
+
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){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(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 i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return _(e,T()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(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 d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)N(e,t)}function p(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E(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 g(){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 v(){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 h(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){l(e,t,n[t])})}return e}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=C(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function C(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function _(e,t){if(t&&(D(t)==="object"||typeof t==="function")){return t}return r(e)}function N(e,t){N=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return N(e,t)}function I(e,n){return t(e)||E(e,n)||A(e,n)||g()}function b(e){return n(e)||m(e)||A(e)||v()}function D(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(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 T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(T=function(){return!!e})()}function x(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 w=Object.defineProperty;var R=function(e,t,n){return t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var G=function(e,t){return w(e,"name",{value:t,configurable:!0})};var P=function(e,t,n){return R(e,(typeof t==="undefined"?"undefined":D(t))!="symbol"?t+"":t,n)};var M={extends:["@commitlint/config-conventional"],ignores:[function(e){return e.includes("[\uD83D\uDE80 CI - Deploy]")}]};var L=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});import k from"@antfu/eslint-config";import j from"@vitejs/plugin-react-swc";import{defineConfig as U}from"vitest/config";function F(e){return U(h({plugins:[j()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}G(F,"vitestE2E");import q from"@vitejs/plugin-react-swc";import{defineConfig as V}from"vitest/config";import Y from"fs-extra";var B=".cyberskill-storage";import K from"@dotenvx/dotenvx";import{bool as H,cleanEnv as W,str as z}from"envalid";import Q from"node:os";import J from"node:path";import $ from"node:process";var X=!1;function Z(){X||(K.config(),X=!0)}G(Z,"loadEnvFile");function ee(){Z();var e=W($.env,{CWD:z({default:$.cwd()}),DEBUG:H({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:z({default:J.join(Q.homedir(),B)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}G(ee,"getEnv");var et=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as en}from"node:child_process";import er from"node:process";import*as es from"node:util";var ei=function(e){return e.Error="error",e.Warning="warning",e}({});import eo from"chalk";import ea from"consola";import{GraphQLError as ec}from"graphql";var eu={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};var el=ee();function ed(e){var t=e.message,n=e.status,r=n===void 0?eu.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new ec(a,{extensions:{code:r.CODE}}):new Error(a)}G(ed,"throwError");el.DEBUG||(ea.level=4);function ef(e){var t=eo[e];return typeof t=="function"?t:eo.green}G(ef,"chalkKeyword");var ep={silent:ea.silent,level:ea.level,fatal:ea.fatal,error:ea.error,warn:ea.warn,log:ea.log,info:ea.info,success:ea.success,ready:ea.ready,start:ea.start,box:ea.box,debug:ea.debug,trace:ea.trace,verbose:ea.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)){ea.box(eo.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;ea.log("".concat(eo.gray("File:")," ").concat(eo.blue("".concat(t).concat(r?":".concat(r):"")))),s&&ea.log(" ".concat(ef(n)("Rule:")," ").concat(s)),ea.log(" ".concat(ef(n)("Message:")," ").concat(i))}),ea.box(ef(n)("".concat(e," : ").concat(t.length))),ea.log(eo.gray("─".repeat(40)))}};function em(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=p(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&ep.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:eu.INTERNAL_SERVER_ERROR.CODE}}G(em,"catchErrorNode");var eE=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import eg from"node-fetch";import ev from"fs-extra";import eh from"node:path";var ey=ev,eS=ev.lstatSync,eO=ev.readdirSync,eC=ev.mkdirSync,e_=ev.readFileSync,eN=ev.unlinkSync,eI=ev.statSync,eb=ev.readJsonSync;function eD(e,t,n){ev.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}G(eD,"writeFileSync");function eA(e,t,n){ev.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}G(eA,"appendFileSync");function eT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return ev.pathExistsSync(e)})}G(eT,"pathExistsSync");function ex(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eT(e)&&ev.removeSync(e)})}G(ex,"removeSync");function ew(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);ev.copySync(e,t,h({filter:G(function(e){return eI(e).isDirectory()||!r||r.length===0?!0:r.includes(eh.extname(e))},"filter")},s))}G(ew,"copySync");var eR=ee();function eG(e){return i(function(){var t,n,r,s;return x(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,eg("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,{success:!0,result:r}];case 3:s=i.sent();return[2,em(s)];case 4:return[2]}})})()}G(eG,"getLatestPackageVersion");function eP(e){return i(function(){var t,n,r,s,i,o,a,c,u,l,d,f,p,m,E,g,v,h,y;return x(this,function(S){switch(S.label){case 0:S.trys.push([0,2,,3]);if(!eT(tU.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eE.DEPENDENCY,isDevDependency:e.type===eE.DEV_DEPENDENCY,installedPath:"",file:{}}}];t=eb(tU.PACKAGE_JSON),n=t.name,r=t.version,s=r===void 0?"":r,i=t.dependencies,o=i===void 0?{}:i,a=t.devDependencies,c=a===void 0?{}:a;if(e.name===n)return[2,{success:!0,result:{name:n,currentVersion:s,latestVersion:s,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===eE.DEPENDENCY,isDevDependency:e.type===eE.DEV_DEPENDENCY,installedPath:tU.PACKAGE_JSON,file:t}}];u=e.name in o,l=e.name in c;return[4,eG(e.name)];case 1:d=S.sent();if(!d.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];if(!u&&!l)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===eE.DEPENDENCY,isDevDependency:e.type===eE.DEV_DEPENDENCY,installedPath:"",file:{}}}];m=(p=(f=o[e.name])!==null&&f!==void 0?f:c[e.name])!==null&&p!==void 0?p:"",E=e6(eR.CWD,tt,e.name,tr);if(!eT(E))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:"",file:{}}}];g=eb(E),v=g.version,h=v===void 0?"":v;return[2,m!==h?{success:!0,result:{name:e.name,currentVersion:h||m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:u,isDevDependency:l,installedPath:E,file:g}}:{success:!0,result:{name:e.name,currentVersion:m,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:m===d.result,isDependency:u,isDevDependency:l,installedPath:E,file:g}}];case 2:y=S.sent();return[2,em(y)];case 3:return[2]}})})()}G(eP,"getPackage");function eM(e){return i(function(){var t,n,r,s,i;return x(this,function(o){try{;r=eb(tU.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),eD(tU.PACKAGE_JSON,JSON.stringify(r,null,4)),ep.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){em(e)}return[2]})})()}G(eM,"updatePackage");function eL(){return i(function(){var e,t,n,r,s,i,o,a,c,u,l,d,f;return x(this,function(p){switch(p.label){case 0:p.trys.push([0,12,,13]);e=[{command:G(function(){return tV.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:G(function(){return tV.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:G(function(){return tV.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,e1("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();em(l);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:return[3,13];case 12:f=p.sent();em(f);return[3,13];case 13:return[2]}})})()}G(eL,"installDependencies");function ek(e,t){return i(function(){var n,r,s,i,o,a,c,u,l,d,f,p;return x(this,function(m){switch(m.label){case 0:if(!eT(tU.PACKAGE_JSON)){ep.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,16,,17]);return[4,Promise.all(e.map(eP))];case 2:n=m.sent().filter(function(e){return e.success?!e.result.isCurrentProject&&(!e.result.isInstalled||!e.result.isUpToDate):!1});r=n.length>0;if(!r)return[3,7];return[4,Promise.all(n.map(function(e){return e.success?eM(e.result):Promise.resolve()}))];case 3:m.sent();return[4,eL()];case 4:m.sent();s=["Running ESLint with auto-fix"];return[4,tV.eslintFix()];case 5:return[4,e1.apply(void 0,s.concat([m.sent()]))];case 6:r=m.sent();m.label=7;case 7:r;o=true,a=false,c=undefined;m.label=8;case 8:m.trys.push([8,13,14,15]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();m.label=9;case 9:if(!!(o=(l=u.next()).done))return[3,12];d=l.value;return[4,d()];case 10:m.sent();m.label=11;case 11:o=true;return[3,9];case 12:return[3,15];case 13:f=m.sent();a=true;c=f;return[3,15];case 14:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 15:return[3,17];case 16:p=m.sent();em(p);return[3,17];case 17:return[2]}})})()}G(ek,"setupPackages");import ej from"node-persist";var eU=ee();function eF(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=ej.defaultInstance;if(e)return[3,2];return[4,ej.init({dir:eU.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]}})})()}G(eF,"initNodePersist");var eq={get:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eF()];case 1:r.sent();return[4,ej.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,em(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eF()];case 1:r.sent();return[4,ej.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();em(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eF()];case 1:n.sent();return[4,ej.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();em(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eF()];case 1:n.sent();return[4,ej.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(ep.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,em(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return x(this,function(t){try{return[2,"".concat(eU.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,em(e,{returnValue:null})]}return[2]})})()}};var eV=ee(),eY=es.promisify(en);function eB(e){return"error_list:".concat(e)}G(eB,"getErrorListKey");function eK(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=eB(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,eq.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(function(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,eq.getLogLink(n)];case 1:e=t.sent();e&&ep.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=s.sent();em(r);return[3,4];case 4:return[2]}})})()}G(eK,"saveErrorListToStorage");function eH(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eq.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 i(function(){var t;return x(this,function(n){switch(n.label){case 0:return[4,eq.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,em(n,{returnValue:[]})];case 4:return[2]}})})()}G(eH,"getStoredErrorLists");function eW(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eq.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 eq.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();em(n);return[3,4];case 4:return[2]}})})()}G(eW,"clearAllErrorLists");function ez(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 f=s.exec(e)||[],p=i.exec(e)||[],m=o.exec(e)||[];var E,g,v,h,y,S;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===ei.Error?ei.Error:ei.Warning,message:(E=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&E!==void 0?E:"",rule:(g=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(v=p===null||p===void 0?void 0:p[1])!==null&&v!==void 0?v:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===ei.Error?ei.Error:ei.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):m.length?t.push({file:"commitlint",type:ei.Error,message:(y=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&y!==void 0?y:"",rule:(S=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&eK(t),eV.DEBUG&&n.length&&(ep.warn("Unmatched lines:"),n.forEach(function(e){return ep.info(" ".concat(e))}))}G(ez,"parseTextErrors");function eQ(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?ei.Error:ei.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&eK(n)}catch(t){ez(e)}}G(eQ,"parseCommandOutput");function eJ(e){return i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return x(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eQ;n=new AbortController;er.on("SIGINT",function(){ep.warn("Process interrupted. Terminating..."),n.abort(),er.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,eY(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&&ep.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}G(eJ,"executeCommand");function e$(e){return{raw:!0,cmd:e}}G(e$,"rawCommand");function eX(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tx," ").concat(tD," ").concat(tm," ").concat(e):"".concat(tx," ").concat(tp," ").concat(e)}G(eX,"formatCLI");function eZ(e,t){return typeof e=="function"?eX(e(t),t):(typeof e==="undefined"?"undefined":D(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eX(e,t):e}G(eZ,"formatCommand");function e0(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,eP({name:te})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=I(e,2),r=t[0],s=t[1];return[r,eZ(s,n)]}))]}return[2]}})})()}G(e0,"resolveCommands");function e1(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);ep.start("".concat(e)),eV.DEBUG&&ep.info("→ ".concat(t));return[4,eJ(t)];case 1:r.sent(),ep.success("".concat(e," done."));return[3,3];case 2:n=r.sent();em(n);return[3,3];case 3:return[2]}})})()}G(e1,"runCommand");import e2 from"node:path";var e4=ee(),e3=e2;function e5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=e3).resolve.apply(r,[e4.CWD].concat(b(t)))}G(e5,"resolveWorkingPath");function e8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=e3).resolve.apply(r,b(t))}G(e8,"resolve");function e6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=e3).join.apply(r,b(t))}G(e6,"join");var e7=ee(),e9=e7.CWD,te="@cyberskill/shared",tt="node_modules",tn="dist",tr="package.json",ts="package-lock.json",ti="tsconfig.json",to=".gitignore",ta=".simple-git-hooks.json",tc="pnpm-lock.yaml",tu=".git/hooks/",tl=".git/COMMIT_EDITMSG",td=".migrate-mongo.config.js",tf=function(){var e=Y.readJsonSync(e5(tr)).name===te?e9:e6(e9,tt,te);return e6(e,tn)}(),tp="cyberskill",tm="src/node/cli/index.ts",tE="eslint",tg="eslint",tv="vitest",th="playwright",ty="vitest",tS="@commitlint/cli",tO="@commitlint/config-conventional",tC="commitlint",t_="lint-staged",tN="lint-staged",tI="typescript",tb="tsc",tD="tsx",tA="git",tT="pnpm",tx="pnpm exec",tw="simple-git-hooks",tR="simple-git-hooks",tG="@eslint/config-inspector",tP="eslint-config-inspector",tM="node-modules-inspector",tL="node-modules-inspector",tk="migrate-mongo",tj="./node_modules/migrate-mongo/bin/migrate-mongo",tU={CYBERSKILL_DIRECTORY:tf,WORKING_DIRECTORY:e9,TS_CONFIG:e5(ti),GIT_IGNORE:e5(to),GIT_HOOK:e5(tu),GIT_COMMIT_MSG:e5(tl),SIMPLE_GIT_HOOKS_JSON:e5(ta),PACKAGE_JSON:e5(tr),PACKAGE_LOCK_JSON:e5(ts),PNPM_LOCK_YAML:e5(tc),NODE_MODULES:e5(tt),MIGRATE_MONGO_CONFIG:e5(td),LINT_STAGED_CONFIG:e5("".concat(tf,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:e5("".concat(tf,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:e5("".concat(tf,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:e5("".concat(tf,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:e5("".concat(tf,"/react/vitest/vitest.e2e.js"))};function tF(e){var t=e.isCurrentProject;return h({"pre-commit":tN,"commit-msg":tC},t&&{"pre-push":e$("".concat(tA," pull"))})}G(tF,"createGitHooksConfig");function tq(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return x(this,function(n){switch(n.label){case 0:switch(t){case et.CLI:return[3,1];case et.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,ek(s,{update:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,eZ(e$("".concat(tx," ").concat(r))))];case 4:return[2,eZ(e$(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}G(tq,"buildCommand");var tV={simpleGitHooks:tq({type:et.CLI,packages:[{name:tw,type:eE.DEV_DEPENDENCY}],command:tR}),eslintInspect:tq({type:et.CLI,packages:[{name:tG,type:eE.DEV_DEPENDENCY}],command:tP}),nodeModulesInspect:tq({type:et.CLI,packages:[{name:tM,type:eE.DEV_DEPENDENCY}],command:tL}),eslintCheck:tq({type:et.CLI,packages:[{name:tE,type:eE.DEV_DEPENDENCY}],command:"".concat(tg," ").concat(tU.WORKING_DIRECTORY," --no-cache")}),eslintFix:tq({type:et.CLI,packages:[{name:tE,type:eE.DEV_DEPENDENCY}],command:"".concat(tg," ").concat(tU.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tq({type:et.CLI,packages:[{name:tI,type:eE.DEPENDENCY}],command:"".concat(tb," -p ").concat(tU.TS_CONFIG," --noEmit")}),testUnit:tq({type:et.CLI,packages:[{name:tv,type:eE.DEV_DEPENDENCY}],command:"".concat(ty," --config ").concat(tU.UNIT_TEST_CONFIG)}),testE2e:tq({type:et.CLI,packages:[{name:tv,type:eE.DEV_DEPENDENCY}],command:"".concat(ty," --config ").concat(tU.E2E_TEST_CONFIG)}),mongoMigrateCreate:G(function(e){return tq({type:et.CLI,packages:[{name:tk,type:eE.DEPENDENCY}],command:"".concat(tD," ").concat(tj," create ").concat(e," -f ").concat(tU.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tq({type:et.CLI,packages:[{name:tk,type:eE.DEPENDENCY}],command:"".concat(tD," ").concat(tj," up -f ").concat(tU.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tq({type:et.CLI,packages:[{name:tk,type:eE.DEPENDENCY}],command:"".concat(tD," ").concat(tj," down -f ").concat(tU.MIGRATE_MONGO_CONFIG)}),commitLint:tq({type:et.CLI,packages:[{name:tS,type:eE.DEV_DEPENDENCY},{name:tO,type:eE.DEV_DEPENDENCY}],command:"".concat(tC," --edit ").concat(tU.GIT_COMMIT_MSG," --config ").concat(tU.COMMITLINT_CONFIG)}),lintStaged:tq({type:et.CLI,packages:[{name:t_,type:eE.DEV_DEPENDENCY}],command:"".concat(tN," --config ").concat(tU.LINT_STAGED_CONFIG)}),configureGitHook:tq({type:et.STRING,command:"".concat(tA," config core.hooksPath ").concat(tU.GIT_HOOK)}),stageBuildDirectory:tq({type:et.STRING,command:"".concat(tA," add ").concat(tn)}),build:tq({type:et.STRING,command:"".concat(tT," run --if-present build")}),pnpmInstallStandard:tq({type:et.STRING,command:"".concat(tT," install --no-frozen-lockfile")}),pnpmInstallLegacy:tq({type:et.STRING,command:"".concat(tT," install --no-frozen-lockfile --legacy-peer-deps")}),pnpmInstallForce:tq({type:et.STRING,command:"".concat(tT," install --no-frozen-lockfile --force")})};function tY(e){return V(h({plugins:[q()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tU.UNIT_TEST_SETUP_CONFIG]}},e))}G(tY,"vitestUnit");function tB(e){try{return JSON.parse(e),!0}catch(e){return!1}}G(tB,"isJson");function tK(e){return(typeof e==="undefined"?"undefined":D(e))=="object"&&e!==null&&!Array.isArray(e)}G(tK,"isObject");function tH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r={};var s=true,i=false,o=undefined,a=true,c=false,u=undefined;try{for(var l=t.flat()[Symbol.iterator](),d;!(a=(d=l.next()).done);a=true){var f=d.value;try{for(var p=Object.entries(f)[Symbol.iterator](),m;!(s=(m=p.next()).done);s=true){var E=I(m.value,2),g=E[0],v=E[1];var h=r[g];if(Array.isArray(v)){var y=Array.isArray(h)?h:[];r[g]=b(new Set(b(y).concat(b(v))));continue}if(tK(v)){r[g]=tH(tK(h)?h:{},v);continue}r[g]=v}}catch(e){i=true;o=e}finally{try{if(!s&&p.return!=null){p.return()}}finally{if(i){throw o}}}}}catch(e){c=true;u=e}finally{try{if(!a&&l.return!=null){l.return()}}finally{if(c){throw u}}}return r}G(tH,"deepMerge");import*as tW from"globals";var tz=[{languageOptions:{globals:h({},tW.node,tW.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}],"dot-notation":"off"},ignores:["build","dist"]}];var tQ;var tJ=G(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r=tH.apply(void 0,[tz].concat(b(t.map(function(e){return e})))),s=r.ignores,i=O(r,["ignores"]),o=Array.isArray(s)&&s.every(function(e){return typeof e=="string"})?{ignores:s}:void 0,a=[i].concat(b(o?[o]:[]));return k.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(b(a)))},"handleESLint"),t$=(tQ={},l(tQ,L.ESLINT,function(e){return tJ(e)}),l(tQ,L.COMMITLINT,function(e){return tH(e)}),l(tQ,L.LINT_STAGED,function(e){return tH(e)}),l(tQ,L.VITEST_REACT_UNIT,function(e){return tY(e)}),l(tQ,L.VITEST_REACT_E2E,function(e){return F(e)}),tQ);function tX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var s=t$[e];if(!n||n.length===0)return s({});if(!s)throw new Error("Unknown config type: ".concat(e));return s.apply(void 0,b(n))}G(tX,"mergeConfigs");import{defineConfig as tZ}from"@eddeee888/gcg-typescript-resolver-files";Z();function t0(e){var t=e.uri,n=e.from,r=e.to,s=e.target,i=s===void 0?"client":s;var o=i==="client",a=i==="server";return S(h({schema:t,ignoreNoDocuments:!0,overwrite:!0},o&&{documents:[n]}),{generates:h({},o&&l({},r,{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0}}),a&&l({},r,tZ()))})}G(t0,"createGraphqlCodegenConfig");var t1={"*":["eslint --fix"]};var t2=(typeof window==="undefined"?"undefined":D(window))<"u";import{ApolloServer as t4}from"@apollo/server";import{expressMiddleware as t3}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as t5}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as t8,ApolloServerPluginLandingPageProductionDefault as t6}from"@apollo/server/plugin/landingPage/default";function t7(e){return new t4(h({schema:e.schema,plugins:[e.isDev?t8():t6(),t5({httpServer:e.server})].concat(b(e.drainServer?[{serverWillStart:function t(){return i(function(){return x(this,function(t){return[2,{drainServer:function t(){return i(function(){var t;return x(this,function(n){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),ep.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}G(t7,"createApolloServer");import t9 from"node:process";import{hideBin as ne}from"yargs/helpers";import nt from"yargs/yargs";var nn={name:"@cyberskill/shared",type:"module",version:"1.137.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/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/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"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/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/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",reset:"tsx src/node/cli/index.ts reset",prepare:"tsx src/node/cli/index.ts prepare",inspect:"tsx src/node/cli/index.ts inspect","test:unit":"tsx src/node/cli/index.ts test:unit","test:e2e":"tsx src/node/cli/index.ts test:e2e",commitlint:"tsx src/node/cli/index.ts commitlint"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.42.2","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.7","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@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","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.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-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",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.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.4",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","@commitlint/config-conventional":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.3","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.26.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};function nr(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:if(!eT(tU.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tV.typescriptCheck()];case 1:return[4,e1.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=ep.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}G(nr,"checkTypescript");function ns(){return i(function(){var e,t,n,r;var s=arguments;return x(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,tV.eslintFix()];case 1:return[4,e1.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tV.eslintCheck()];case 4:return[4,e1.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}G(ns,"checkEslint");function ni(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";ep.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}G(ni,"printIssues");function no(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:return[4,eH()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===ei.Error}),n=e.filter(function(e){return e.type===ei.Warning});!t.length&&!n.length?ep.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ni("Warnings",n),ni("Errors",t),(t.length>0||n.length>0)&&t9.exit(1));return[2]}})})()}G(no,"showCheckResult");function na(){return i(function(){var e,t,n,r,s;return x(this,function(i){switch(i.label){case 0:return[4,eW()];case 1:i.sent();return[4,eP({name:te})];case 2:e=i.sent();if(!e.success){ep.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,7];n=["Building package: ".concat(te)];return[4,tV.build()];case 3:return[4,e1.apply(void 0,n.concat([i.sent()]))];case 4:i.sent();r=["Staging build artifacts"];return[4,tV.stageBuildDirectory()];case 5:return[4,e1.apply(void 0,r.concat([i.sent()]))];case 6:t=i.sent();i.label=7;case 7:t;s=["Executing lint-staged"];return[4,tV.lintStaged()];case 8:return[4,e1.apply(void 0,s.concat([i.sent()]))];case 9:i.sent(),no();return[2]}})})()}G(na,"lintStaged");function nc(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tV.eslintInspect()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nc,"inspectLint");function nu(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,eW()];case 1:e.sent();return[4,Promise.all([nr(),ns()])];case 2:e.sent(),no();return[2]}})})()}G(nu,"lintCheck");function nl(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,eW()];case 1:e.sent();return[4,Promise.all([nr(),ns(!0)])];case 2:e.sent(),no();return[2]}})})()}G(nl,"lintFix");function nd(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,eW()];case 1:t.sent();e=["Validating commit message"];return[4,tV.commitLint()];case 2:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),no();return[2]}})})()}G(nd,"commitLint");function nf(){return i(function(){var e,t,n,r;return x(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tV.configureGitHook()];case 1:return[4,e1.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ex(tU.GIT_HOOK);return[4,e0(tF)];case 3:t=s.sent();eD(tU.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ta,"\n");eT(tU.GIT_IGNORE)?e_(tU.GIT_IGNORE,"utf-8").split("\n").includes(ta)||eA(tU.GIT_IGNORE,n):eD(tU.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tV.simpleGitHooks()];case 4:return[4,e1.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}G(nf,"setupGitHook");function np(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,ek([{name:te,type:eE.DEPENDENCY}],{update:!0,postInstallActions:[nf]})];case 1:e.sent();return[2]}})})()}G(np,"prepare");function nm(){return i(function(){return x(this,function(e){switch(e.label){case 0:ex(tU.NODE_MODULES,tU.PNPM_LOCK_YAML);return[4,eL()];case 1:e.sent();return[4,nf()];case 2:e.sent();return[2]}})})()}G(nm,"reset");function nE(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tV.nodeModulesInspect()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nE,"inspect");function ng(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tV.testUnit()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(ng,"testUnit");function nv(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tV.testE2e()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nv,"testE2E");function nh(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tV.mongoMigrateCreate(e)];case 1:return[4,e1.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}G(nh,"mongoMigrateCreate");function ny(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tV.mongoMigrateUp()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(ny,"mongoMigrateUp");function nS(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tV.mongoMigrateDown()];case 1:return[4,e1.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}G(nS,"mongoMigrateDown");(function(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,nt(ne(t9.argv)).scriptName(tp).usage("$0 <command> [options]").command("lint","Check code for linting issues",nu).command("lint:fix","Fix linting issues automatically",nl).command("lint:inspect","View active ESLint configuration",nc).command("lint-staged","Run lint checks on staged files",na).command("commitlint","Validate commit message format",nd).command("prepare","Initialize project and dependencies",np).command("reset","Reset the project and reinstall dependencies",nm).command("inspect","Analyze installed project dependencies",nE).command("test:unit","Run unit test suite",ng).command("test:e2e","Run end-to-end test suite",nv).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return x(this,function(t){switch(t.label){case 0:if(!e.name){ep.error("Migration name is required.");return[2]}return[4,nh(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",ny).command("mongo:migrate:down","Rollback last MongoDB migration",nS).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(nn.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();em(e),t9.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as nO}from"express";import{NestFactory as nC}from"@nestjs/core";import n_ from"body-parser";import nN from"compression";import nI from"cookie-parser";import nb from"cors";import nD from"express";import nA from"express-session";import nT from"express-useragent";function nx(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return h({origin:G(function(e,r){t||(n===null||n===void 0?void 0:n.includes(e!==null&&e!==void 0?e:""))?r(null,!0):r(new Error("Not allowed by CORS"),!1)},"origin"),credentials:!0},r)}G(nx,"createCorsOptions");function nw(e){return nb(nx(e))}G(nw,"createCors");function nR(e){return nA(e)}G(nR,"createSession");function nG(e){var t=nD();return t.set("trust proxy",1),t.use(nI()),t.use(nD.urlencoded({extended:!0})),t.use(nN()),t.use(nT.express()),(e===null||e===void 0?void 0:e.staticFolder)&&t.use(nD.static(e.staticFolder)),t}G(nG,"createExpress");function nP(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,nC.create(e.module)];case 1:r=s.sent();return[2,(r.getHttpAdapter().getInstance().set("trust proxy",1),r.use(nD.urlencoded({extended:!0})),r.use(nI()),r.use(nN()),r.use(nT.express()),e.staticFolder&&r.use(nD.static(e.staticFolder)),e.filters&&(t=r).useGlobalFilters.apply(t,b(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,b(e.pipes)),r)]}})})()}G(nP,"createNest");var nM="MONGO_MIGRATE_OPTIONS";import{Collection as nL,Db as nk}from"mongodb";import{Document as nj,Model as nU}from"mongoose";var nF=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nk);G(nF,"C_Db");var nq=nF,nV=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nj);G(nV,"C_Document");var nY=nV,nB=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nU);G(nB,"C_Model");var nK=nB,nH=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nL);G(nH,"C_Collection");var nW=nH;import{format as nz}from"date-fns";import nQ from"migrate-mongo";import{Document as nJ}from"mongoose";import n$ from"mongoose-aggregate-paginate-v2";import nX from"mongoose-paginate-v2";import{v4 as nZ}from"uuid";import n0 from"unorm";var n1={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},n2=Object.entries(n1).reduce(function(e,t){var n=I(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function n4(e){e=n0.nfkc(e);var t=h({},n1,n2);var n=true,r=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),o;!(n=(o=i.next()).done);n=true){var a=I(o.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return e}G(n4,"regexSearchMapper");function n3(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}G(n3,"removeAccent");var n5={Date:{is:G(function(e){return p(e,Date)},"is"),serialize:G(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:G(function(e){return new Date(e)},"deserialize")},Map:{is:G(function(e){return p(e,Map)},"is"),serialize:G(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:G(function(e){return new Map(e)},"deserialize")},Set:{is:G(function(e){return p(e,Set)},"is"),serialize:G(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:G(function(e){return new Set(e)},"deserialize")},RegExp:{is:G(function(e){return p(e,RegExp)},"is"),serialize:G(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:G(function(e){var t=e.source,n=e.flags;return new RegExp(t,n)},"deserialize")},BigInt:{is:G(function(e){return(typeof e==="undefined"?"undefined":D(e))=="bigint"},"is"),serialize:G(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:G(function(e){return BigInt(e)},"deserialize")}},n8={serialize:function e(e){return JSON.stringify(e,function(e,t){var n=true,r=false,s=undefined;try{for(var i=Object.keys(n5)[Symbol.iterator](),o;!(n=(o=i.next()).done);n=true){var a=o.value;var c=n5[a];if(c.is(t))return c.serialize(t)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return t})},deserialize:function e(e){return JSON.parse(e,function(e,t){if(t&&(typeof t==="undefined"?"undefined":D(t))=="object"&&"__type"in t&&typeof t.__type=="string"){var n=t.__type,r=n5[n];if(r)return r.deserialize(t.value)}return t})}};import n6 from"crypto-js";import n7 from"slugify";var n9=n7.default||n7;function re(e,t){var n=G(function(e){var n,r;return n9(e!==null&&e!==void 0?e:"",h({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(tK(e)){var r={};var s=true,i=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),c;!(s=(c=a.next()).done);s=true){var u=I(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;o=e}finally{try{if(!s&&a.return!=null){a.return()}}finally{if(i){throw o}}}return r}return n(e)}G(re,"generateSlug");function rt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return n6.SHA256(e).toString(n6.enc.Hex).slice(0,t)}G(rt,"generateShortId");function rn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:8;var t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?",n="";for(var r=0;r<e;r++){var s=Math.floor(Math.random()*t.length);n+=t.charAt(s)}return n}G(rn,"generateRandomPassword");function rr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;var n=e.split(/[?#]/)[0]||"",r=n.substring(n.lastIndexOf("/")+1);if(t)return r;var s=r.lastIndexOf(".");return s>0?r.slice(0,s):r}G(rr,"getFileName");function rs(e,t,n){var r=e.indexOf(t);if(r===-1)return"";var s=r+t.length,i=e.indexOf(n,s);return i===-1?"":e.slice(s,i)}G(rs,"substringBetween");var ri={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":D(e))=="object"?p(e,Date)?!1:p(e,Map)||p(e,Set)?e.size===0:p(e,WeakMap)||p(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var ro={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return nz(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,n=t===void 0?"string":t;var r=n==="string"?ro.getDateTime():new Date;return{id:nZ(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:nZ,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n,{strict:!0});return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(ro.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var f=ro.createSchema({mongoose:t,schema:r,virtuals:u});return ro.applyPlugins(f,[i&&nX,a&&n$]),ro.applyMiddlewares(f,d),t.model(n,f)},validator:{isEmpty:function e(){return function(e){return i(function(){return x(this,function(t){return[2,!ri.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return i(function(){return x(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!p(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:S(h({},nQ),{setConfig:G(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eD(tU.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(td,"\n");eT(tU.GIT_IGNORE)?e_(tU.GIT_IGNORE,"utf-8").split("\n").includes(td)||eA(tU.GIT_IGNORE,n):eD(tU.GIT_IGNORE,n)},"setConfig")})},ra=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);P(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=h({},ro.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,this.collection.insertOne(t)];case 1:return[2,(n.result=s.sent(),n)];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=e.map(function(e){return h({},ro.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=s.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:eu.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,em(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,em(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,em(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:eu.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}}]);return e}();G(ra,"MongoController");var rc=ra,ru=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);P(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.findOne(e,t,n);r&&s.populate(r);return[4,s.exec()];case 2:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:eu.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,em(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.find(e,t,n);r&&s.populate(r);i={success:!0};return[4,s.exec()];case 2:return[2,(i.result=c.sent(),i)];case 3:o=c.sent();return[2,em(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,em(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=i.sent().map(function(e){return p(e,nJ)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,h({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:eu.NOT_FOUND.CODE}];case 3:s=o.sent();return[2,em(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:s=o.sent();return[2,em(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=i.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:eu.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=i.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:eu.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,em(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return i(function(){var n,r,s,i,o;return x(this,function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);n=new Set;r=0;a.label=1;case 1:if(!(r<10))return[3,5];s=rt(e,r+t);i=!n.has(s);if(!i)return[3,3];n.add(s);return[4,this.model.exists({shortId:s})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:s}];a.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:eu.INTERNAL_SERVER_ERROR.CODE}];case 6:o=a.sent();return[2,em(o)];case 7:return[2]}})}).call(this)}},{key:"createSlug",value:function e(e,t,n){return i(function(){var r,s,o,a,c,u,d,f,p,m;return x(this,function(E){switch(E.label){case 0:r=this;E.label=1;case 1:E.trys.push([1,5,,6]);s=t[e],o=tK(s),a=G(function(t){var r=h({},n!==null&&n!==void 0?n:{});return o?S(h({},r),{$or:[l({},"slug.".concat(e),t),{slugHistory:{$elemMatch:l({},"slug.".concat(e),t)}}]}):S(h({},r),{$or:[{slug:t},{slugHistory:t}]})},"generateSlugQuery"),c=G(function(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:t=e,n=1;r.label=1;case 1:return[4,this.model.exists(a(t))];case 2:if(!r.sent())return[3,4];t="".concat(e,"-").concat(n++);r.label=3;case 3:return[3,1];case 4:return[2,t]}})}).call(r)},"generateUniqueSlug");if(!o)return[3,3];u={success:!0};d=Object.fromEntries;return[4,Promise.all(Object.entries(s).map(function(e){var t=I(e,2),n=t[0],r=t[1];return i(function(){var e,t;return x(this,function(s){switch(s.label){case 0:e=re(r);t=[n];return[4,c(e)];case 1:return[2,t.concat([s.sent()])]}})})()}))];case 2:return[2,(u.result=d.apply(Object,[E.sent()]),u)];case 3:f=re(s);p={success:!0};return[4,c(f)];case 4:return[2,(p.result=E.sent(),p)];case 5:m=E.sent();return[2,em(m)];case 6:return[2]}})}).call(this)}},{key:"aggregate",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,em(n)];case 3:return[2]}})}).call(this)}}]);return e}();G(ru,"MongooseController");var rl=ru;import{useServer as rd}from"graphql-ws/use/ws";import{WebSocketServer as rf}from"ws";function rp(e){return new rf({server:e.server,path:e.path})}G(rp,"createWSServer");function rm(e){return rd({schema:e.schema},e.server)}G(rm,"initGraphQLWS");import{ApolloClient as rE,ApolloError as rg,ApolloLink as rv,ApolloProvider as rh,from as ry,HttpLink as rS,InMemoryCache as rO,split as rC}from"@apollo/client";import{onError as r_}from"@apollo/client/link/error";import{removeTypenameFromVariables as rN}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as rI}from"@apollo/client/link/subscriptions";import{getMainDefinition as rb}from"@apollo/client/utilities";import{createClient as rD}from"graphql-ws";import rA,{useMemo as rT}from"react";import{FaInfo as rx}from"react-icons/fa6";import rw,{use as rR}from"react";import{FaRepeat as rG}from"react-icons/fa6";import{createContext as rP}from"react";var rM=rP(void 0);import rL from"./react/apollo-error/apollo-error.module.scss";function rk(){var e=rR(rM),t=e===null||e===void 0?void 0:e.error;if(!t)return null;var n=G(function(e,t){return(t===null||t===void 0?void 0:t.length)?rw.createElement("div",null,rw.createElement("strong",null,e,":"),rw.createElement("ul",null,t.map(function(e){return rw.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return rw.createElement("div",{className:rL["modal-backdrop"]},rw.createElement("div",{className:rL["modal-content"]},rw.createElement("button",{type:"button",className:rL["btn-close"],onClick:e.hideError},"✕"),rw.createElement("div",{className:rL["error-title"]},rw.createElement("button",{type:"button",className:rL["btn-retry"],onClick:G(function(){return window.location.reload()},"onClick")},rw.createElement(rG,null))," ",t.message),rw.createElement("div",{className:rL["error-details"]},t.networkError&&rw.createElement("pre",{className:"network"},rw.createElement("strong",null,"Network Error:")," ",t.networkError.message),n("GraphQL Errors",b(t.graphQLErrors)),n("Protocol Errors",b(t.protocolErrors)),n("Client Errors",b(t.clientErrors)),t.extraInfo&&rw.createElement("pre",{className:"extra"},rw.createElement("strong",null,"Extra Info:")," ",JSON.stringify(t.extraInfo,null,4)))))}G(rk,"ApolloError");import{use as rj}from"react";function rU(){var e=rj(rM);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}G(rU,"useApolloError");import rF,{useEffect as rq,useMemo as rV,useState as rY}from"react";var rB=null;function rK(e){rB=e}G(rK,"setGlobalApolloErrorCallback");function rH(e){rB===null||rB===void 0?void 0:rB(e)}G(rH,"showGlobalApolloError");function rW(e){var t=e.children;var n=I(rY(null),2),r=n[0],s=n[1];rq(function(){rK(s)},[]);var i=rV(function(){return{error:r,showError:s,hideError:G(function(){return s(null)},"hideError")}},[r]);return rF.createElement(rM,{value:i},t)}G(rW,"ApolloErrorProvider");import{consola as rz}from"consola/browser";var rQ={silent:rz.silent,level:rz.level,fatal:rz.fatal,error:rz.error,warn:rz.warn,log:rz.log,info:rz.info,success:rz.success,ready:rz.ready,start:rz.start,box:rz.box,debug:rz.debug,trace:rz.trace,verbose:rz.verbose};function rJ(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=p(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&rQ.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:eu.INTERNAL_SERVER_ERROR.CODE}}G(rJ,"catchError");import{toast as r$,Toaster as rX}from"react-hot-toast";var rZ="/graphql";var r0,r1=(r0=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);var e;e=o(this,t,arguments);P(e,"count",0);return e}u(t,[{key:"request",value:function e(e,t){var n=this;var r=Date.now();return this.count+=1,t(e).map(function(t){var s=Date.now()-r,i=e.operationName||"Unnamed";return rQ.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(s,"ms)")),t})}}]);return t}(rv),G(r0,"DevLoggerLink"),r0);function r2(e){var t=e.uri,n=e.wsUrl,r=e.customLinks,s=new r1,i=r_(function(e){var t=e.graphQLErrors,n=e.networkError,r=e.protocolErrors,s=e.operation;var i=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(t&&t.forEach(function(e){var t=e.message,n=e.locations,r=e.path;rQ.error("[GraphQL error] ".concat(i,": ").concat(t,", Location: ").concat(JSON.stringify(n,null,4),", Path: ").concat(r))}),r&&r.forEach(function(e){var t=e.message,n=e.extensions;rQ.error("[Protocol error]: ".concat(t,", Extensions: ").concat(JSON.stringify(n,null,4)))}),n&&rQ.error("[Network error]: ".concat(n)),t||r||n){var o,a;var c=(t===null||t===void 0?void 0:(o=t[0])===null||o===void 0?void 0:o.message)||(r===null||r===void 0?void 0:(a=r[0])===null||a===void 0?void 0:a.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",u=new rg({graphQLErrors:t||[],protocolErrors:r||[],clientErrors:[],networkError:n||null,errorMessage:c,extraInfo:{operation:s}});r$.error(function(e){return rA.createElement(rA.Fragment,null,c,"\xa0",rA.createElement(rx,{cursor:"pointer",onClick:G(function(){setTimeout(function(){rH(u)},0),r$.dismiss(e.id)},"onClick")}))})}}),o=rN();t||rQ.warn('[Apollo] No GraphQL URI provided — using "'.concat(rZ,'" as default'));var a=new rS({uri:t!==null&&t!==void 0?t:rZ,credentials:"include"}),c=n?new rI(rD({url:n})):rv.empty(),u=p(c,rv)?rC(function(e){var t=e.query;var n=rb(t);return n.kind==="OperationDefinition"&&n.operation==="subscription"},c,a):a;return u===a&&n&&rQ.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[s,i,o].concat(b(r!==null&&r!==void 0?r:[]),[u])}G(r2,"createApolloLinks");function r4(e){var t=e.isNextJS,n=e.options,r=e.children,s=e.client,i=e.provider,o=e.cache;var a=n||{},c=a.uri,u=a.wsUrl,l=a.customLinks,d=O(a,["uri","wsUrl","customLinks"]),f=s!==null&&s!==void 0?s:rE;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var m=i||rh,E=rT(function(){return ry(r2({uri:c!==null&&c!==void 0?c:rZ,wsUrl:u!==null&&u!==void 0?u:"",customLinks:l!==null&&l!==void 0?l:[]}))},[c,u,l]),g=rT(function(){return p(o,rO)?o:new rO},[o]),v=rT(function(){return new f(h({link:E,cache:g},d))},[f,E,g,d]),y=t?rA.createElement(m,{makeClient:G(function(){return v},"makeClient")},r):rA.createElement(m,{client:v},r);return rA.createElement(rA.Fragment,null,rA.createElement(rW,null,y,rA.createElement(rk,null)),rA.createElement(rX,{position:"top-right"}))}G(r4,"ApolloProvider");import{useTranslation as r3}from"react-i18next";var r5=r3;import r8 from"i18next";import{initReactI18next as r6}from"react-i18next";function r7(e){return r8.use(r6).init(e)}G(r7,"initI18next");import r9 from"classnames";import se from"react";import st from"./react/loading/loading.module.scss";function sn(e){var t=e.full,n=t===void 0?!1:t,r=e.block,s=r===void 0?!1:r,i=e.className,o=i===void 0?"":i,a=e.message,c=a===void 0?"Loading":a,u=O(e,["full","block","className","message"]);function l(){return se.createElement("div",h({className:st.container},u),se.createElement("div",{className:st.ring}),se.createElement("div",{className:st.ring}),se.createElement("div",{className:st.ring}),se.createElement("div",{className:st.ring}),c&&se.createElement("div",{className:st.message},c))}return G(l,"_renderLoading"),n?se.createElement("div",{className:r9(st.fullscreen,o)},l()):s?se.createElement("div",{className:r9(st.block,o)},l()):l()}G(sn,"Loading");import{createContext as sr}from"react";var ss=sr(void 0);import{use as si}from"react";function so(){var e=si(ss);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}G(so,"useLoading");import sa,{useCallback as sc,useMemo as su,useState as sl}from"react";function sd(e){var t=e.children;var n=I(sl(!1),2),r=n[0],s=n[1],i=I(sl(!1),2),o=i[0],a=i[1],c=sc(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),a(e)},[]),u=sc(function(){s(!1),a(!1)},[]),l=su(function(){return{isLoading:r,isGlobalLoading:o,showLoading:c,hideLoading:u}},[r,o,c,u]);return sa.createElement(ss,{value:l},r?sa.createElement(sn,{full:o}):t)}G(sd,"LoadingProvider");import{enUS as sf}from"date-fns/locale";var sp={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:sf,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};import{createContext as sm}from"react";var sE=sm(void 0);import{NextIntlClientProvider as sg}from"next-intl";import sv from"react";import{useTranslations as sh}from"next-intl";import{use as sy}from"react";function sS(){var e=sy(sE);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}G(sS,"useNextIntl");var sO=sh;function sC(e){var t=G(function(t){var n;var r;var s=sS(),i=s.currentLanguage,o=t.messages,a=t.languages,c="en",u=o[(i===null||i===void 0?void 0:i.value)||c],l=(r=(n=a.find(function(e){return e.value===(i===null||i===void 0?void 0:i.value)}))===null||n===void 0?void 0:n.timezone)!==null&&r!==void 0?r:sp.timezone;return o?sv.createElement(sg,{locale:(i===null||i===void 0?void 0:i.value)||c,messages:u||null,timeZone:l},sv.createElement(e,t)):(rQ.warn("Missing messages for language: ".concat((i===null||i===void 0?void 0:i.value)||c)),null)},"PageWithI18n");return t.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),t}G(sC,"withNextIntl");import s_,{useMemo as sN}from"react";import{useCallback as sI,useEffect as sb,useState as sD}from"react";import sA from"localforage";var sT={get:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sA.getItem(e)];case 1:return[2,n.sent()];case 2:t=n.sent();return[2,rJ(t,{returnValue:null})];case 3:return[2]}})})()},set:function e(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sA.setItem(e,t)];case 1:r.sent();return[3,3];case 2:n=r.sent();rJ(n);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sA.removeItem(e)];case 1:n.sent();return[3,3];case 2:t=n.sent();rJ(t);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sA.keys()];case 1:return[2,(e=n.sent())!==null&&e!==void 0?e:[]];case 2:t=n.sent();return[2,rJ(t,{returnValue:[]})];case 3:return[2]}})})()}};function sx(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n8;var r=I(sD(t),2),s=r[0],o=r[1],a=I(sD(!1),2),c=a[0],u=a[1];sb(function(){var r=!0;return G(function(){return i(function(){var s,i,a,c;return x(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,sT.get(e)];case 1:s=l.sent();if(!r)return[3,5];if(!(s!==null))return[3,2];i=n.deserialize(s);o(i);return[3,5];case 2:if(!(t!==void 0))return[3,4];a=n.serialize(t);return[4,sT.set(e,a)];case 3:l.sent(),o(t);return[3,5];case 4:o(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();rJ(c),r&&o(t);return[3,8];case 7:r&&u(!0);return[7];case 8:return[2]}})})()},"loadValue")(),function(){r=!1,u(!1)}},[e,t,n]),sb(function(){if(!c)return;G(function(){return i(function(){var t,r;return x(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];t=n.serialize(s);return[4,sT.set(e,t)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:r=i.sent();rJ(r);return[3,4];case 4:return[2]}})})()},"saveValue")()},[s,e,n,c]);var l=sI(function(e){o(function(t){return typeof e=="function"?e(t):e})},[]),d=sI(function(){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sT.remove(e)];case 1:n.sent(),o(void 0);return[3,3];case 2:t=n.sent();rJ(t);return[3,3];case 3:return[2]}})})()},[e]);return{value:s,set:l,remove:d}}G(sx,"useStorage");function sw(e){var t=e.children;return s_.createElement(s_.Fragment,null,t)}G(sw,"LanguageWrapperBase");var sR=sC(sw);function sG(e){var t=e.children,n=e.languages,r=e.messages;var s=sx("lang",n[0]),i=s.value,o=s.set,a=sN(function(){return{languages:n,currentLanguage:i!==null&&i!==void 0?i:sp,setCurrentLanguage:o}},[n,o,i]);return s_.createElement(sE,{value:a},s_.createElement(sR,{languages:n,messages:r},t))}G(sG,"NextIntlProvider");export{rk as ApolloError,rM as ApolloErrorContext,rW as ApolloErrorProvider,r4 as ApolloProvider,tn as BUILD_DIRECTORY,tC as COMMIT_LINT_CLI,tO as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,tS as COMMIT_LINT_PACKAGE_NAME,tp as CYBERSKILL_CLI,tm as CYBERSKILL_CLI_PATH,tf as CYBERSKILL_DIRECTORY,te as CYBERSKILL_PACKAGE_NAME,B as CYBERSKILL_STORAGE_DIRECTORY,nW as C_Collection,nq as C_Db,nY as C_Document,nK as C_Model,tg as ESLINT_CLI,tP as ESLINT_INSPECT_CLI,tG as ESLINT_INSPECT_PACKAGE_NAME,tE as ESLINT_PACKAGE_NAME,et as E_CommandType,L as E_ConfigType,ei as E_IssueType,eE as E_PackageType,tA as GIT_CLI,tl as GIT_COMMIT_EDITMSG,tu as GIT_HOOK,to as GIT_IGNORE,rZ as GRAPHQL_URI_DEFAULT,t2 as IS_BROWSER,tN as LINT_STAGED_CLI,t_ as LINT_STAGED_PACKAGE_NAME,sn as Loading,ss as LoadingContext,sd as LoadingProvider,tj as MIGRATE_MONGO_CLI,td as MIGRATE_MONGO_CONFIG,tk as MIGRATE_MONGO_PACKAGE_NAME,nM as MONGO_MIGRATE_OPTIONS,rc as MongoController,rl as MongooseController,sp as NEXT_INTL_DEFAULT_LANGUAGE,tt as NODE_MODULES,tL as NODE_MODULES_INSPECT_CLI,tM as NODE_MODULES_INSPECT_PACKAGE_NAME,sE as NextIntlContext,sG as NextIntlProvider,tr as PACKAGE_JSON,ts as PACKAGE_LOCK_JSON,tU as PATH,th as PLAYWRIGHT_PACKAGE_NAME,tT as PNPM_CLI,tx as PNPM_EXEC_CLI,tc as PNPM_LOCK_YAML,eu as RESPONSE_STATUS,nO as Router,tw as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tR as SIMPLE_GIT_HOOK_CLI,ta as SIMPLE_GIT_HOOK_JSON,ti as TSCONFIG_JSON,tb as TSC_CLI,tI as TSC_PACKAGE_NAME,tD as TSX_CLI,rX as Toaster,ty as VITEST_CLI,tv as VITEST_PACKAGE_NAME,e9 as WORKING_DIRECTORY,n$ as aggregatePaginate,eA as appendFileSync,n_ as bodyParser,rJ as catchError,em as catchErrorNode,eW as clearAllErrorLists,tV as command,M as commitlintConfig,ew as copySync,t7 as createApolloServer,nw as createCors,nx as createCorsOptions,nG as createExpress,tF as createGitHooksConfig,t0 as createGraphqlCodegenConfig,nP as createNest,nR as createSession,rp as createWSServer,tH as deepMerge,tz as eslintConfig,nD as express,t3 as expressMiddleware,eZ as formatCommand,ey as fs,rn as generateRandomPassword,rt as generateShortId,re as generateSlug,ee as getEnv,rr as getFileName,eG as getLatestPackageVersion,eP as getPackage,eH as getStoredErrorLists,rm as initGraphQLWS,r7 as initI18next,eL as installDependencies,tB as isJson,tK as isObject,e6 as join,t1 as lintStagedConfig,Z as loadEnvFile,rQ as log,ep as logNode,eS as lstatSync,tX as mergeConfigs,eC as mkdirSync,ro as mongo,nX as mongoosePaginate,e3 as path,eT as pathExistsSync,e$ as rawCommand,e_ as readFileSync,eb as readJsonSync,eO as readdirSync,n4 as regexSearchMapper,n3 as removeAccent,ex as removeSync,e8 as resolve,e0 as resolveCommands,e5 as resolveWorkingPath,e1 as runCommand,n8 as serializer,rK as setGlobalApolloErrorCallback,ek as setupPackages,rH as showGlobalApolloError,eI as statSync,sT as storage,eq as storageNode,rs as substringBetween,ed as throwError,r$ as toast,eN as unlinkSync,eM as updatePackage,rU as useApolloError,so as useLoading,sS as useNextIntl,sx as useStorage,r5 as useTranslateI18next,sO as useTranslateNextIntl,ri as validate,F as vitestE2E,tY as vitestUnit,sC as withNextIntl,eD as writeFileSync};
|