@cyberskill/shared 1.102.0 → 1.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +50 -51
- package/dist/_tsup-dts-rollup.d.ts +50 -51
- package/dist/configs/config.util.cjs +1 -1
- package/dist/configs/config.util.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/nodejs/cli/cli.util.cjs +1 -1
- package/dist/nodejs/cli/cli.util.js +1 -1
- package/dist/nodejs/cli/index.cjs +1 -1
- package/dist/nodejs/cli/index.js +1 -1
- package/dist/nodejs/command/command.util.cjs +1 -1
- package/dist/nodejs/command/command.util.js +1 -1
- package/dist/nodejs/command/index.cjs +1 -1
- package/dist/nodejs/command/index.js +1 -1
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +2 -2
- package/dist/nodejs/index.d.ts +2 -2
- package/dist/nodejs/index.js +1 -1
- package/dist/nodejs/mongo/index.cjs +1 -1
- package/dist/nodejs/mongo/index.d.cts +0 -1
- package/dist/nodejs/mongo/index.d.ts +0 -1
- package/dist/nodejs/mongo/index.js +1 -1
- package/dist/nodejs/mongo/mongo.type.d.cts +0 -1
- package/dist/nodejs/mongo/mongo.type.d.ts +0 -1
- package/dist/nodejs/mongo/mongo.util.cjs +1 -1
- package/dist/nodejs/mongo/mongo.util.js +1 -1
- package/dist/nodejs/package/index.cjs +1 -1
- package/dist/nodejs/package/index.js +1 -1
- package/dist/nodejs/package/package.util.cjs +1 -1
- package/dist/nodejs/package/package.util.js +1 -1
- package/dist/nodejs/path/index.cjs +1 -1
- package/dist/nodejs/path/index.d.cts +2 -1
- package/dist/nodejs/path/index.d.ts +2 -1
- package/dist/nodejs/path/index.js +1 -1
- package/dist/nodejs/path/path.constant.cjs +1 -1
- package/dist/nodejs/path/path.constant.d.cts +2 -1
- package/dist/nodejs/path/path.constant.d.ts +2 -1
- package/dist/nodejs/path/path.constant.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/vitest/index.cjs +1 -1
- package/dist/react/vitest/index.js +1 -1
- package/dist/react/vitest/vitest.unit.cjs +1 -1
- package/dist/react/vitest/vitest.unit.js +1 -1
- package/package.json +7 -8
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,r,n,s,o,i){try{var a=e[o](i);var c=a.value}catch(e){r(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(n,s)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,c,"next",e)}function c(e){s(i,n,o,a,c,"throw",e)}a(undefined)})}}function i(e,t,r){t=d(t);return C(e,w()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function u(e,t,r){if(t)c(e.prototype,t);if(r)c(e,r);return e}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}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)I(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 g(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var s=true;var o=false;var i,a;try{for(r=r.call(e);!(s=(i=r.next()).done);s=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;a=e}finally{try{if(!s&&r["return"]!=null)r["return"]()}finally{if(o)throw a}}return n}function v(){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 E(){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 r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _(e,t){if(e==null)return{};var r=O(e,t);var n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++){n=o[s];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function O(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var s,o;for(o=0;o<n.length;o++){s=n[o];if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}function C(e,t){if(t&&(A(t)==="object"||typeof t==="function")){return t}return n(e)}function I(e,t){I=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return I(e,t)}function R(e,r){return t(e)||g(e,r)||T(e,r)||v()}function b(e){return r(e)||m(e)||T(e)||E()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function T(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function N(e,t){var r,n,s,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=a(0),i["throw"]=a(1),i["return"]=a(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(o=0)),o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var x=Object.defineProperty;var D=function(e,t,r){return t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var L=function(e,t){return x(e,"name",{value:t,configurable:!0})};var M=function(e,t,r){return D(e,(typeof t==="undefined"?"undefined":A(t))!="symbol"?t+"":t,r)};var P={extends:["@commitlint/config-conventional"]};var j=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 G from"@antfu/eslint-config";import k from"@vitejs/plugin-react-swc";import{defineConfig as U}from"vitest/config";function F(e){return U(h({plugins:[k()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}L(F,"vitestE2E");import q from"@vitejs/plugin-react-swc";import{defineConfig as K}from"vitest/config";var H=".cyberskill-storage";import B from"dotenv";import{bool as Y,cleanEnv as V,str as W}from"envalid";import Q from"node:os";import J from"node:path";import z from"node:process";B.config();function $(){var e={DEBUG:z.env.DEBUG||!1,CWD:z.env.CWD||z.cwd(),CYBERSKILL_STORAGE_DIRECTORY:z.env.CYBERSKILL_STORAGE_DIRECTORY||J.join(Q.homedir(),H)};return V(e,{DEBUG:Y(),CWD:W(),CYBERSKILL_STORAGE_DIRECTORY:W()})}L($,"getEnv");var X="MONGO_MIGRATE_OPTIONS";import{Collection as Z,Db as ee}from"mongodb";import{Document as et,Model as er}from"mongoose";var en=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(ee);L(en,"C_Db");var es=en,eo=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(et);L(eo,"C_Document");var ei=eo,ea=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(er);L(ea,"C_Model");var ec=ea,eu=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(Z);L(eu,"C_Collection");var el=eu;import{format as ed}from"date-fns";import ef from"migrate-mongo";import{Document as ep}from"mongoose";import em from"mongoose-aggregate-paginate-v2";import eg from"mongoose-paginate-v2";import{v4 as ev}from"uuid";var eE={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"}};import eh from"node-persist";var ey=function(e){return e.Error="error",e.Warning="warning",e}({});import eS from"chalk";import e_ from"consola";import{GraphQLError as eO}from"graphql";var eC=$();function eI(e){var t=e.message,r=e.status,n=r===void 0?eE.INTERNAL_SERVER_ERROR:r,s=e.type,o=s===void 0?"graphql":s;var i;var a=(i=t!==null&&t!==void 0?t:n.MESSAGE)!==null&&i!==void 0?i:"Internal server error";throw o==="graphql"?new eO(a,{extensions:{code:n.CODE}}):new Error(a)}L(eI,"throwError");eC.DEBUG||(e_.level=4);function eR(e){var t=eS[e];return typeof t=="function"?t:eS.green}L(eR,"chalkKeyword");var eb={silent:e_.silent,level:e_.level,fatal:e_.fatal,error:e_.error,warn:e_.warn,log:e_.log,info:e_.info,success:e_.success,ready:e_.ready,start:e_.start,box:e_.box,debug:e_.debug,trace:e_.trace,verbose:e_.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){e_.box(eS.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,s=e.rule,o=e.message;e_.log("".concat(eS.gray("File:")," ").concat(eS.blue("".concat(t).concat(n?":".concat(n):"")))),s&&e_.log(" ".concat(eR(r)("Rule:")," ").concat(s)),e_.log(" ".concat(eR(r)("Message:")," ").concat(o))}),e_.box(eR(r)("".concat(e," : ").concat(t.length))),e_.log(eS.gray("─".repeat(40)))}};var eA=$();function eT(){return ew.apply(this,arguments)}function ew(){ew=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=eh.defaultInstance;if(e)return[3,2];return[4,eh.init({dir:eA.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return ew.apply(this,arguments)}L(eT,"initNodePersist");var eN={get:function e(e){return o(function(){var t,r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eT()];case 1:n.sent();return[4,eh.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(eb.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eT()];case 1:n.sent();return[4,eh.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();eb.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eT()];case 1:r.sent();return[4,eh.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();eb.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eT()];case 1:r.sent();return[4,eh.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(eb.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(eb.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return N(this,function(t){try{return[2,"".concat(eA.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(eb.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};import ex from"crypto-js";import eD from"slugify";var eL=eD.default||eD;function eM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;var r=t||{},n=r.lower,s=n===void 0?!0:n,o=r.locale,i=o===void 0?"vi":o,a=_(r,["lower","locale"]);return eL(e,h({lower:s,locale:i},a))}L(eM,"generateSlug");function eP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return ex.SHA256(e).toString(ex.enc.Hex).slice(0,t)}L(eP,"generateShortId");var ej={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":A(e))=="object"?p(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var eG={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return ed(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,r=t===void 0?"string":t;var n=r==="string"?eG.getDateTime():new Date;return{id:ev(),isDel:!1,createdAt:n,updatedAt:n}},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 r=t.method,n=t.pre,s=t.post;r&&n&&e.pre(r,n),r&&s&&e.post(r,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:ev,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,r=e.schema,n=e.virtuals,s=n===void 0?[]:n,o=e.standalone,i=o===void 0?!1:o;var a=new t.Schema(r,{strict:!0});return s.forEach(function(e){var t=e.name,r=e.options,n=e.get;var s=a.virtual(t,r);n&&s.get(n)}),i||a.add(eG.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,r=e.name,n=e.schema,s=e.pagination,o=s===void 0?!1:s,i=e.aggregate,a=i===void 0?!1:i,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!r)throw new Error("Model name is required.");if(t.models[r])return t.models[r];var f=eG.createSchema({mongoose:t,schema:n,virtuals:u});return eG.applyPlugins(f,[o&&eg,a&&em]),eG.applyMiddlewares(f,d),t.model(r,f)},createSlugQuery:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return S(h({},t,r&&{id:{$ne:r}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=o(function(e){return N(this,function(t){return[2,!ej.isEmpty(e)]})});return function(t){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var t=o(function(t){var r;return N(this,function(n){switch(n.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");r={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.findOne(r)];case 1:return[2,!n.sent()]}})});return function(e){return t.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var t=o(function(t){return N(this,function(r){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)})]})});return function(e){return t.apply(this,arguments)}}()}},migrate:{withConfig:L(/*#__PURE__*/function(){var e=o(function(e,t){var r,n,s,o;return N(this,function(i){switch(i.label){case 0:return[4,eN.get(X)];case 1:r=i.sent();if(!r)throw new Error("Missing migrate config");if(ef.config.set(r),!t)return[2,e(void 0)];return[4,ef.database.connect()];case 2:n=i.sent(),s=n.db,o=n.client;i.label=3;case 3:i.trys.push([3,,5,7]);return[4,e({db:s,client:o})];case 4:return[2,i.sent()];case 5:return[4,o.close()];case 6:i.sent();return[7];case 7:return[2]}})});return function(t,r){return e.apply(this,arguments)}}(),"withConfig"),init:L(/*#__PURE__*/o(function(){return N(this,function(e){switch(e.label){case 0:return[4,ef.init()];case 1:e.sent();return[2]}})}),"init"),create:L(/*#__PURE__*/function(){var e=o(function(e){return N(this,function(t){switch(t.label){case 0:return[4,eG.migrate.withConfig(function(){return ef.create(e)})];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}(),"create"),up:L(/*#__PURE__*/o(function(){return N(this,function(e){switch(e.label){case 0:return[4,import("ts-node").then(function(e){return e.register({transpileOnly:!0})})];case 1:e.sent();return[4,eG.migrate.withConfig(/*#__PURE__*/function(){var e=o(function(e){var t,r;return N(this,function(n){switch(n.label){case 0:t=e.db,r=e.client;return[4,ef.up(t,r)];case 1:n.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}(),!0)];case 2:e.sent();return[2]}})}),"up"),down:L(/*#__PURE__*/o(function(){return N(this,function(e){switch(e.label){case 0:return[4,import("ts-node").then(function(e){return e.register({transpileOnly:!0})})];case 1:e.sent();return[4,eG.migrate.withConfig(/*#__PURE__*/function(){var e=o(function(e){var t,r;return N(this,function(n){switch(n.label){case 0:t=e.db,r=e.client;return[4,ef.down(t,r)];case 1:n.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}(),!0)];case 2:e.sent();return[2]}})}),"down"),status:L(/*#__PURE__*/o(function(){return N(this,function(e){switch(e.label){case 0:return[4,eG.migrate.withConfig(/*#__PURE__*/function(){var e=o(function(e){var t;return N(this,function(r){switch(r.label){case 0:t=e.db;return[4,ef.status(t)];case 1:r.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}(),!0)];case 1:e.sent();return[2]}})}),"status"),config:L(function(e){eN.set(X,e)},"config")}},ek=/*#__PURE__*/function(){"use strict";function e(t,r){a(this,e);M(this,"collection");this.collection=t.collection(r)}u(e,[{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=h({},eG.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,t.collection.insertOne(r)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=this;return o(function(){var r,n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=e.map(function(e){return h({},eG.createGenericFields(),e)});return[4,t.collection.insertMany(r)];case 1:n=o.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.findOne(e)];case 1:r=s.sent();return[2,r?{success:!0,message:"Document found",result:r}:{success:!1,message:"Document not found"}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Documents retrieved successfully"};return[4,t.collection.find(e).toArray()];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Count retrieved successfully"};return[4,t.collection.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,t){var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateOne(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,t){var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateMany(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteOne(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteMany(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}}]);return e}();L(ek,"MongoController");var eU=ek,eF=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);M(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return N(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.findOne(e,t,r);n&&o.populate(n);return[4,o.exec()];case 1:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:eE.NOT_FOUND.CODE}];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return N(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.find(e,t,r);n&&o.populate(n);i={success:!0};return[4,o.exec()];case 1:return[2,(i.result=c.sent(),i)];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.paginate(e,t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.aggregatePaginate(r.model.aggregate(e),t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.create(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.insertMany(e,t)];case 1:return[2,(n.result=o.sent().map(function(e){return p(e,ep)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return N(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.findOneAndUpdate(e,t,h({new:!0},r)).exec()];case 1:s=i.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(n.getModelName(),"."),code:eE.NOT_FOUND.CODE}];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return N(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);s={success:!0};return[4,n.model.updateMany(e,t,r).exec()];case 1:return[2,(s.result=i.sent(),s)];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.findOneAndDelete(e,t).exec()];case 1:n=o.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(r.getModelName()," found to delete."),code:eE.NOT_FOUND.CODE}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.deleteMany(e,t).exec()];case 1:n=o.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:eE.NOT_FOUND.CODE}:{success:!0,result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var r=this;return o(function(){var n,s,o,i;return N(this,function(a){switch(a.label){case 0:n=new Set;s=0;a.label=1;case 1:if(!(s<10))return[3,5];o=eP(e,s+t);i=!n.has(o);if(!i)return[3,3];n.add(o);return[4,r.model.exists({shortId:o})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:o}];a.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:eE.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,i,a,c,u,l,d,f,p,m,g;return N(this,function(v){switch(v.label){case 0:v.trys.push([0,8,,9]);s=t[e],i=L(/*#__PURE__*/function(){var e=o(function(e){var s,o,i;return N(this,function(a){switch(a.label){case 0:return[4,n.model.findOne(eG.createSlugQuery(e,r,t.id))];case 1:s=a.sent();if(!s)return[2,e];o=1;a.label=2;case 2:i="".concat(e,"-").concat(o);return[4,n.model.findOne(eG.createSlugQuery(i,r,t.id))];case 3:s=a.sent(),o++;a.label=4;case 4:if(s)return[3,2];a.label=5;case 5:return[2,i]}})});return function(t){return e.apply(this,arguments)}}(),"createUniqueSlug");if(!((typeof s==="undefined"?"undefined":A(s))=="object"))return[3,5];a={};c=[];for(u in s)c.push(u);l=0;v.label=1;case 1:if(!(l<c.length))return[3,4];d=c[l];f=eM(s[d]);return[4,i(f)];case 2:a[d]=v.sent();v.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:a}];case 5:p=eM(s);m={success:!0};return[4,i(p)];case 6:return[2,(m.result=v.sent(),m)];case 7:return[3,9];case 8:g=v.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(g.message),code:eE.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.aggregate(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:eE.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();L(eF,"MongooseController");var eq=eF;var eK=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as eH}from"node:child_process";import eB from"node:process";import*as eY from"node:util";var eV={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import eW from"node-fetch";import eQ from"fs-extra";import{extname as eJ}from"node:path";var ez=eQ.readFileSync,e$=eQ.writeFileSync,eX=eQ.pathExistsSync,eZ=eQ.appendFileSync,e0=eQ.copySync,e1=eQ.removeSync,e2=eQ.statSync,e4=eQ.readJsonSync,e3=eQ.writeJsonSync;function e5(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return eX(e)})}L(e5,"existsSync");function e8(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}t.forEach(function(e){eX(e)&&e1(e)})}L(e8,"removeSync");function e6(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.extensions,s=_(r,["extensions"]);e0(e,t,h({filter:L(function(e){return e2(e).isDirectory()||!n||n.length===0?!0:n.includes(eJ(e))},"filter")},s))}L(e6,"copySync");var e7=$();function e9(e){var t=tL(e7.CWD,tU);if(!e5(t))return!1;try{var r=e4(t),n=r.name,s=r.dependencies,o=s===void 0?{}:s,i=r.devDependencies,a=i===void 0?{}:i,c=n===e,u=e in o,l=e in a;return c||u||l?{path:t,file:r,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return eb.warn("Failed to read package.json: ".concat(e.message)),!1}}L(e9,"getPackage");function te(e){return tt.apply(this,arguments)}function tt(){tt=o(function(e){var t,r,n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,eW("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=o.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=o.sent(),n=r.version;return[2,n];case 3:s=o.sent();throw eb.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return tt.apply(this,arguments)}L(te,"getLatestPackageVersion");function tr(e,t){return tn.apply(this,arguments)}function tn(){tn=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f,p,m,g,v,E,y,S,_,O,C;return N(this,function(I){switch(I.label){case 0:I.trys.push([0,4,,5]);r=e9(e);if(!r)return[2,h({},eV)];c=r.path,u=r.file,l=r.isCurrentProject,d=r.isDepend,f=r.isDevDepend,p=(n=u.dependencies)!==null&&n!==void 0?n:{},m=(s=u.devDependencies)!==null&&s!==void 0?s:{},g=l?(o=u.version)!==null&&o!==void 0?o:"0.0.0":d?(i=p[e])!==null&&i!==void 0?i:"0.0.0":f?(a=m[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!l)return[3,1];y=g;return[3,3];case 1:return[4,te(e)];case 2:y=I.sent();I.label=3;case 3:v=y,E=l||g===v;if(!E&&(t===null||t===void 0?void 0:t.update)){;_=d?"dependencies":f?"devDependencies":null;_&&((S=u[_])===null||S===void 0?void 0:S[e])!==v&&(u[_]=(O=u[_])!==null&&O!==void 0?O:{},u[_][e]=v,e3(c,u),eb.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:l,installedPath:c,file:u,isUpToDate:E}];case 4:C=I.sent();return[2,(eb.error('Error checking package "'.concat(e,'": ').concat(C.message)),h({},eV))];case 5:return[2]}})});return tn.apply(this,arguments)}L(tr,"checkPackage");function ts(){return to.apply(this,arguments)}function to(){to=o(function(){var e,t,r,n,s,o,i,a,c,u,l,d;return N(this,function(f){switch(f.label){case 0:e=[{command:L(function(){return rm.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:L(function(){return rm.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:L(function(){return rm.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(o=s.next()).done))return[3,8];i=o.value,a=i.command,c=i.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tb("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();eb.warn("Installation attempt failed: ".concat(c)),eb.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();r=true;n=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return to.apply(this,arguments)}L(ts,"installDependencies");function ti(e,t){return ta.apply(this,arguments)}function ta(){ta=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f;return N(this,function(p){switch(p.label){case 0:if(!e5(ru.PACKAGE_JSON)){eb.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,13,,14]);r=b(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return tr(e,h({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=p.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,ts()];case 3:n=p.sent();p.label=4;case 4:n;o=true,i=false,a=undefined;p.label=5;case 5:p.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();p.label=6;case 6:if(!!(o=(u=c.next()).done))return[3,9];l=u.value;return[4,l()];case 7:p.sent();p.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=p.sent();i=true;a=d;return[3,12];case 11:try{if(!o&&c.return!=null){c.return()}}finally{if(i){throw a}}return[7];case 12:return[3,14];case 13:f=p.sent();throw eb.error('Failed to setup "'.concat(e.join(", "),'": ').concat(f.message)),f;case 14:return[2]}})});return ta.apply(this,arguments)}L(ti,"setupPackages");var tc=$(),tu=eY.promisify(eH);function tl(e){return"error_list:".concat(e)}L(tl,"getErrorListKey");function td(e){return tf.apply(this,arguments)}function tf(){tf=o(function(e){var t,r,n;return N(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),r=tl(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,eN.set(r,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return N(this,function(t){switch(t.label){case 0:return[4,eN.getLogLink(r)];case 1:e=t.sent();e&&eb.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=s.sent();eb.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return tf.apply(this,arguments)}L(td,"saveErrorListToStorage");function tp(){return tm.apply(this,arguments)}function tm(){tm=o(function(){var e,t,r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eN.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=o(function(e){var t;return N(this,function(r){switch(r.label){case 0:return[4,eN.get(e)];case 1:return[2,((t=r.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,n.sent().flat()];case 3:r=n.sent();return[2,(eb.error("Failed to retrieve stored errors: ".concat(r.message)),[])];case 4:return[2]}})});return tm.apply(this,arguments)}L(tp,"getStoredErrorLists");function tg(){return tv.apply(this,arguments)}function tv(){tv=o(function(){var e,t,r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eN.keys()];case 1:e=n.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 eN.remove(e)}))];case 2:n.sent();return[3,4];case 3:r=n.sent();eb.error("Failed to clear error lists: ".concat(r.message));return[3,4];case 4:return[2]}})});return tv.apply(this,arguments)}L(tg,"clearAllErrorLists");function tE(e){var t=[],r=[],n="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,i=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=o.exec(e)||[],m=i.exec(e)||[];var g,v,E,h,y,S;f.length&&n?t.push({file:n,position:"".concat(f[1],":").concat(f[2]),type:f[3]===ey.Error?ey.Error:ey.Warning,message:(g=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&g!==void 0?g:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(E=p===null||p===void 0?void 0:p[1])!==null&&E!==void 0?E:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===ey.Error?ey.Error:ey.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:ey.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:""}):r.push(e.trim())}}),t.length&&td(t),tc.DEBUG&&r.length&&(eb.warn("Unmatched lines:"),r.forEach(function(e){return eb.info(" ".concat(e))}))}L(tE,"parseTextErrors");function th(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,s=e.line,o=e.column,i=e.ruleId,a=e.message;r.push({type:n===2?ey.Error:ey.Warning,file:t,position:"".concat(s,":").concat(o),rule:i,message:a})})}),r.length&&td(r)}catch(t){tE(e)}}L(th,"parseCommandOutput");function ty(e){return tS.apply(this,arguments)}function tS(){tS=o(function(e){var t,r,n,s,o,i,a,c,u;var l=arguments;return N(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:th;r=new AbortController;eB.on("SIGINT",function(){eb.warn("Process interrupted. Terminating..."),r.abort(),eB.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tu(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=d.sent(),s=n.stdout,o=n.stderr;[s,o].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:i=d.sent();a=i.stdout,c=i.stderr,u=i.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&eb.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return tS.apply(this,arguments)}L(ty,"executeCommand");function t_(e){return{raw:!0,cmd:e}}L(t_,"rawCommand");function tO(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(re," ").concat(tj," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(re," ").concat(t6," ").concat(tJ," ").concat(e):"".concat(re," ").concat(tQ," ").concat(e)}L(tO,"formatCLI");function tC(e,t){return typeof e=="function"?tO(e(t),t):(typeof e==="undefined"?"undefined":A(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tO(e,t):e}L(tC,"formatCommand");function tI(e){return tR.apply(this,arguments)}function tR(){tR=o(function(e){var t,r,n,s,o,i,a;var c=arguments;return N(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};n=(r=t===null||t===void 0?void 0:t.isRemote)!==null&&r!==void 0?r:!1;if(!n)return[3,1];a=!1;return[3,3];case 1:return[4,tr(tj)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,o={isRemote:n,isCurrentProject:s},i=typeof e=="function"?e(o):e;return[2,Object.fromEntries(Object.entries(i).map(function(e){var t=R(e,2),r=t[0],n=t[1];return[r,tC(n,o)]}))]}})});return tR.apply(this,arguments)}L(tI,"resolveCommands");function tb(e,t){return tA.apply(this,arguments)}function tA(){tA=o(function(e,t){var r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);eb.start("".concat(e)),tc.DEBUG&&eb.info("→ ".concat(t));return[4,ty(t)];case 1:n.sent(),eb.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw eb.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return tA.apply(this,arguments)}L(tb,"runCommand");import{join as tT,resolve as tw}from"node:path";var tN=$();function tx(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tw.apply(void 0,[tN.CWD].concat(b(t)))}L(tx,"resolveWorkingPath");function tD(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tw.apply(void 0,b(t))}L(tD,"resolve");function tL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tT.apply(void 0,b(t))}L(tL,"join");var tM=$(),tP=tM.CWD,tj="@cyberskill/shared",tG="node_modules",tk="dist",tU="package.json",tF="package-lock.json",tq="tsconfig.json",tK=".gitignore",tH=".simple-git-hooks.json",tB="pnpm-lock.yaml",tY=".git/hooks/",tV=".git/COMMIT_EDITMSG",tW=tL(tP,tG,tj,tk),tQ="cyberskill",tJ="src/nodejs/cli/index.ts",tz="eslint",t$="eslint",tX="vitest",tZ="playwright",t0="vitest",t1="@commitlint/cli",t2="commitlint",t4="lint-staged",t3="lint-staged",t5="typescript",t8="tsc",t6="tsx",t7="git",t9="pnpm",re="pnpm exec",rt="simple-git-hooks",rr="simple-git-hooks",rn="@eslint/config-inspector",rs="eslint-config-inspector",ro="node-modules-inspector",ri="node-modules-inspector",ra="migrate-mongo",rc="migrate-mongo",ru={CYBERSKILL_DIRECTORY:tW,WORKING_DIRECTORY:tP,TS_CONFIG:tx(tq),GIT_IGNORE:tx(tK),GIT_HOOK:tx(tY),GIT_COMMIT_MSG:tx(tV),SIMPLE_GIT_HOOKS_JSON:tx(tH),PACKAGE_JSON:tx(tU),PACKAGE_LOCK_JSON:tx(tF),PNPM_LOCK_YAML:tx(tB),NODE_MODULES:tx(tG),LINT_STAGED_CONFIG:tx("".concat(tW,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:tx("".concat(tW,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:tx("".concat(tW,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:tx("".concat(tW,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:tx("".concat(tW,"/react/vitest/vitest.e2e.js"))};function rl(e){var t=e.isCurrentProject;return h({"pre-commit":t3,"commit-msg":t2},t&&{"pre-push":t_("".concat(t7," pull"))})}L(rl,"HOOK");function rd(e,t,r){return rf.apply(this,arguments)}function rf(){rf=o(function(e,t,r){return N(this,function(n){switch(n.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case eK.CLI:return[3,1];case eK.STRING:return[3,3];case eK.FUNCTION:return[3,4]}return[3,6];case 1:return[4,ti(t.split(" "),{update:!0})];case 2:return[2,(n.sent(),tC(t_("".concat(re," ").concat(r))))];case 3:return[2,tC(t_(t))];case 4:return[4,ti(t.split(" "),{update:!0})];case 5:if(n.sent(),typeof r=="function")return[2,r()];throw new Error("'second' argument is not a callable function");case 6:throw new Error("Unsupported command type");case 7:return[2]}})});return rf.apply(this,arguments)}L(rd,"buildCommand");function rp(e,t,r){return /*#__PURE__*/o(function(){return N(this,function(n){return[2,rd(e,t,r)]})})}L(rp,"commandFactory");var rm={simpleGitHooks:rp(eK.CLI,rt,rr),eslintInspect:rp(eK.CLI,rn,rs),nodeModulesInspect:rp(eK.CLI,ro,ri),eslintCheck:rp(eK.CLI,tz,"".concat(t$," ").concat(ru.WORKING_DIRECTORY)),eslintFix:rp(eK.CLI,tz,"".concat(t$," ").concat(ru.WORKING_DIRECTORY," --fix")),typescriptCheck:rp(eK.CLI,t5,"".concat(t8," -p ").concat(ru.TS_CONFIG," --noEmit")),configureGitHook:rp(eK.STRING,"".concat(t7," config core.hooksPath ").concat(ru.GIT_HOOK)),testUnit:rp(eK.CLI,tX,"".concat(t0," --config ").concat(ru.UNIT_TEST_CONFIG)),testE2e:rp(eK.CLI,"".concat(tX," ").concat(tZ),"".concat(t0," --config ").concat(ru.E2E_TEST_CONFIG)),mongoMigrateCreate:L(function(e){return rp(eK.FUNCTION,"".concat(ra),function(){return eG.migrate.create(e)})()},"mongoMigrateCreate"),mongoMigrateUp:rp(eK.FUNCTION,"".concat(ra),eG.migrate.up),mongoMigrateDown:rp(eK.FUNCTION,"".concat(ra),eG.migrate.down),commitLint:rp(eK.CLI,t1,"".concat(t2," --edit ").concat(ru.GIT_COMMIT_MSG," --config ").concat(ru.COMMITLINT_CONFIG)),lintStaged:rp(eK.CLI,t4,"".concat(t3," --config ").concat(ru.LINT_STAGED_CONFIG)),stageBuildDirectory:rp(eK.STRING,"".concat(t7," add ").concat(tk)),build:rp(eK.STRING,"".concat(t9," run build")),pnpmInstallStandard:rp(eK.STRING,"".concat(t9," install")),pnpmInstallLegacy:rp(eK.STRING,"".concat(t9," install --legacy-peer-deps")),pnpmInstallForce:rp(eK.STRING,"".concat(t9," install --force"))};function rg(e){return K(h({plugins:[q()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[ru.UNIT_TEST_SETUP_CONFIG]}},e))}L(rg,"vitestUnit");function rv(e){try{return JSON.parse(e),!0}catch(e){return!1}}L(rv,"isJson");function rE(e){return!!e&&(typeof e==="undefined"?"undefined":A(e))=="object"&&!Array.isArray(e)}L(rE,"isPlainObject");function rh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=R(i.value,2),c=a[0],u=a[1];var l=e[c];Array.isArray(u)?e[c]=Array.from(new Set(b(Array.isArray(l)?l:[]).concat(b(u)))):rE(u)?e[c]=rh(rE(l)?l:{},u):e[c]=u}}catch(e){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e},{})}L(rh,"deepMerge");import*as ry from"globals";var rS=[{languageOptions:{globals:h({},ry.node,ry.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var r_;var rO=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return rh.apply(void 0,b(t))},"passThroughHandler"),rC=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=rh.apply(void 0,[rS].concat(b(t))),s=n.ignores,o=_(n,["ignores"]),i=Array.isArray(s)&&s.every(function(e){return typeof e=="string"})?{ignores:s}:void 0,a=[o].concat(b(i?[i]:[]));return G.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"),rI=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return F.apply(void 0,b(t))},"handleVitestReactE2E"),rR=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return rg.apply(void 0,b(t))},"handleVitestReactUnit"),rb=(r_={},l(r_,j.ESLINT,rC),l(r_,j.COMMITLINT,rO),l(r_,j.LINT_STAGED,rO),l(r_,j.VITEST_REACT_E2E,rI),l(r_,j.VITEST_REACT_UNIT,rR),r_);function rA(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var s=rb[e];if(!s)throw new Error("Unknown config type: ".concat(e));return s.apply(void 0,b(r))}L(rA,"mergeConfigs");import{defineConfig as rT}from"@eddeee888/gcg-typescript-resolver-files";function rw(e){var t=e.uri,r=e.from,n=e.to,s=e.target,o=s===void 0?"client":s;var i=o==="client",a=o==="server";return S(h({schema:t,ignoreNoDocuments:!0,overwrite:!0},i&&{documents:[r]}),{generates:h({},i&&l({},n,{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0}}),a&&l({},n,rT()))})}L(rw,"createGraphqlCodegenConfig");var rN={"*":["eslint --fix"]};var rx=(typeof window==="undefined"?"undefined":A(window))<"u";import{ApolloServer as rD}from"@apollo/server";import{expressMiddleware as rL}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as rM}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as rP,ApolloServerPluginLandingPageProductionDefault as rj}from"@apollo/server/plugin/landingPage/default";function rG(e){return new rD(h({schema:e.schema,plugins:[e.isDev?rP():rj(),rM({httpServer:e.server})].concat(b(e.drainServer?[{serverWillStart:function t(){return o(function(){return N(this,function(t){return[2,{drainServer:function t(){return o(function(){var t;return N(this,function(r){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),eb.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}L(rG,"createApolloServer");import rk from"node:process";import{hideBin as rU}from"yargs/helpers";import rF from"yargs/yargs";var rq={name:"@cyberskill/shared",type:"module",version:"1.101.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.4","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6","ts-node":"10.9.2",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};function rK(){return rH.apply(this,arguments)}function rH(){rH=o(function(){var e,t;return N(this,function(r){switch(r.label){case 0:if(!e5(ru.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,rm.typescriptCheck()];case 1:return[4,tb.apply(void 0,t.concat([r.sent()]))];case 2:e=r.sent();return[3,4];case 3:e=eb.warn("No TypeScript configuration found. Skipping type check.");r.label=4;case 4:e;return[2]}})});return rH.apply(this,arguments)}L(rK,"checkTypescript");function rB(){return rY.apply(this,arguments)}function rY(){rY=o(function(){var e,t,r,n;var s=arguments;return N(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];r=["Running ESLint with auto-fix"];return[4,rm.eslintFix()];case 1:return[4,tb.apply(void 0,r.concat([o.sent()]))];case 2:t=o.sent();return[3,6];case 3:n=["Running ESLint check"];return[4,rm.eslintCheck()];case 4:return[4,tb.apply(void 0,n.concat([o.sent()]))];case 5:t=o.sent();o.label=6;case 6:t;return[2]}})});return rY.apply(this,arguments)}L(rB,"checkEslint");function rV(e,t){if(!t.length)return;var r=e==="Errors"?"red":"yellow";eb.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,r)}L(rV,"printIssues");function rW(){return rQ.apply(this,arguments)}function rQ(){rQ=o(function(){var e,t,r;return N(this,function(n){switch(n.label){case 0:return[4,tp()];case 1:e=n.sent(),t=e.filter(function(e){return e.type===ey.Error}),r=e.filter(function(e){return e.type===ey.Warning});!t.length&&!r.length?eb.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(rV("Warnings",r),rV("Errors",t),(t.length>0||r.length>0)&&rk.exit(1));return[2]}})});return rQ.apply(this,arguments)}L(rW,"showCheckResult");function rJ(){return rz.apply(this,arguments)}function rz(){rz=o(function(){var e,t,r,n,s,o;return N(this,function(i){switch(i.label){case 0:return[4,tg()];case 1:i.sent();return[4,tr(tj)];case 2:e=i.sent(),t=e.isCurrentProject;if(!t)return[3,9];i.label=3;case 3:i.trys.push([3,8,,9]);r=["Building package: ".concat(tj)];return[4,rm.build()];case 4:return[4,tb.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();n=["Staging build artifacts"];return[4,rm.stageBuildDirectory()];case 6:return[4,tb.apply(void 0,n.concat([i.sent()]))];case 7:i.sent();return[3,9];case 8:s=i.sent();throw eb.error("Error building and staging ".concat(tj,": ").concat(s.message)),s;case 9:o=["Executing lint-staged"];return[4,rm.lintStaged()];case 10:return[4,tb.apply(void 0,o.concat([i.sent()]))];case 11:i.sent(),rW();return[2]}})});return rz.apply(this,arguments)}L(rJ,"lintStaged");function r$(){return rX.apply(this,arguments)}function rX(){rX=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,rm.eslintInspect()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rX.apply(this,arguments)}L(r$,"inspectLint");function rZ(){return r0.apply(this,arguments)}function r0(){r0=o(function(){return N(this,function(e){switch(e.label){case 0:return[4,tg()];case 1:e.sent();return[4,Promise.all([rK(),rB()])];case 2:e.sent(),rW();return[2]}})});return r0.apply(this,arguments)}L(rZ,"lintCheck");function r1(){return r2.apply(this,arguments)}function r2(){r2=o(function(){return N(this,function(e){switch(e.label){case 0:return[4,tg()];case 1:e.sent();return[4,Promise.all([rK(),rB(!0)])];case 2:e.sent(),rW();return[2]}})});return r2.apply(this,arguments)}L(r1,"lintFix");function r4(){return r3.apply(this,arguments)}function r3(){r3=o(function(){var e;return N(this,function(t){switch(t.label){case 0:return[4,tg()];case 1:t.sent();e=["Validating commit message"];return[4,rm.commitLint()];case 2:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),rW();return[2]}})});return r3.apply(this,arguments)}L(r4,"commitLint");function r5(){return r8.apply(this,arguments)}function r8(){r8=o(function(){var e,t,r,n;return N(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,rm.configureGitHook()];case 1:return[4,tb.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),e8(ru.GIT_HOOK);return[4,tI(rl)];case 3:t=s.sent();e3(ru.SIMPLE_GIT_HOOKS_JSON,t);r="\n".concat(tH,"\n");e5(ru.GIT_IGNORE)?ez(ru.GIT_IGNORE,"utf-8").split("\n").includes(tH)||eZ(ru.GIT_IGNORE,r,"utf-8"):e$(ru.GIT_IGNORE,r,"utf-8");n=["Setting up simple-git-hooks"];return[4,rm.simpleGitHooks()];case 4:return[4,tb.apply(void 0,n.concat([s.sent()]))];case 5:s.sent();return[2]}})});return r8.apply(this,arguments)}L(r5,"setupGitHook");function r6(){return r7.apply(this,arguments)}function r7(){r7=o(function(){return N(this,function(e){switch(e.label){case 0:return[4,ti([tj],{update:!0,postInstallActions:[r5]})];case 1:e.sent();return[2]}})});return r7.apply(this,arguments)}L(r6,"setup");function r9(){return ne.apply(this,arguments)}function ne(){ne=o(function(){return N(this,function(e){switch(e.label){case 0:e8(ru.NODE_MODULES,ru.PNPM_LOCK_YAML);return[4,ts()];case 1:e.sent();return[4,r5()];case 2:e.sent();return[2]}})});return ne.apply(this,arguments)}L(r9,"reset");function nt(){return nr.apply(this,arguments)}function nr(){nr=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,rm.nodeModulesInspect()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return nr.apply(this,arguments)}L(nt,"inspect");function nn(){return ns.apply(this,arguments)}function ns(){ns=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,rm.testUnit()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return ns.apply(this,arguments)}L(nn,"testUnit");function no(){return ni.apply(this,arguments)}function ni(){ni=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,rm.testE2e()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return ni.apply(this,arguments)}L(no,"testE2E");function na(e){return nc.apply(this,arguments)}function nc(){nc=o(function(e){var t;return N(this,function(r){switch(r.label){case 0:t=["Creating MongoDB migration"];return[4,rm.mongoMigrateCreate(e)];case 1:return[4,tb.apply(void 0,t.concat([r.sent()]))];case 2:r.sent();return[2]}})});return nc.apply(this,arguments)}L(na,"mongoMigrateCreate");function nu(){return nl.apply(this,arguments)}function nl(){nl=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,rm.mongoMigrateUp()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return nl.apply(this,arguments)}L(nu,"mongoMigrateUp");function nd(){return nf.apply(this,arguments)}function nf(){nf=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,rm.mongoMigrateDown()];case 1:return[4,tb.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return nf.apply(this,arguments)}L(nd,"mongoMigrateDown");o(function(){var e;return N(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,rF(rU(rk.argv)).scriptName(tQ).usage("$0 <command> [options]").command("lint","Check code for linting issues",rZ).command("lint:fix","Fix linting issues automatically",r1).command("lint:inspect","View active ESLint configuration",r$).command("lint-staged","Run lint checks on staged files",rJ).command("commitlint","Validate commit message format",r4).command("setup","Initialize project setup and dependencies",r6).command("reset","Reset the project and reinstall dependencies",r9).command("inspect","Analyze installed project dependencies",nt).command("test:unit","Run unit test suite",nn).command("test:e2e","Run end-to-end test suite",no).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=o(function(e){return N(this,function(t){switch(t.label){case 0:if(!e.name){eb.error("Migration name is required.");return[2]}return[4,na(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",nu).command("mongo:migrate:down","Rollback last MongoDB migration",nd).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(rq.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();eb.error("Fatal: ".concat(e.message)),rk.exit(1);return[3,3];case 3:return[2]}})})();import{Router as np}from"express";import nm from"compression";import ng from"cors";import nv from"express";import nE from"express-device";import nh from"express-session";function ny(e){return ng({origin:L(function(t,r){var n;e.isDev||((n=e.whiteList)===null||n===void 0?void 0:n.includes(t!==null&&t!==void 0?t:""))?r(null,!0):r(null,!1)},"origin"),credentials:!0})}L(ny,"createCors");function nS(e){var t=nv();return t.set("trust proxy",1),t.use(nv.urlencoded({extended:!0})),t.use(nm()),t.use(nE.capture()),e.staticFolder&&t.use(nv.static(e.staticFolder)),e.sessionOptions&&t.use(nh(e.sessionOptions)),t}L(nS,"createExpress");import{useServer as n_}from"graphql-ws/use/ws";import{WebSocketServer as nO}from"ws";function nC(e){return new nO({server:e.server,path:e.path})}L(nC,"createWSServer");function nI(e){return n_({schema:e.schema},e.server)}L(nI,"initGraphQLWS");import{ApolloClient as nR,ApolloError as nb,ApolloLink as nA,ApolloProvider as nT,from as nw,HttpLink as nN,InMemoryCache as nx,split as nD}from"@apollo/client";import{onError as nL}from"@apollo/client/link/error";import{removeTypenameFromVariables as nM}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as nP}from"@apollo/client/link/subscriptions";import{getMainDefinition as nj}from"@apollo/client/utilities";import{createClient as nG}from"graphql-ws";import nk,{useMemo as nU}from"react";import{FaInfo as nF}from"react-icons/fa6";import nq,{use as nK}from"react";import{FaRepeat as nH}from"react-icons/fa6";import{createContext as nB}from"react";var nY=nB(void 0);import nV from"./react/apollo-error/apollo-error.module.scss";function nW(){var e=nK(nY),t=e===null||e===void 0?void 0:e.error;if(!t)return null;var r=L(function(e,t){return(t===null||t===void 0?void 0:t.length)?nq.createElement("div",null,nq.createElement("strong",null,e,":"),nq.createElement("ul",null,t.map(function(e){return nq.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return nq.createElement("div",{className:nV["modal-backdrop"]},nq.createElement("div",{className:nV["modal-content"]},nq.createElement("button",{type:"button",className:nV["btn-close"],onClick:e.hideError},"✕"),nq.createElement("div",{className:nV["error-title"]},nq.createElement("button",{type:"button",className:nV["btn-retry"],onClick:L(function(){return window.location.reload()},"onClick")},nq.createElement(nH,null))," ",t.message),nq.createElement("div",{className:nV["error-details"]},t.networkError&&nq.createElement("pre",{className:"network"},nq.createElement("strong",null,"Network Error:")," ",t.networkError.message),r("GraphQL Errors",b(t.graphQLErrors)),r("Protocol Errors",b(t.protocolErrors)),r("Client Errors",b(t.clientErrors)),t.extraInfo&&nq.createElement("pre",{className:"extra"},nq.createElement("strong",null,"Extra Info:")," ",JSON.stringify(t.extraInfo,null,4)))))}L(nW,"ApolloError");import{use as nQ}from"react";function nJ(){var e=nQ(nY);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}L(nJ,"useApolloError");import nz,{useEffect as n$,useMemo as nX,useState as nZ}from"react";var n0=null;function n1(e){n0=e}L(n1,"setGlobalApolloErrorCallback");function n2(e){n0===null||n0===void 0?void 0:n0(e)}L(n2,"showGlobalApolloError");function n4(e){var t=e.children;var r=R(nZ(null),2),n=r[0],s=r[1];n$(function(){n1(s)},[]);var o=nX(function(){return{error:n,showError:s,hideError:L(function(){return s(null)},"hideError")}},[n]);return nz.createElement(nY,{value:o},t)}L(n4,"ApolloErrorProvider");import{consola as n3}from"consola/browser";var n5={silent:n3.silent,level:n3.level,fatal:n3.fatal,error:n3.error,warn:n3.warn,log:n3.log,info:n3.info,success:n3.success,ready:n3.ready,start:n3.start,box:n3.box,debug:n3.debug,trace:n3.trace,verbose:n3.verbose};import{toast as n8,Toaster as n6}from"react-hot-toast";var n7="/graphql";var n9,se=(n9=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);var e;e=i(this,t,arguments);M(e,"count",0);return e}u(t,[{key:"request",value:function e(e,t){var r=this;var n=Date.now();return this.count+=1,t(e).map(function(t){var s=Date.now()-n,o=e.operationName||"Unnamed";return n5.info("[Apollo] #".concat(r.count,": ").concat(o," (").concat(s,"ms)")),t})}}]);return t}(nA),L(n9,"DevLoggerLink"),n9);function st(e){var t=e.uri,r=e.wsUrl,n=e.customLinks,s=new se,o=nL(function(e){var t=e.graphQLErrors,r=e.networkError,n=e.protocolErrors,s=e.operation;var o=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(t&&t.forEach(function(e){var t=e.message,r=e.locations,n=e.path;n5.error("[GraphQL error] ".concat(o,": ").concat(t,", Location: ").concat(JSON.stringify(r),", Path: ").concat(n))}),n&&n.forEach(function(e){var t=e.message,r=e.extensions;n5.error("[Protocol error]: ".concat(t,", Extensions: ").concat(JSON.stringify(r)))}),r&&n5.error("[Network error]: ".concat(r)),t||n||r){var i,a;var c=(t===null||t===void 0?void 0:(i=t[0])===null||i===void 0?void 0:i.message)||(n===null||n===void 0?void 0:(a=n[0])===null||a===void 0?void 0:a.message)||(r===null||r===void 0?void 0:r.message)||"Unexpected error",u=new nb({graphQLErrors:t||[],protocolErrors:n||[],clientErrors:[],networkError:r||null,errorMessage:c,extraInfo:{operation:s}});n8.error(function(e){return nk.createElement(nk.Fragment,null,c,"\xa0",nk.createElement(nF,{cursor:"pointer",onClick:L(function(){setTimeout(function(){n2(u)},0),n8.dismiss(e.id)},"onClick")}))})}}),i=nM();t||n5.warn('[Apollo] No GraphQL URI provided — using "'.concat(n7,'" as default'));var a=new nN({uri:t!==null&&t!==void 0?t:n7,credentials:"include"}),c=r?new nP(nG({url:r})):nA.empty(),u=p(c,nA)?nD(function(e){var t=e.query;var r=nj(t);return r.kind==="OperationDefinition"&&r.operation==="subscription"},c,a):a;return u===a&&r&&n5.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[s,o,i].concat(b(n!==null&&n!==void 0?n:[]),[u])}L(st,"createApolloLinks");function sr(e){var t=e.isNextJS,r=e.options,n=e.children,s=e.client,o=e.provider,i=e.cache;var a=r||{},c=a.uri,u=a.wsUrl,l=a.customLinks,d=_(a,["uri","wsUrl","customLinks"]),f=s!==null&&s!==void 0?s:nR;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var m=o||nT,g=nU(function(){return nw(st({uri:c!==null&&c!==void 0?c:n7,wsUrl:u!==null&&u!==void 0?u:"",customLinks:l!==null&&l!==void 0?l:[]}))},[c,u,l]),v=nU(function(){return p(i,nx)?i:new nx},[i]),E=nU(function(){return new f(h({link:g,cache:v},d))},[f,g,v,d]),y=t?nk.createElement(m,{makeClient:L(function(){return E},"makeClient")},n):nk.createElement(m,{client:E},n);return nk.createElement(nk.Fragment,null,nk.createElement(n4,null,y,nk.createElement(nW,null)),nk.createElement(n6,{position:"top-right"}))}L(sr,"ApolloProvider");import{useTranslation as sn}from"react-i18next";var ss=sn;import so from"i18next";import{initReactI18next as si}from"react-i18next";function sa(e){return so.use(si).init(e)}L(sa,"initI18next");import sc from"classnames";import su from"react";import sl from"./react/loading/loading.module.scss";function sd(e){var t=e.full,r=t===void 0?!1:t,n=e.block,s=n===void 0?!1:n,o=e.className,i=o===void 0?"":o,a=e.message,c=a===void 0?"Loading":a,u=_(e,["full","block","className","message"]);function l(){return su.createElement("div",h({className:sl.container},u),su.createElement("div",{className:sl.ring}),su.createElement("div",{className:sl.ring}),su.createElement("div",{className:sl.ring}),su.createElement("div",{className:sl.ring}),c&&su.createElement("div",{className:sl.message},c))}return L(l,"_renderLoading"),r?su.createElement("div",{className:sc(sl.fullscreen,i)},l()):s?su.createElement("div",{className:sc(sl.block,i)},l()):l()}L(sd,"Loading");import{createContext as sf}from"react";var sp=sf(void 0);import{use as sm}from"react";function sg(){var e=sm(sp);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}L(sg,"useLoading");import sv,{useCallback as sE,useMemo as sh,useState as sy}from"react";function sS(e){var t=e.children;var r=R(sy(!1),2),n=r[0],s=r[1],o=R(sy(!1),2),i=o[0],a=o[1],c=sE(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),a(e)},[]),u=sE(function(){s(!1),a(!1)},[]),l=sh(function(){return{isLoading:n,isGlobalLoading:i,showLoading:c,hideLoading:u}},[n,i,c,u]);return sv.createElement(sp,{value:l},n?sv.createElement(sd,{full:i}):t)}L(sS,"LoadingProvider");import{enUS as s_}from"date-fns/locale";var sO={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:s_,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};import{createContext as sC}from"react";var sI=sC(void 0);import{NextIntlClientProvider as sR}from"next-intl";import sb from"react";import{useTranslations as sA}from"next-intl";import{use as sT}from"react";function sw(){var e=sT(sI);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}L(sw,"useNextIntl");var sN=sA;function sx(e){var t=L(function(t){var r;var n;var s=sw(),o=s.currentLanguage,i=t.messages,a=t.languages,c="en",u=i[(o===null||o===void 0?void 0:o.value)||c],l=(n=(r=a.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||r===void 0?void 0:r.timezone)!==null&&n!==void 0?n:sO.timezone;return i?sb.createElement(sR,{locale:(o===null||o===void 0?void 0:o.value)||c,messages:u||null,timeZone:l},sb.createElement(e,t)):(n5.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||c)),null)},"PageWithI18n");return t.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),t}L(sx,"withNextIntl");import sD,{useMemo as sL}from"react";import{useCallback as sM,useEffect as sP,useState as sj}from"react";var sG={serialize:L(function(e){return JSON.stringify(e,function(e,t){return p(t,Date)?{__type:"Date",value:t.toISOString()}:t})},"serialize"),deserialize:L(function(e){return JSON.parse(e,function(e,t){return(t===null||t===void 0?void 0:t.__type)==="Date"?new Date(t.value):t})},"deserialize")};import sk from"localforage";var sU={get:function e(e){return o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sk.getItem(e)];case 1:return[2,r.sent()];case 2:t=r.sent();return[2,(n5.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 3:return[2]}})})()},set:function e(e,t){return o(function(){var r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sk.setItem(e,t)];case 1:n.sent();return[3,3];case 2:r=n.sent();n5.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},remove:function e(e){return o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sk.removeItem(e)];case 1:r.sent();return[3,3];case 2:t=r.sent();n5.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},keys:function e(){return o(function(){var e,t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sk.keys()];case 1:return[2,(e=r.sent())!==null&&e!==void 0?e:[]];case 2:t=r.sent();return[2,(n5.error("[Storage:keys] Error getting keys:",t),[])];case 3:return[2]}})})()}};function sF(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sG;var n=R(sj(t),2),s=n[0],i=n[1],a=R(sj(!1),2),c=a[0],u=a[1];sP(function(){var n=!0;return L(/*#__PURE__*/o(function(){var s,o,a,c;return N(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,sU.get(e)];case 1:s=l.sent();if(!n)return[3,5];if(!(s!==null))return[3,2];o=r.deserialize(s);i(o);return[3,5];case 2:if(!(t!==void 0))return[3,4];a=r.serialize(t);return[4,sU.set(e,a)];case 3:l.sent(),i(t);return[3,5];case 4:i(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();n5.error('Error loading value for key "'.concat(e,'":'),c),n&&i(t);return[3,8];case 7:n&&u(!0);return[7];case 8:return[2]}})}),"loadValue")(),function(){n=!1,u(!1)}},[e,t,r]),sP(function(){if(!c)return;L(/*#__PURE__*/o(function(){var t,n;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];t=r.serialize(s);return[4,sU.set(e,t)];case 1:o.sent();o.label=2;case 2:return[3,4];case 3:n=o.sent();n5.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})}),"saveValue")()},[s,e,r,c]);var l=sM(function(e){i(function(t){return typeof e=="function"?e(t):e})},[]),d=sM(/*#__PURE__*/o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sU.remove(e)];case 1:r.sent(),i(void 0);return[3,3];case 2:t=r.sent();n5.error('Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})}),[e]);return{value:s,set:l,remove:d}}L(sF,"useStorage");function sq(e){var t=e.children;return sD.createElement(sD.Fragment,null,t)}L(sq,"LanguageWrapperBase");var sK=sx(sq);function sH(e){var t=e.children,r=e.languages,n=e.messages;var s=sF("lang",r[0]),o=s.value,i=s.set,a=sL(function(){return{languages:r,currentLanguage:o!==null&&o!==void 0?o:sO,setCurrentLanguage:i}},[r,i,o]);return sD.createElement(sI,{value:a},sD.createElement(sK,{languages:r,messages:n},t))}L(sH,"NextIntlProvider");import sB from"unorm";var sY={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},sV=Object.entries(sY).reduce(function(e,t){var r=R(t,2),n=r[0],s=r[1];return e[n.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function sW(e){e=sB.nfkc(e);var t=h({},sY,sV);var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=R(i.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){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e}L(sW,"regexSearchMapper");function sQ(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}L(sQ,"removeAccent");export{nW as ApolloError,nY as ApolloErrorContext,n4 as ApolloErrorProvider,sr as ApolloProvider,tk as BUILD_DIRECTORY,eV as CHECK_PACKAGE_EMPTY_RESULT,t2 as COMMIT_LINT_CLI,t1 as COMMIT_LINT_PACKAGE_NAME,tQ as CYBERSKILL_CLI,tJ as CYBERSKILL_CLI_PATH,tW as CYBERSKILL_DIRECTORY,tj as CYBERSKILL_PACKAGE_NAME,H as CYBERSKILL_STORAGE_DIRECTORY,el as C_Collection,es as C_Db,ei as C_Document,ec as C_Model,t$ as ESLINT_CLI,rs as ESLINT_INSPECT_CLI,rn as ESLINT_INSPECT_PACKAGE_NAME,tz as ESLINT_PACKAGE_NAME,eK as E_CommandType,j as E_ConfigType,ey as E_IssueType,t7 as GIT_CLI,tV as GIT_COMMIT_EDITMSG,tY as GIT_HOOK,tK as GIT_IGNORE,n7 as GRAPHQL_URI_DEFAULT,rl as HOOK,rx as IS_BROWSER,t3 as LINT_STAGED_CLI,t4 as LINT_STAGED_PACKAGE_NAME,sd as Loading,sp as LoadingContext,sS as LoadingProvider,rc as MIGRATE_MONGO_CLI,ra as MIGRATE_MONGO_PACKAGE_NAME,X as MONGO_MIGRATE_OPTIONS,eU as MongoController,eq as MongooseController,sO as NEXT_INTL_DEFAULT_LANGUAGE,tG as NODE_MODULES,ri as NODE_MODULES_INSPECT_CLI,ro as NODE_MODULES_INSPECT_PACKAGE_NAME,sI as NextIntlContext,sH as NextIntlProvider,tU as PACKAGE_JSON,tF as PACKAGE_LOCK_JSON,ru as PATH,tZ as PLAYWRIGHT_PACKAGE_NAME,t9 as PNPM_CLI,re as PNPM_EXEC_CLI,tB as PNPM_LOCK_YAML,eE as RESPONSE_STATUS,np as Router,rt as SIMPLE_GIT_HOOKS_PACKAGE_NAME,rr as SIMPLE_GIT_HOOK_CLI,tH as SIMPLE_GIT_HOOK_JSON,tq as TSCONFIG_JSON,t8 as TSC_CLI,t5 as TSC_PACKAGE_NAME,t6 as TSX_CLI,n6 as Toaster,t0 as VITEST_CLI,tX as VITEST_PACKAGE_NAME,tP as WORKING_DIRECTORY,em as aggregatePaginate,eZ as appendFileSync,tr as checkPackage,tg as clearAllErrorLists,rm as command,P as commitlintConfig,e6 as copySync,e0 as copySyncE,rG as createApolloServer,ny as createCors,nS as createExpress,rw as createGraphqlCodegenConfig,nC as createWSServer,rh as deepMerge,rS as eslintConfig,e5 as existsSync,nv as express,rL as expressMiddleware,tC as formatCommand,eP as generateShortId,eM as generateSlug,$ as getEnv,te as getLatestPackageVersion,e9 as getPackage,tp as getStoredErrorLists,nI as initGraphQLWS,sa as initI18next,ts as installDependencies,rv as isJson,rE as isPlainObject,tL as join,rN as lintStagedConfig,n5 as log,eb as logNodeJS,rA as mergeConfigs,eG as mongo,eg as mongoosePaginate,eX as pathExistsSync,t_ as rawCommand,ez as readFileSync,e4 as readJsonSync,sW as regexSearchMapper,sQ as removeAccent,e8 as removeSync,e1 as removeSyncE,tD as resolve,tI as resolveCommands,tx as resolveWorkingPath,tb as runCommand,sG as serializer,n1 as setGlobalApolloErrorCallback,ti as setupPackages,n2 as showGlobalApolloError,e2 as statSync,sU as storage,eN as storageNodeJS,eI as throwError,n8 as toast,nJ as useApolloError,sg as useLoading,sw as useNextIntl,sF as useStorage,ss as useTranslateI18next,sN as useTranslateNextIntl,ej as validate,F as vitestE2E,rg as vitestUnit,sx as withNextIntl,e$ as writeFileSync,e3 as writeJsonSync};
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,r,n,s,o,i){try{var a=e[o](i);var c=a.value}catch(e){r(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(n,s)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,c,"next",e)}function c(e){s(i,n,o,a,c,"throw",e)}a(undefined)})}}function i(e,t,r){t=d(t);return I(e,N()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function u(e,t,r){if(t)c(e.prototype,t);if(r)c(e,r);return e}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}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)C(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 g(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var s=true;var o=false;var i,a;try{for(r=r.call(e);!(s=(i=r.next()).done);s=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;a=e}finally{try{if(!s&&r["return"]!=null)r["return"]()}finally{if(o)throw a}}return n}function v(){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 E(){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 r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function O(e,t){if(e==null)return{};var r=_(e,t);var n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++){n=o[s];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function _(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var s,o;for(o=0;o<n.length;o++){s=n[o];if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}function I(e,t){if(t&&(A(t)==="object"||typeof t==="function")){return t}return n(e)}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function R(e,r){return t(e)||g(e,r)||b(e,r)||v()}function T(e){return r(e)||m(e)||b(e)||E()}function A(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function b(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}function w(e,t){var r,n,s,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=a(0),i["throw"]=a(1),i["return"]=a(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(o=0)),o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var x=Object.defineProperty;var D=function(e,t,r){return t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var G=function(e,t){return x(e,"name",{value:t,configurable:!0})};var L=function(e,t,r){return D(e,(typeof t==="undefined"?"undefined":A(t))!="symbol"?t+"":t,r)};var M={extends:["@commitlint/config-conventional"]};var j=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 P from"@antfu/eslint-config";import k from"@vitejs/plugin-react-swc";import{defineConfig as U}from"vitest/config";function F(e){return U(h({plugins:[k()],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 K}from"vitest/config";var B=".cyberskill-storage";import H from"dotenv";import{bool as Y,cleanEnv as V,str as Q}from"envalid";import W from"node:os";import J from"node:path";import z from"node:process";H.config();function $(){var e={DEBUG:z.env.DEBUG||!1,CWD:z.env.CWD||z.cwd(),CYBERSKILL_STORAGE_DIRECTORY:z.env.CYBERSKILL_STORAGE_DIRECTORY||J.join(W.homedir(),B)};return V(e,{DEBUG:Y(),CWD:Q(),CYBERSKILL_STORAGE_DIRECTORY:Q()})}G($,"getEnv");var X=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as Z}from"node:child_process";import ee from"node:process";import*as et from"node:util";var er=function(e){return e.Error="error",e.Warning="warning",e}({});import en from"chalk";import es from"consola";import{GraphQLError as eo}from"graphql";var ei={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 ea=$();function ec(e){var t=e.message,r=e.status,n=r===void 0?ei.INTERNAL_SERVER_ERROR:r,s=e.type,o=s===void 0?"graphql":s;var i;var a=(i=t!==null&&t!==void 0?t:n.MESSAGE)!==null&&i!==void 0?i:"Internal server error";throw o==="graphql"?new eo(a,{extensions:{code:n.CODE}}):new Error(a)}G(ec,"throwError");ea.DEBUG||(es.level=4);function eu(e){var t=en[e];return typeof t=="function"?t:en.green}G(eu,"chalkKeyword");var el={silent:es.silent,level:es.level,fatal:es.fatal,error:es.error,warn:es.warn,log:es.log,info:es.info,success:es.success,ready:es.ready,start:es.start,box:es.box,debug:es.debug,trace:es.trace,verbose:es.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){es.box(en.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,s=e.rule,o=e.message;es.log("".concat(en.gray("File:")," ").concat(en.blue("".concat(t).concat(n?":".concat(n):"")))),s&&es.log(" ".concat(eu(r)("Rule:")," ").concat(s)),es.log(" ".concat(eu(r)("Message:")," ").concat(o))}),es.box(eu(r)("".concat(e," : ").concat(t.length))),es.log(en.gray("─".repeat(40)))}};var ed={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import ef from"node-fetch";import ep from"fs-extra";import{extname as em}from"node:path";var eg=ep.readFileSync,ev=ep.writeFileSync,eE=ep.pathExistsSync,eh=ep.appendFileSync,ey=ep.copySync,eS=ep.removeSync,eO=ep.statSync,e_=ep.readJsonSync,eI=ep.writeJsonSync;function eC(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return eE(e)})}G(eC,"existsSync");function eR(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}t.forEach(function(e){eE(e)&&eS(e)})}G(eR,"removeSync");function eT(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.extensions,s=O(r,["extensions"]);ey(e,t,h({filter:G(function(e){return eO(e).isDirectory()||!n||n.length===0?!0:n.includes(em(e))},"filter")},s))}G(eT,"copySync");var eA=$();function eb(e){var t=tn(eA.CWD,tu);if(!eC(t))return!1;try{var r=e_(t),n=r.name,s=r.dependencies,o=s===void 0?{}:s,i=r.devDependencies,a=i===void 0?{}:i,c=n===e,u=e in o,l=e in a;return c||u||l?{path:t,file:r,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return el.warn("Failed to read package.json: ".concat(e.message)),!1}}G(eb,"getPackage");function eN(e){return ew.apply(this,arguments)}function ew(){ew=o(function(e){var t,r,n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,ef("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=o.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=o.sent(),n=r.version;return[2,n];case 3:s=o.sent();throw el.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return ew.apply(this,arguments)}G(eN,"getLatestPackageVersion");function ex(e,t){return eD.apply(this,arguments)}function eD(){eD=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f,p,m,g,v,E,y,S,O,_,I;return w(this,function(C){switch(C.label){case 0:C.trys.push([0,4,,5]);r=eb(e);if(!r)return[2,h({},ed)];c=r.path,u=r.file,l=r.isCurrentProject,d=r.isDepend,f=r.isDevDepend,p=(n=u.dependencies)!==null&&n!==void 0?n:{},m=(s=u.devDependencies)!==null&&s!==void 0?s:{},g=l?(o=u.version)!==null&&o!==void 0?o:"0.0.0":d?(i=p[e])!==null&&i!==void 0?i:"0.0.0":f?(a=m[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!l)return[3,1];y=g;return[3,3];case 1:return[4,eN(e)];case 2:y=C.sent();C.label=3;case 3:v=y,E=l||g===v;if(!E&&(t===null||t===void 0?void 0:t.update)){;O=d?"dependencies":f?"devDependencies":null;O&&((S=u[O])===null||S===void 0?void 0:S[e])!==v&&(u[O]=(_=u[O])!==null&&_!==void 0?_:{},u[O][e]=v,eI(c,u),el.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:l,installedPath:c,file:u,isUpToDate:E}];case 4:I=C.sent();return[2,(el.error('Error checking package "'.concat(e,'": ').concat(I.message)),h({},ed))];case 5:return[2]}})});return eD.apply(this,arguments)}G(ex,"checkPackage");function eG(){return eL.apply(this,arguments)}function eL(){eL=o(function(){var e,t,r,n,s,o,i,a,c,u,l,d;return w(this,function(f){switch(f.label){case 0:e=[{command:G(function(){return tJ.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:G(function(){return tJ.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:G(function(){return tJ.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(o=s.next()).done))return[3,8];i=o.value,a=i.command,c=i.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,e8("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();el.warn("Installation attempt failed: ".concat(c)),el.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();r=true;n=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return eL.apply(this,arguments)}G(eG,"installDependencies");function eM(e,t){return ej.apply(this,arguments)}function ej(){ej=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f;return w(this,function(p){switch(p.label){case 0:if(!eC(tH.PACKAGE_JSON)){el.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,13,,14]);r=T(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return ex(e,h({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=p.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,eG()];case 3:n=p.sent();p.label=4;case 4:n;o=true,i=false,a=undefined;p.label=5;case 5:p.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();p.label=6;case 6:if(!!(o=(u=c.next()).done))return[3,9];l=u.value;return[4,l()];case 7:p.sent();p.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=p.sent();i=true;a=d;return[3,12];case 11:try{if(!o&&c.return!=null){c.return()}}finally{if(i){throw a}}return[7];case 12:return[3,14];case 13:f=p.sent();throw el.error('Failed to setup "'.concat(e.join(", "),'": ').concat(f.message)),f;case 14:return[2]}})});return ej.apply(this,arguments)}G(eM,"setupPackages");import eP from"node-persist";var ek=$();function eU(){return eF.apply(this,arguments)}function eF(){eF=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=eP.defaultInstance;if(e)return[3,2];return[4,eP.init({dir:ek.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return eF.apply(this,arguments)}G(eU,"initNodePersist");var eq={get:function e(e){return o(function(){var t,r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eU()];case 1:n.sent();return[4,eP.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(el.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eU()];case 1:n.sent();return[4,eP.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();el.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eU()];case 1:r.sent();return[4,eP.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();el.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eU()];case 1:r.sent();return[4,eP.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(el.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(el.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return w(this,function(t){try{return[2,"".concat(ek.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(el.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eK=$(),eB=et.promisify(Z);function eH(e){return"error_list:".concat(e)}G(eH,"getErrorListKey");function eY(e){return eV.apply(this,arguments)}function eV(){eV=o(function(e){var t,r,n;return w(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),r=eH(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,eq.set(r,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,eq.getLogLink(r)];case 1:e=t.sent();e&&el.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=s.sent();el.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return eV.apply(this,arguments)}G(eY,"saveErrorListToStorage");function eQ(){return eW.apply(this,arguments)}function eW(){eW=o(function(){var e,t,r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eq.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=o(function(e){var t;return w(this,function(r){switch(r.label){case 0:return[4,eq.get(e)];case 1:return[2,((t=r.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,n.sent().flat()];case 3:r=n.sent();return[2,(el.error("Failed to retrieve stored errors: ".concat(r.message)),[])];case 4:return[2]}})});return eW.apply(this,arguments)}G(eQ,"getStoredErrorLists");function eJ(){return ez.apply(this,arguments)}function ez(){ez=o(function(){var e,t,r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eq.keys()];case 1:e=n.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:n.sent();return[3,4];case 3:r=n.sent();el.error("Failed to clear error lists: ".concat(r.message));return[3,4];case 4:return[2]}})});return ez.apply(this,arguments)}G(eJ,"clearAllErrorLists");function e$(e){var t=[],r=[],n="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,i=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=o.exec(e)||[],m=i.exec(e)||[];var g,v,E,h,y,S;f.length&&n?t.push({file:n,position:"".concat(f[1],":").concat(f[2]),type:f[3]===er.Error?er.Error:er.Warning,message:(g=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&g!==void 0?g:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(E=p===null||p===void 0?void 0:p[1])!==null&&E!==void 0?E:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===er.Error?er.Error:er.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:er.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:""}):r.push(e.trim())}}),t.length&&eY(t),eK.DEBUG&&r.length&&(el.warn("Unmatched lines:"),r.forEach(function(e){return el.info(" ".concat(e))}))}G(e$,"parseTextErrors");function eX(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,s=e.line,o=e.column,i=e.ruleId,a=e.message;r.push({type:n===2?er.Error:er.Warning,file:t,position:"".concat(s,":").concat(o),rule:i,message:a})})}),r.length&&eY(r)}catch(t){e$(e)}}G(eX,"parseCommandOutput");function eZ(e){return e0.apply(this,arguments)}function e0(){e0=o(function(e){var t,r,n,s,o,i,a,c,u;var l=arguments;return w(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eX;r=new AbortController;ee.on("SIGINT",function(){el.warn("Process interrupted. Terminating..."),r.abort(),ee.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,eB(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=d.sent(),s=n.stdout,o=n.stderr;[s,o].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:i=d.sent();a=i.stdout,c=i.stderr,u=i.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&el.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return e0.apply(this,arguments)}G(eZ,"executeCommand");function e1(e){return{raw:!0,cmd:e}}G(e1,"rawCommand");function e2(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(tM," ").concat(ti," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tM," ").concat(tD," ").concat(tS," ").concat(e):"".concat(tM," ").concat(ty," ").concat(e)}G(e2,"formatCLI");function e4(e,t){return typeof e=="function"?e2(e(t),t):(typeof e==="undefined"?"undefined":A(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?e2(e,t):e}G(e4,"formatCommand");function e3(e){return e5.apply(this,arguments)}function e5(){e5=o(function(e){var t,r,n,s,o,i,a;var c=arguments;return w(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};n=(r=t===null||t===void 0?void 0:t.isRemote)!==null&&r!==void 0?r:!1;if(!n)return[3,1];a=!1;return[3,3];case 1:return[4,ex(ti)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,o={isRemote:n,isCurrentProject:s},i=typeof e=="function"?e(o):e;return[2,Object.fromEntries(Object.entries(i).map(function(e){var t=R(e,2),r=t[0],n=t[1];return[r,e4(n,o)]}))]}})});return e5.apply(this,arguments)}G(e3,"resolveCommands");function e8(e,t){return e6.apply(this,arguments)}function e6(){e6=o(function(e,t){var r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);el.start("".concat(e)),eK.DEBUG&&el.info("→ ".concat(t));return[4,eZ(t)];case 1:n.sent(),el.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw el.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return e6.apply(this,arguments)}G(e8,"runCommand");import{join as e7,resolve as e9}from"node:path";var te=$();function tt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return e9.apply(void 0,[te.CWD].concat(T(t)))}G(tt,"resolveWorkingPath");function tr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return e9.apply(void 0,T(t))}G(tr,"resolve");function tn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return e7.apply(void 0,T(t))}G(tn,"join");var ts=$(),to=ts.CWD,ti="@cyberskill/shared",ta="node_modules",tc="dist",tu="package.json",tl="package-lock.json",td="tsconfig.json",tf=".gitignore",tp=".simple-git-hooks.json",tm="pnpm-lock.yaml",tg=".git/hooks/",tv=".git/COMMIT_EDITMSG",tE=".migrate-mongo.config.js",th=tn(to,ta,ti,tc),ty="cyberskill",tS="src/nodejs/cli/index.ts",tO="eslint",t_="eslint",tI="vitest",tC="playwright",tR="vitest",tT="@commitlint/cli",tA="commitlint",tb="lint-staged",tN="lint-staged",tw="typescript",tx="tsc",tD="tsx",tG="git",tL="pnpm",tM="pnpm exec",tj="simple-git-hooks",tP="simple-git-hooks",tk="@eslint/config-inspector",tU="eslint-config-inspector",tF="node-modules-inspector",tq="node-modules-inspector",tK="migrate-mongo",tB="./node_modules/migrate-mongo/bin/migrate-mongo",tH={CYBERSKILL_DIRECTORY:th,WORKING_DIRECTORY:to,TS_CONFIG:tt(td),GIT_IGNORE:tt(tf),GIT_HOOK:tt(tg),GIT_COMMIT_MSG:tt(tv),SIMPLE_GIT_HOOKS_JSON:tt(tp),PACKAGE_JSON:tt(tu),PACKAGE_LOCK_JSON:tt(tl),PNPM_LOCK_YAML:tt(tm),NODE_MODULES:tt(ta),MIGRATE_MONGO_CONFIG:tt(tE),LINT_STAGED_CONFIG:tt("".concat(th,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:tt("".concat(th,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:tt("".concat(th,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:tt("".concat(th,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:tt("".concat(th,"/react/vitest/vitest.e2e.js"))};function tY(e){var t=e.isCurrentProject;return h({"pre-commit":tN,"commit-msg":tA},t&&{"pre-push":e1("".concat(tG," pull"))})}G(tY,"createGitHooksConfig");function tV(e,t,r){return tQ.apply(this,arguments)}function tQ(){tQ=o(function(e,t,r){return w(this,function(n){switch(n.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case X.CLI:return[3,1];case X.STRING:return[3,3]}return[3,4];case 1:return[4,eM(t.split(" "),{update:!0})];case 2:return[2,(n.sent(),e4(e1("".concat(tM," ").concat(r))))];case 3:return[2,e4(e1(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tQ.apply(this,arguments)}G(tV,"buildCommand");function tW(e,t,r){return /*#__PURE__*/o(function(){return w(this,function(n){return[2,tV(e,t,r)]})})}G(tW,"commandFactory");var tJ={simpleGitHooks:tW(X.CLI,tj,tP),eslintInspect:tW(X.CLI,tk,tU),nodeModulesInspect:tW(X.CLI,tF,tq),eslintCheck:tW(X.CLI,tO,"".concat(t_," ").concat(tH.WORKING_DIRECTORY)),eslintFix:tW(X.CLI,tO,"".concat(t_," ").concat(tH.WORKING_DIRECTORY," --fix")),typescriptCheck:tW(X.CLI,tw,"".concat(tx," -p ").concat(tH.TS_CONFIG," --noEmit")),configureGitHook:tW(X.STRING,"".concat(tG," config core.hooksPath ").concat(tH.GIT_HOOK)),testUnit:tW(X.CLI,tI,"".concat(tR," --config ").concat(tH.UNIT_TEST_CONFIG)),testE2e:tW(X.CLI,"".concat(tI," ").concat(tC),"".concat(tR," --config ").concat(tH.E2E_TEST_CONFIG)),mongoMigrateCreate:G(function(e){return tW(X.CLI,tK,"".concat(tD," ").concat(tB," create ").concat(e," -f ").concat(tH.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:tW(X.CLI,tK,"".concat(tD," ").concat(tB," up -f ").concat(tH.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:tW(X.CLI,tK,"".concat(tD," ").concat(tB," down -f ").concat(tH.MIGRATE_MONGO_CONFIG)),mongoMigrateStatus:tW(X.CLI,tK,"".concat(tD," ").concat(tB," status -f ").concat(tH.MIGRATE_MONGO_CONFIG)),commitLint:tW(X.CLI,tT,"".concat(tA," --edit ").concat(tH.GIT_COMMIT_MSG," --config ").concat(tH.COMMITLINT_CONFIG)),lintStaged:tW(X.CLI,tb,"".concat(tN," --config ").concat(tH.LINT_STAGED_CONFIG)),stageBuildDirectory:tW(X.STRING,"".concat(tG," add ").concat(tc)),build:tW(X.STRING,"".concat(tL," run build")),pnpmInstallStandard:tW(X.STRING,"".concat(tL," install")),pnpmInstallLegacy:tW(X.STRING,"".concat(tL," install --legacy-peer-deps")),pnpmInstallForce:tW(X.STRING,"".concat(tL," install --force"))};function tz(e){return K(h({plugins:[q()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tH.UNIT_TEST_SETUP_CONFIG]}},e))}G(tz,"vitestUnit");function t$(e){try{return JSON.parse(e),!0}catch(e){return!1}}G(t$,"isJson");function tX(e){return!!e&&(typeof e==="undefined"?"undefined":A(e))=="object"&&!Array.isArray(e)}G(tX,"isPlainObject");function tZ(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=R(i.value,2),c=a[0],u=a[1];var l=e[c];Array.isArray(u)?e[c]=Array.from(new Set(T(Array.isArray(l)?l:[]).concat(T(u)))):tX(u)?e[c]=tZ(tX(l)?l:{},u):e[c]=u}}catch(e){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e},{})}G(tZ,"deepMerge");import*as t0 from"globals";var t1=[{languageOptions:{globals:h({},t0.node,t0.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var t2;var t4=G(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tZ.apply(void 0,T(t))},"passThroughHandler"),t3=G(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tZ.apply(void 0,[t1].concat(T(t))),s=n.ignores,o=O(n,["ignores"]),i=Array.isArray(s)&&s.every(function(e){return typeof e=="string"})?{ignores:s}:void 0,a=[o].concat(T(i?[i]:[]));return P.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(T(a)))},"handleESLint"),t5=G(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return F.apply(void 0,T(t))},"handleVitestReactE2E"),t8=G(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tz.apply(void 0,T(t))},"handleVitestReactUnit"),t6=(t2={},l(t2,j.ESLINT,t3),l(t2,j.COMMITLINT,t4),l(t2,j.LINT_STAGED,t4),l(t2,j.VITEST_REACT_E2E,t5),l(t2,j.VITEST_REACT_UNIT,t8),t2);function t7(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var s=t6[e];if(!s)throw new Error("Unknown config type: ".concat(e));return s.apply(void 0,T(r))}G(t7,"mergeConfigs");import{defineConfig as t9}from"@eddeee888/gcg-typescript-resolver-files";function re(e){var t=e.uri,r=e.from,n=e.to,s=e.target,o=s===void 0?"client":s;var i=o==="client",a=o==="server";return S(h({schema:t,ignoreNoDocuments:!0,overwrite:!0},i&&{documents:[r]}),{generates:h({},i&&l({},n,{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0}}),a&&l({},n,t9()))})}G(re,"createGraphqlCodegenConfig");var rt={"*":["eslint --fix"]};var rr=(typeof window==="undefined"?"undefined":A(window))<"u";import{ApolloServer as rn}from"@apollo/server";import{expressMiddleware as rs}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as ro}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as ri,ApolloServerPluginLandingPageProductionDefault as ra}from"@apollo/server/plugin/landingPage/default";function rc(e){return new rn(h({schema:e.schema,plugins:[e.isDev?ri():ra(),ro({httpServer:e.server})].concat(T(e.drainServer?[{serverWillStart:function t(){return o(function(){return w(this,function(t){return[2,{drainServer:function t(){return o(function(){var t;return w(this,function(r){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),el.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}G(rc,"createApolloServer");import ru from"node:process";import{hideBin as rl}from"yargs/helpers";import rd from"yargs/yargs";var rf={name:"@cyberskill/shared",type:"module",version:"1.102.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.3","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};function rp(){return rm.apply(this,arguments)}function rm(){rm=o(function(){var e,t;return w(this,function(r){switch(r.label){case 0:if(!eC(tH.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tJ.typescriptCheck()];case 1:return[4,e8.apply(void 0,t.concat([r.sent()]))];case 2:e=r.sent();return[3,4];case 3:e=el.warn("No TypeScript configuration found. Skipping type check.");r.label=4;case 4:e;return[2]}})});return rm.apply(this,arguments)}G(rp,"checkTypescript");function rg(){return rv.apply(this,arguments)}function rv(){rv=o(function(){var e,t,r,n;var s=arguments;return w(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];r=["Running ESLint with auto-fix"];return[4,tJ.eslintFix()];case 1:return[4,e8.apply(void 0,r.concat([o.sent()]))];case 2:t=o.sent();return[3,6];case 3:n=["Running ESLint check"];return[4,tJ.eslintCheck()];case 4:return[4,e8.apply(void 0,n.concat([o.sent()]))];case 5:t=o.sent();o.label=6;case 6:t;return[2]}})});return rv.apply(this,arguments)}G(rg,"checkEslint");function rE(e,t){if(!t.length)return;var r=e==="Errors"?"red":"yellow";el.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,r)}G(rE,"printIssues");function rh(){return ry.apply(this,arguments)}function ry(){ry=o(function(){var e,t,r;return w(this,function(n){switch(n.label){case 0:return[4,eQ()];case 1:e=n.sent(),t=e.filter(function(e){return e.type===er.Error}),r=e.filter(function(e){return e.type===er.Warning});!t.length&&!r.length?el.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(rE("Warnings",r),rE("Errors",t),(t.length>0||r.length>0)&&ru.exit(1));return[2]}})});return ry.apply(this,arguments)}G(rh,"showCheckResult");function rS(){return rO.apply(this,arguments)}function rO(){rO=o(function(){var e,t,r,n,s,o;return w(this,function(i){switch(i.label){case 0:return[4,eJ()];case 1:i.sent();return[4,ex(ti)];case 2:e=i.sent(),t=e.isCurrentProject;if(!t)return[3,9];i.label=3;case 3:i.trys.push([3,8,,9]);r=["Building package: ".concat(ti)];return[4,tJ.build()];case 4:return[4,e8.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();n=["Staging build artifacts"];return[4,tJ.stageBuildDirectory()];case 6:return[4,e8.apply(void 0,n.concat([i.sent()]))];case 7:i.sent();return[3,9];case 8:s=i.sent();throw el.error("Error building and staging ".concat(ti,": ").concat(s.message)),s;case 9:o=["Executing lint-staged"];return[4,tJ.lintStaged()];case 10:return[4,e8.apply(void 0,o.concat([i.sent()]))];case 11:i.sent(),rh();return[2]}})});return rO.apply(this,arguments)}G(rS,"lintStaged");function r_(){return rI.apply(this,arguments)}function rI(){rI=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tJ.eslintInspect()];case 1:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rI.apply(this,arguments)}G(r_,"inspectLint");function rC(){return rR.apply(this,arguments)}function rR(){rR=o(function(){return w(this,function(e){switch(e.label){case 0:return[4,eJ()];case 1:e.sent();return[4,Promise.all([rp(),rg()])];case 2:e.sent(),rh();return[2]}})});return rR.apply(this,arguments)}G(rC,"lintCheck");function rT(){return rA.apply(this,arguments)}function rA(){rA=o(function(){return w(this,function(e){switch(e.label){case 0:return[4,eJ()];case 1:e.sent();return[4,Promise.all([rp(),rg(!0)])];case 2:e.sent(),rh();return[2]}})});return rA.apply(this,arguments)}G(rT,"lintFix");function rb(){return rN.apply(this,arguments)}function rN(){rN=o(function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,eJ()];case 1:t.sent();e=["Validating commit message"];return[4,tJ.commitLint()];case 2:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),rh();return[2]}})});return rN.apply(this,arguments)}G(rb,"commitLint");function rw(){return rx.apply(this,arguments)}function rx(){rx=o(function(){var e,t,r,n;return w(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tJ.configureGitHook()];case 1:return[4,e8.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eR(tH.GIT_HOOK);return[4,e3(tY)];case 3:t=s.sent();eI(tH.SIMPLE_GIT_HOOKS_JSON,t);r="\n".concat(tp,"\n");eC(tH.GIT_IGNORE)?eg(tH.GIT_IGNORE,"utf-8").split("\n").includes(tp)||eh(tH.GIT_IGNORE,r,"utf-8"):ev(tH.GIT_IGNORE,r,"utf-8");n=["Setting up simple-git-hooks"];return[4,tJ.simpleGitHooks()];case 4:return[4,e8.apply(void 0,n.concat([s.sent()]))];case 5:s.sent();return[2]}})});return rx.apply(this,arguments)}G(rw,"setupGitHook");function rD(){return rG.apply(this,arguments)}function rG(){rG=o(function(){return w(this,function(e){switch(e.label){case 0:return[4,eM([ti],{update:!0,postInstallActions:[rw]})];case 1:e.sent();return[2]}})});return rG.apply(this,arguments)}G(rD,"setup");function rL(){return rM.apply(this,arguments)}function rM(){rM=o(function(){return w(this,function(e){switch(e.label){case 0:eR(tH.NODE_MODULES,tH.PNPM_LOCK_YAML);return[4,eG()];case 1:e.sent();return[4,rw()];case 2:e.sent();return[2]}})});return rM.apply(this,arguments)}G(rL,"reset");function rj(){return rP.apply(this,arguments)}function rP(){rP=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tJ.nodeModulesInspect()];case 1:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rP.apply(this,arguments)}G(rj,"inspect");function rk(){return rU.apply(this,arguments)}function rU(){rU=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tJ.testUnit()];case 1:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rU.apply(this,arguments)}G(rk,"testUnit");function rF(){return rq.apply(this,arguments)}function rq(){rq=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tJ.testE2e()];case 1:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rq.apply(this,arguments)}G(rF,"testE2E");function rK(e){return rB.apply(this,arguments)}function rB(){rB=o(function(e){var t;return w(this,function(r){switch(r.label){case 0:t=["Creating MongoDB migration"];return[4,tJ.mongoMigrateCreate(e)];case 1:return[4,e8.apply(void 0,t.concat([r.sent()]))];case 2:r.sent();return[2]}})});return rB.apply(this,arguments)}G(rK,"mongoMigrateCreate");function rH(){return rY.apply(this,arguments)}function rY(){rY=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tJ.mongoMigrateUp()];case 1:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rY.apply(this,arguments)}G(rH,"mongoMigrateUp");function rV(){return rQ.apply(this,arguments)}function rQ(){rQ=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tJ.mongoMigrateDown()];case 1:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rQ.apply(this,arguments)}G(rV,"mongoMigrateDown");function rW(){return rJ.apply(this,arguments)}function rJ(){rJ=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Checking MongoDB migration status"];return[4,tJ.mongoMigrateStatus()];case 1:return[4,e8.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rJ.apply(this,arguments)}G(rW,"mongoMigrateStatus");o(function(){var e;return w(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,rd(rl(ru.argv)).scriptName(ty).usage("$0 <command> [options]").command("lint","Check code for linting issues",rC).command("lint:fix","Fix linting issues automatically",rT).command("lint:inspect","View active ESLint configuration",r_).command("lint-staged","Run lint checks on staged files",rS).command("commitlint","Validate commit message format",rb).command("setup","Initialize project setup and dependencies",rD).command("reset","Reset the project and reinstall dependencies",rL).command("inspect","Analyze installed project dependencies",rj).command("test:unit","Run unit test suite",rk).command("test:e2e","Run end-to-end test suite",rF).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=o(function(e){return w(this,function(t){switch(t.label){case 0:if(!e.name){el.error("Migration name is required.");return[2]}return[4,rK(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",rH).command("mongo:migrate:down","Rollback last MongoDB migration",rV).command("mongo:migrate:status","Check MongoDB migration status",rW).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(rf.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();el.error("Fatal: ".concat(e.message)),ru.exit(1);return[3,3];case 3:return[2]}})})();import{Router as rz}from"express";import r$ from"compression";import rX from"cors";import rZ from"express";import r0 from"express-device";import r1 from"express-session";function r2(e){return rX({origin:G(function(t,r){var n;e.isDev||((n=e.whiteList)===null||n===void 0?void 0:n.includes(t!==null&&t!==void 0?t:""))?r(null,!0):r(null,!1)},"origin"),credentials:!0})}G(r2,"createCors");function r4(e){var t=rZ();return t.set("trust proxy",1),t.use(rZ.urlencoded({extended:!0})),t.use(r$()),t.use(r0.capture()),e.staticFolder&&t.use(rZ.static(e.staticFolder)),e.sessionOptions&&t.use(r1(e.sessionOptions)),t}G(r4,"createExpress");var r3="MONGO_MIGRATE_OPTIONS";import{Collection as r5,Db as r8}from"mongodb";import{Document as r6,Model as r7}from"mongoose";var r9=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(r8);G(r9,"C_Db");var ne=r9,nt=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(r6);G(nt,"C_Document");var nr=nt,nn=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(r7);G(nn,"C_Model");var ns=nn,no=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(r5);G(no,"C_Collection");var ni=no;import{format as na}from"date-fns";import nc from"migrate-mongo";import{Document as nu}from"mongoose";import nl from"mongoose-aggregate-paginate-v2";import nd from"mongoose-paginate-v2";import{v4 as nf}from"uuid";import np from"crypto-js";import nm from"slugify";var ng=nm.default||nm;function nv(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;var r=t||{},n=r.lower,s=n===void 0?!0:n,o=r.locale,i=o===void 0?"vi":o,a=O(r,["lower","locale"]);return ng(e,h({lower:s,locale:i},a))}G(nv,"generateSlug");function nE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return np.SHA256(e).toString(np.enc.Hex).slice(0,t)}G(nE,"generateShortId");var nh={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":A(e))=="object"?p(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var ny={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return na(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,r=t===void 0?"string":t;var n=r==="string"?ny.getDateTime():new Date;return{id:nf(),isDel:!1,createdAt:n,updatedAt:n}},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 r=t.method,n=t.pre,s=t.post;r&&n&&e.pre(r,n),r&&s&&e.post(r,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:nf,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,r=e.schema,n=e.virtuals,s=n===void 0?[]:n,o=e.standalone,i=o===void 0?!1:o;var a=new t.Schema(r,{strict:!0});return s.forEach(function(e){var t=e.name,r=e.options,n=e.get;var s=a.virtual(t,r);n&&s.get(n)}),i||a.add(ny.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,r=e.name,n=e.schema,s=e.pagination,o=s===void 0?!1:s,i=e.aggregate,a=i===void 0?!1:i,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!r)throw new Error("Model name is required.");if(t.models[r])return t.models[r];var f=ny.createSchema({mongoose:t,schema:n,virtuals:u});return ny.applyPlugins(f,[o&&nd,a&&nl]),ny.applyMiddlewares(f,d),t.model(r,f)},createSlugQuery:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return S(h({},t,r&&{id:{$ne:r}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=o(function(e){return w(this,function(t){return[2,!nh.isEmpty(e)]})});return function(t){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var t=o(function(t){var r;return w(this,function(n){switch(n.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");r={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.findOne(r)];case 1:return[2,!n.sent()]}})});return function(e){return t.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var t=o(function(t){return w(this,function(r){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)})]})});return function(e){return t.apply(this,arguments)}}()}},migrate:S(h({},nc),{setConfig:G(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));ev(tH.MIGRATE_MONGO_CONFIG,t);var r="\n".concat(tE,"\n");eC(tH.GIT_IGNORE)?eg(tH.GIT_IGNORE,"utf-8").split("\n").includes(tE)||eh(tH.GIT_IGNORE,r,"utf-8"):ev(tH.GIT_IGNORE,r,"utf-8")},"setConfig")})},nS=/*#__PURE__*/function(){"use strict";function e(t,r){a(this,e);L(this,"collection");this.collection=t.collection(r)}u(e,[{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=h({},ny.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,t.collection.insertOne(r)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=this;return o(function(){var r,n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=e.map(function(e){return h({},ny.createGenericFields(),e)});return[4,t.collection.insertMany(r)];case 1:n=o.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.findOne(e)];case 1:r=s.sent();return[2,r?{success:!0,message:"Document found",result:r}:{success:!1,message:"Document not found"}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Documents retrieved successfully"};return[4,t.collection.find(e).toArray()];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Count retrieved successfully"};return[4,t.collection.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,t){var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateOne(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,t){var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateMany(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteOne(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteMany(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}}]);return e}();G(nS,"MongoController");var nO=nS,n_=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);L(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return w(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.findOne(e,t,r);n&&o.populate(n);return[4,o.exec()];case 1:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:ei.NOT_FOUND.CODE}];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return w(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.find(e,t,r);n&&o.populate(n);i={success:!0};return[4,o.exec()];case 1:return[2,(i.result=c.sent(),i)];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.paginate(e,t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.aggregatePaginate(r.model.aggregate(e),t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.create(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.insertMany(e,t)];case 1:return[2,(n.result=o.sent().map(function(e){return p(e,nu)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return w(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.findOneAndUpdate(e,t,h({new:!0},r)).exec()];case 1:s=i.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(n.getModelName(),"."),code:ei.NOT_FOUND.CODE}];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return w(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);s={success:!0};return[4,n.model.updateMany(e,t,r).exec()];case 1:return[2,(s.result=i.sent(),s)];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.findOneAndDelete(e,t).exec()];case 1:n=o.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(r.getModelName()," found to delete."),code:ei.NOT_FOUND.CODE}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.deleteMany(e,t).exec()];case 1:n=o.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:ei.NOT_FOUND.CODE}:{success:!0,result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var r=this;return o(function(){var n,s,o,i;return w(this,function(a){switch(a.label){case 0:n=new Set;s=0;a.label=1;case 1:if(!(s<10))return[3,5];o=nE(e,s+t);i=!n.has(o);if(!i)return[3,3];n.add(o);return[4,r.model.exists({shortId:o})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:o}];a.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:ei.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,i,a,c,u,l,d,f,p,m,g;return w(this,function(v){switch(v.label){case 0:v.trys.push([0,8,,9]);s=t[e],i=G(/*#__PURE__*/function(){var e=o(function(e){var s,o,i;return w(this,function(a){switch(a.label){case 0:return[4,n.model.findOne(ny.createSlugQuery(e,r,t.id))];case 1:s=a.sent();if(!s)return[2,e];o=1;a.label=2;case 2:i="".concat(e,"-").concat(o);return[4,n.model.findOne(ny.createSlugQuery(i,r,t.id))];case 3:s=a.sent(),o++;a.label=4;case 4:if(s)return[3,2];a.label=5;case 5:return[2,i]}})});return function(t){return e.apply(this,arguments)}}(),"createUniqueSlug");if(!((typeof s==="undefined"?"undefined":A(s))=="object"))return[3,5];a={};c=[];for(u in s)c.push(u);l=0;v.label=1;case 1:if(!(l<c.length))return[3,4];d=c[l];f=nv(s[d]);return[4,i(f)];case 2:a[d]=v.sent();v.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:a}];case 5:p=nv(s);m={success:!0};return[4,i(p)];case 6:return[2,(m.result=v.sent(),m)];case 7:return[3,9];case 8:g=v.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(g.message),code:ei.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.aggregate(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ei.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();G(n_,"MongooseController");var nI=n_;import{useServer as nC}from"graphql-ws/use/ws";import{WebSocketServer as nR}from"ws";function nT(e){return new nR({server:e.server,path:e.path})}G(nT,"createWSServer");function nA(e){return nC({schema:e.schema},e.server)}G(nA,"initGraphQLWS");import{ApolloClient as nb,ApolloError as nN,ApolloLink as nw,ApolloProvider as nx,from as nD,HttpLink as nG,InMemoryCache as nL,split as nM}from"@apollo/client";import{onError as nj}from"@apollo/client/link/error";import{removeTypenameFromVariables as nP}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as nk}from"@apollo/client/link/subscriptions";import{getMainDefinition as nU}from"@apollo/client/utilities";import{createClient as nF}from"graphql-ws";import nq,{useMemo as nK}from"react";import{FaInfo as nB}from"react-icons/fa6";import nH,{use as nY}from"react";import{FaRepeat as nV}from"react-icons/fa6";import{createContext as nQ}from"react";var nW=nQ(void 0);import nJ from"./react/apollo-error/apollo-error.module.scss";function nz(){var e=nY(nW),t=e===null||e===void 0?void 0:e.error;if(!t)return null;var r=G(function(e,t){return(t===null||t===void 0?void 0:t.length)?nH.createElement("div",null,nH.createElement("strong",null,e,":"),nH.createElement("ul",null,t.map(function(e){return nH.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return nH.createElement("div",{className:nJ["modal-backdrop"]},nH.createElement("div",{className:nJ["modal-content"]},nH.createElement("button",{type:"button",className:nJ["btn-close"],onClick:e.hideError},"✕"),nH.createElement("div",{className:nJ["error-title"]},nH.createElement("button",{type:"button",className:nJ["btn-retry"],onClick:G(function(){return window.location.reload()},"onClick")},nH.createElement(nV,null))," ",t.message),nH.createElement("div",{className:nJ["error-details"]},t.networkError&&nH.createElement("pre",{className:"network"},nH.createElement("strong",null,"Network Error:")," ",t.networkError.message),r("GraphQL Errors",T(t.graphQLErrors)),r("Protocol Errors",T(t.protocolErrors)),r("Client Errors",T(t.clientErrors)),t.extraInfo&&nH.createElement("pre",{className:"extra"},nH.createElement("strong",null,"Extra Info:")," ",JSON.stringify(t.extraInfo,null,4)))))}G(nz,"ApolloError");import{use as n$}from"react";function nX(){var e=n$(nW);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}G(nX,"useApolloError");import nZ,{useEffect as n0,useMemo as n1,useState as n2}from"react";var n4=null;function n3(e){n4=e}G(n3,"setGlobalApolloErrorCallback");function n5(e){n4===null||n4===void 0?void 0:n4(e)}G(n5,"showGlobalApolloError");function n8(e){var t=e.children;var r=R(n2(null),2),n=r[0],s=r[1];n0(function(){n3(s)},[]);var o=n1(function(){return{error:n,showError:s,hideError:G(function(){return s(null)},"hideError")}},[n]);return nZ.createElement(nW,{value:o},t)}G(n8,"ApolloErrorProvider");import{consola as n6}from"consola/browser";var n7={silent:n6.silent,level:n6.level,fatal:n6.fatal,error:n6.error,warn:n6.warn,log:n6.log,info:n6.info,success:n6.success,ready:n6.ready,start:n6.start,box:n6.box,debug:n6.debug,trace:n6.trace,verbose:n6.verbose};import{toast as n9,Toaster as se}from"react-hot-toast";var st="/graphql";var sr,sn=(sr=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);var e;e=i(this,t,arguments);L(e,"count",0);return e}u(t,[{key:"request",value:function e(e,t){var r=this;var n=Date.now();return this.count+=1,t(e).map(function(t){var s=Date.now()-n,o=e.operationName||"Unnamed";return n7.info("[Apollo] #".concat(r.count,": ").concat(o," (").concat(s,"ms)")),t})}}]);return t}(nw),G(sr,"DevLoggerLink"),sr);function ss(e){var t=e.uri,r=e.wsUrl,n=e.customLinks,s=new sn,o=nj(function(e){var t=e.graphQLErrors,r=e.networkError,n=e.protocolErrors,s=e.operation;var o=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(t&&t.forEach(function(e){var t=e.message,r=e.locations,n=e.path;n7.error("[GraphQL error] ".concat(o,": ").concat(t,", Location: ").concat(JSON.stringify(r),", Path: ").concat(n))}),n&&n.forEach(function(e){var t=e.message,r=e.extensions;n7.error("[Protocol error]: ".concat(t,", Extensions: ").concat(JSON.stringify(r)))}),r&&n7.error("[Network error]: ".concat(r)),t||n||r){var i,a;var c=(t===null||t===void 0?void 0:(i=t[0])===null||i===void 0?void 0:i.message)||(n===null||n===void 0?void 0:(a=n[0])===null||a===void 0?void 0:a.message)||(r===null||r===void 0?void 0:r.message)||"Unexpected error",u=new nN({graphQLErrors:t||[],protocolErrors:n||[],clientErrors:[],networkError:r||null,errorMessage:c,extraInfo:{operation:s}});n9.error(function(e){return nq.createElement(nq.Fragment,null,c,"\xa0",nq.createElement(nB,{cursor:"pointer",onClick:G(function(){setTimeout(function(){n5(u)},0),n9.dismiss(e.id)},"onClick")}))})}}),i=nP();t||n7.warn('[Apollo] No GraphQL URI provided — using "'.concat(st,'" as default'));var a=new nG({uri:t!==null&&t!==void 0?t:st,credentials:"include"}),c=r?new nk(nF({url:r})):nw.empty(),u=p(c,nw)?nM(function(e){var t=e.query;var r=nU(t);return r.kind==="OperationDefinition"&&r.operation==="subscription"},c,a):a;return u===a&&r&&n7.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[s,o,i].concat(T(n!==null&&n!==void 0?n:[]),[u])}G(ss,"createApolloLinks");function so(e){var t=e.isNextJS,r=e.options,n=e.children,s=e.client,o=e.provider,i=e.cache;var a=r||{},c=a.uri,u=a.wsUrl,l=a.customLinks,d=O(a,["uri","wsUrl","customLinks"]),f=s!==null&&s!==void 0?s:nb;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var m=o||nx,g=nK(function(){return nD(ss({uri:c!==null&&c!==void 0?c:st,wsUrl:u!==null&&u!==void 0?u:"",customLinks:l!==null&&l!==void 0?l:[]}))},[c,u,l]),v=nK(function(){return p(i,nL)?i:new nL},[i]),E=nK(function(){return new f(h({link:g,cache:v},d))},[f,g,v,d]),y=t?nq.createElement(m,{makeClient:G(function(){return E},"makeClient")},n):nq.createElement(m,{client:E},n);return nq.createElement(nq.Fragment,null,nq.createElement(n8,null,y,nq.createElement(nz,null)),nq.createElement(se,{position:"top-right"}))}G(so,"ApolloProvider");import{useTranslation as si}from"react-i18next";var sa=si;import sc from"i18next";import{initReactI18next as su}from"react-i18next";function sl(e){return sc.use(su).init(e)}G(sl,"initI18next");import sd from"classnames";import sf from"react";import sp from"./react/loading/loading.module.scss";function sm(e){var t=e.full,r=t===void 0?!1:t,n=e.block,s=n===void 0?!1:n,o=e.className,i=o===void 0?"":o,a=e.message,c=a===void 0?"Loading":a,u=O(e,["full","block","className","message"]);function l(){return sf.createElement("div",h({className:sp.container},u),sf.createElement("div",{className:sp.ring}),sf.createElement("div",{className:sp.ring}),sf.createElement("div",{className:sp.ring}),sf.createElement("div",{className:sp.ring}),c&&sf.createElement("div",{className:sp.message},c))}return G(l,"_renderLoading"),r?sf.createElement("div",{className:sd(sp.fullscreen,i)},l()):s?sf.createElement("div",{className:sd(sp.block,i)},l()):l()}G(sm,"Loading");import{createContext as sg}from"react";var sv=sg(void 0);import{use as sE}from"react";function sh(){var e=sE(sv);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}G(sh,"useLoading");import sy,{useCallback as sS,useMemo as sO,useState as s_}from"react";function sI(e){var t=e.children;var r=R(s_(!1),2),n=r[0],s=r[1],o=R(s_(!1),2),i=o[0],a=o[1],c=sS(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),a(e)},[]),u=sS(function(){s(!1),a(!1)},[]),l=sO(function(){return{isLoading:n,isGlobalLoading:i,showLoading:c,hideLoading:u}},[n,i,c,u]);return sy.createElement(sv,{value:l},n?sy.createElement(sm,{full:i}):t)}G(sI,"LoadingProvider");import{enUS as sC}from"date-fns/locale";var sR={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:sC,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};import{createContext as sT}from"react";var sA=sT(void 0);import{NextIntlClientProvider as sb}from"next-intl";import sN from"react";import{useTranslations as sw}from"next-intl";import{use as sx}from"react";function sD(){var e=sx(sA);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}G(sD,"useNextIntl");var sG=sw;function sL(e){var t=G(function(t){var r;var n;var s=sD(),o=s.currentLanguage,i=t.messages,a=t.languages,c="en",u=i[(o===null||o===void 0?void 0:o.value)||c],l=(n=(r=a.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||r===void 0?void 0:r.timezone)!==null&&n!==void 0?n:sR.timezone;return i?sN.createElement(sb,{locale:(o===null||o===void 0?void 0:o.value)||c,messages:u||null,timeZone:l},sN.createElement(e,t)):(n7.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||c)),null)},"PageWithI18n");return t.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),t}G(sL,"withNextIntl");import sM,{useMemo as sj}from"react";import{useCallback as sP,useEffect as sk,useState as sU}from"react";var sF={serialize:G(function(e){return JSON.stringify(e,function(e,t){return p(t,Date)?{__type:"Date",value:t.toISOString()}:t})},"serialize"),deserialize:G(function(e){return JSON.parse(e,function(e,t){return(t===null||t===void 0?void 0:t.__type)==="Date"?new Date(t.value):t})},"deserialize")};import sq from"localforage";var sK={get:function e(e){return o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sq.getItem(e)];case 1:return[2,r.sent()];case 2:t=r.sent();return[2,(n7.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 3:return[2]}})})()},set:function e(e,t){return o(function(){var r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sq.setItem(e,t)];case 1:n.sent();return[3,3];case 2:r=n.sent();n7.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},remove:function e(e){return o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sq.removeItem(e)];case 1:r.sent();return[3,3];case 2:t=r.sent();n7.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},keys:function e(){return o(function(){var e,t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sq.keys()];case 1:return[2,(e=r.sent())!==null&&e!==void 0?e:[]];case 2:t=r.sent();return[2,(n7.error("[Storage:keys] Error getting keys:",t),[])];case 3:return[2]}})})()}};function sB(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sF;var n=R(sU(t),2),s=n[0],i=n[1],a=R(sU(!1),2),c=a[0],u=a[1];sk(function(){var n=!0;return G(/*#__PURE__*/o(function(){var s,o,a,c;return w(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,sK.get(e)];case 1:s=l.sent();if(!n)return[3,5];if(!(s!==null))return[3,2];o=r.deserialize(s);i(o);return[3,5];case 2:if(!(t!==void 0))return[3,4];a=r.serialize(t);return[4,sK.set(e,a)];case 3:l.sent(),i(t);return[3,5];case 4:i(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();n7.error('Error loading value for key "'.concat(e,'":'),c),n&&i(t);return[3,8];case 7:n&&u(!0);return[7];case 8:return[2]}})}),"loadValue")(),function(){n=!1,u(!1)}},[e,t,r]),sk(function(){if(!c)return;G(/*#__PURE__*/o(function(){var t,n;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];t=r.serialize(s);return[4,sK.set(e,t)];case 1:o.sent();o.label=2;case 2:return[3,4];case 3:n=o.sent();n7.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})}),"saveValue")()},[s,e,r,c]);var l=sP(function(e){i(function(t){return typeof e=="function"?e(t):e})},[]),d=sP(/*#__PURE__*/o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sK.remove(e)];case 1:r.sent(),i(void 0);return[3,3];case 2:t=r.sent();n7.error('Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})}),[e]);return{value:s,set:l,remove:d}}G(sB,"useStorage");function sH(e){var t=e.children;return sM.createElement(sM.Fragment,null,t)}G(sH,"LanguageWrapperBase");var sY=sL(sH);function sV(e){var t=e.children,r=e.languages,n=e.messages;var s=sB("lang",r[0]),o=s.value,i=s.set,a=sj(function(){return{languages:r,currentLanguage:o!==null&&o!==void 0?o:sR,setCurrentLanguage:i}},[r,i,o]);return sM.createElement(sA,{value:a},sM.createElement(sY,{languages:r,messages:n},t))}G(sV,"NextIntlProvider");import sQ from"unorm";var sW={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},sJ=Object.entries(sW).reduce(function(e,t){var r=R(t,2),n=r[0],s=r[1];return e[n.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function sz(e){e=sQ.nfkc(e);var t=h({},sW,sJ);var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=R(i.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(T(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e}G(sz,"regexSearchMapper");function s$(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}G(s$,"removeAccent");export{nz as ApolloError,nW as ApolloErrorContext,n8 as ApolloErrorProvider,so as ApolloProvider,tc as BUILD_DIRECTORY,ed as CHECK_PACKAGE_EMPTY_RESULT,tA as COMMIT_LINT_CLI,tT as COMMIT_LINT_PACKAGE_NAME,ty as CYBERSKILL_CLI,tS as CYBERSKILL_CLI_PATH,th as CYBERSKILL_DIRECTORY,ti as CYBERSKILL_PACKAGE_NAME,B as CYBERSKILL_STORAGE_DIRECTORY,ni as C_Collection,ne as C_Db,nr as C_Document,ns as C_Model,t_ as ESLINT_CLI,tU as ESLINT_INSPECT_CLI,tk as ESLINT_INSPECT_PACKAGE_NAME,tO as ESLINT_PACKAGE_NAME,X as E_CommandType,j as E_ConfigType,er as E_IssueType,tG as GIT_CLI,tv as GIT_COMMIT_EDITMSG,tg as GIT_HOOK,tf as GIT_IGNORE,st as GRAPHQL_URI_DEFAULT,rr as IS_BROWSER,tN as LINT_STAGED_CLI,tb as LINT_STAGED_PACKAGE_NAME,sm as Loading,sv as LoadingContext,sI as LoadingProvider,tB as MIGRATE_MONGO_CLI,tE as MIGRATE_MONGO_CONFIG,tK as MIGRATE_MONGO_PACKAGE_NAME,r3 as MONGO_MIGRATE_OPTIONS,nO as MongoController,nI as MongooseController,sR as NEXT_INTL_DEFAULT_LANGUAGE,ta as NODE_MODULES,tq as NODE_MODULES_INSPECT_CLI,tF as NODE_MODULES_INSPECT_PACKAGE_NAME,sA as NextIntlContext,sV as NextIntlProvider,tu as PACKAGE_JSON,tl as PACKAGE_LOCK_JSON,tH as PATH,tC as PLAYWRIGHT_PACKAGE_NAME,tL as PNPM_CLI,tM as PNPM_EXEC_CLI,tm as PNPM_LOCK_YAML,ei as RESPONSE_STATUS,rz as Router,tj as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tP as SIMPLE_GIT_HOOK_CLI,tp as SIMPLE_GIT_HOOK_JSON,td as TSCONFIG_JSON,tx as TSC_CLI,tw as TSC_PACKAGE_NAME,tD as TSX_CLI,se as Toaster,tR as VITEST_CLI,tI as VITEST_PACKAGE_NAME,to as WORKING_DIRECTORY,nl as aggregatePaginate,eh as appendFileSync,ex as checkPackage,eJ as clearAllErrorLists,tJ as command,M as commitlintConfig,eT as copySync,ey as copySyncE,rc as createApolloServer,r2 as createCors,r4 as createExpress,tY as createGitHooksConfig,re as createGraphqlCodegenConfig,nT as createWSServer,tZ as deepMerge,t1 as eslintConfig,eC as existsSync,rZ as express,rs as expressMiddleware,e4 as formatCommand,nE as generateShortId,nv as generateSlug,$ as getEnv,eN as getLatestPackageVersion,eb as getPackage,eQ as getStoredErrorLists,nA as initGraphQLWS,sl as initI18next,eG as installDependencies,t$ as isJson,tX as isPlainObject,tn as join,rt as lintStagedConfig,n7 as log,el as logNodeJS,t7 as mergeConfigs,ny as mongo,nd as mongoosePaginate,eE as pathExistsSync,e1 as rawCommand,eg as readFileSync,e_ as readJsonSync,sz as regexSearchMapper,s$ as removeAccent,eR as removeSync,eS as removeSyncE,tr as resolve,e3 as resolveCommands,tt as resolveWorkingPath,e8 as runCommand,sF as serializer,n3 as setGlobalApolloErrorCallback,eM as setupPackages,n5 as showGlobalApolloError,eO as statSync,sK as storage,eq as storageNodeJS,ec as throwError,n9 as toast,nX as useApolloError,sh as useLoading,sD as useNextIntl,sB as useStorage,sa as useTranslateI18next,sG as useTranslateNextIntl,nh as validate,F as vitestE2E,tz as vitestUnit,sL as withNextIntl,ev as writeFileSync,eI as writeJsonSync};
|