@cyberskill/shared 1.189.0 → 1.191.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/node/cli/cli.util.cjs +1 -1
- package/dist/node/cli/cli.util.js +1 -1
- package/dist/node/cli/index.cjs +1 -1
- package/dist/node/cli/index.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.css +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/loading/index.cjs +1 -1
- package/dist/react/loading/index.css +1 -1
- package/dist/react/loading/index.js +1 -1
- package/dist/react/loading/loading.component.cjs +1 -1
- package/dist/react/loading/loading.component.css +1 -1
- package/dist/react/loading/loading.component.js +1 -1
- package/dist/react/loading/loading.provider.cjs +1 -1
- package/dist/react/loading/loading.provider.css +1 -1
- package/dist/react/loading/loading.provider.js +1 -1
- package/package.json +2 -2
package/dist/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return D(e,R()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function p(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)_(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function E(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(){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 y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){l(e,t,n[t])})}return e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{v(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=C(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function C(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function D(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return r(e)}function _(e,t){_=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return _(e,t)}function I(e,n){return t(e)||m(e,n)||A(e,n)||g()}function N(e){return t(e)||E(e)||A(e)||g()}function b(e){return n(e)||E(e)||A(e)||h()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(R=function(){return!!e})()}function x(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var G=Object.defineProperty;var P=function(e,t,n){return t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var M=function(e,t){return G(e,"name",{value:t,configurable:!0})};var w=function(e,t,n){return P(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,n)};import{ApolloServer as L}from"@apollo/server";import{expressMiddleware as j}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as k}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as U,ApolloServerPluginLandingPageProductionDefault as F}from"@apollo/server/plugin/landingPage/default";var V=function(e){return e.Error="error",e.Warning="warning",e}({});import q from"chalk";import Y from"consola";import{GraphQLError as K}from"graphql";var B=".cyberskill-storage";import H from"@dotenvx/dotenvx";import{bool as Q,cleanEnv as W,str as J}from"envalid";import $ from"os";import X from"path";import z from"process";var Z=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var ee=!1;function et(){z.env.NODE_ENV!==Z.PRODUCTION&&!ee&&(H.config(),ee=!0)}M(et,"loadEnvFile");function en(){et();var e=W(z.env,{CWD:J({default:z.cwd()}),DEBUG:Q({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:J({default:X.join($.homedir(),B)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}M(en,"getEnv");var er={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 es=en();function ei(e){var t=e.message,n=e.status,r=n===void 0?er.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new K(a,{extensions:{code:r.CODE}}):new Error(a)}M(ei,"throwError");es.DEBUG||(Y.level=4);function eo(e){var t=q[e];return typeof t=="function"?t:q.green}M(eo,"chalkKeyword");var ea={silent:Y.silent,level:Y.level,fatal:Y.fatal,error:Y.error,warn:Y.warn,log:Y.log,info:Y.info,success:Y.success,ready:Y.ready,start:Y.start,box:Y.box,debug:Y.debug,trace:Y.trace,verbose:Y.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){Y.box(q.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;Y.log("".concat(q.gray("File:")," ").concat(q.blue("".concat(t).concat(r?":".concat(r):"")))),s&&Y.log(" ".concat(eo(n)("Rule:")," ").concat(s)),Y.log(" ".concat(eo(n)("Message:")," ").concat(i))}),Y.box(eo(n)("".concat(e," : ").concat(t.length))),Y.log(q.gray("─".repeat(40)))}};function ec(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=f(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&ea.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:er.INTERNAL_SERVER_ERROR.CODE}}M(ec,"catchError");function eu(e){return new L(y({schema:e.schema,plugins:[e.isDev?U():F(),k({httpServer:e.server})].concat(b(e.drainServer?[{serverWillStart:function t(){return i(function(){return x(this,function(t){return[2,{drainServer:function t(){return i(function(){var t;return x(this,function(n){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),ea.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}M(eu,"createApolloServer");import el from"process";import{hideBin as ed}from"yargs/helpers";import ep from"yargs/yargs";var ef={name:"@cyberskill/shared",type:"module",version:"1.188.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"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.2","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.0","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.5",ws:"8.18.2",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.3","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4","esbuild-sass-plugin":"3.3.1",eslint:"9.29.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",playwright:"1.53.1",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var eE=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as em}from"child_process";import eg from"process";import*as eh from"util";var ey=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import ev from"node-fetch";import eS from"fs-extra";import eO from"path";var eC=eS,eD=eS.lstatSync,e_=eS.readdirSync,eI=eS.mkdirSync,eN=eS.readFileSync,eb=eS.unlinkSync,eT=eS.statSync,eA=eS.readJsonSync;function eR(e,t,n){eS.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(eR,"writeFileSync");function ex(e,t,n){eS.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(ex,"appendFileSync");function eG(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return eS.pathExistsSync(e)})}M(eG,"pathExistsSync");function eP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eG(e)&&eS.removeSync(e)})}M(eP,"removeSync");function eM(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);eS.copySync(e,t,y({filter:M(function(e){return eT(e).isDirectory()||!r||r.length===0?!0:r.includes(eO.extname(e))},"filter")},s))}M(eM,"copySync");import ew from"fs-extra";import eL from"path";var ej=en(),ek=eL;function eU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ek).resolve.apply(r,[ej.CWD].concat(b(t)))}M(eU,"resolveWorkingPath");function eF(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ek).resolve.apply(r,b(t))}M(eF,"resolve");function eV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ek).join.apply(r,b(t))}M(eV,"join");var eq=en(),eY=eq.CWD,eK="@cyberskill/shared",eB="node_modules",eH="dist",eQ="public",eW="package.json",eJ="package-lock.json",e$="tsconfig.json",eX=".gitignore",ez=".simple-git-hooks.json",eZ="pnpm-lock.yaml",e0=".git/hooks/",e1=".git/COMMIT_EDITMSG",e2=".migrate-mongo.config.js",e4=function(){var e=ew.readJsonSync(eU(eW)).name===eK?eY:eV(eY,eB,eK);return eV(e,eH)}(),e3="cyberskill",e5="src/node/cli/index.ts",e8="eslint",e6="eslint",e7="vitest",e9="playwright",te="vitest",tt="@commitlint/cli",tn="@commitlint/config-conventional",tr="commitlint",ts="lint-staged",ti="lint-staged",to="typescript",ta="tsc",tc="tsx",tu="git",tl="pnpm",td="pnpm exec",tp="simple-git-hooks",tf="simple-git-hooks",tE="@eslint/config-inspector",tm="eslint-config-inspector",tg="node-modules-inspector",th="node-modules-inspector",ty="migrate-mongo",tv="./node_modules/migrate-mongo/bin/migrate-mongo",tS={CYBERSKILL_DIRECTORY:e4,WORKING_DIRECTORY:eY,PUBLIC_DIRECTORY:eU(eQ),TS_CONFIG:eU(e$),GIT_IGNORE:eU(eX),GIT_HOOK:eU(e0),GIT_COMMIT_MSG:eU(e1),SIMPLE_GIT_HOOKS_JSON:eU(ez),PACKAGE_JSON:eU(eW),PACKAGE_LOCK_JSON:eU(eJ),PNPM_LOCK_YAML:eU(eZ),NODE_MODULES:eU(eB),MIGRATE_MONGO_CONFIG:eU(e2),LINT_STAGED_CONFIG:eU("".concat(e4,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eU("".concat(e4,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eU("".concat(e4,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eU("".concat(e4,"/config/vitest/vitest.unit.setup.js")),VITEST_E2E_CONFIG:eU("".concat(e4,"/config/vitest/vitest.e2e.js"))};function tO(e){var t=e.isCurrentProject;return y({"pre-commit":ti,"commit-msg":tr},t&&{"pre-push":tY("".concat(tu," pull"))})}M(tO,"createGitHooksConfig");function tC(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return x(this,function(n){switch(n.label){case 0:switch(t){case eE.CLI:return[3,1];case eE.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tA(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tB(tY("".concat(td," ").concat(r))))];case 4:return[2,tB(tY(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}M(tC,"buildCommand");var tD={simpleGitHooks:tC({type:eE.CLI,packages:[{name:tp,type:ey.DEV_DEPENDENCY}],command:tf}),eslintInspect:tC({type:eE.CLI,packages:[{name:tE,type:ey.DEV_DEPENDENCY}],command:tm}),nodeModulesInspect:tC({type:eE.CLI,packages:[{name:tg,type:ey.DEV_DEPENDENCY}],command:th}),eslintCheck:tC({type:eE.CLI,packages:[{name:e8,type:ey.DEV_DEPENDENCY}],command:"".concat(e6," ").concat(tS.WORKING_DIRECTORY," --no-cache")}),eslintFix:tC({type:eE.CLI,packages:[{name:e8,type:ey.DEV_DEPENDENCY}],command:"".concat(e6," ").concat(tS.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tC({type:eE.CLI,packages:[{name:to,type:ey.DEV_DEPENDENCY}],command:"".concat(ta," -p ").concat(tS.TS_CONFIG," --noEmit")}),testUnit:tC({type:eE.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(te," --config ").concat(tS.VITEST_UNIT_CONFIG)}),testE2e:tC({type:eE.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(te," --config ").concat(tS.VITEST_E2E_CONFIG)}),mongoMigrateCreate:M(function(e){return tC({type:eE.CLI,packages:[{name:tc,type:ey.DEPENDENCY},{name:ty,type:ey.DEPENDENCY}],command:"".concat(tc," ").concat(tv," create ").concat(e," -f ").concat(tS.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tC({type:eE.CLI,packages:[{name:tc,type:ey.DEPENDENCY},{name:ty,type:ey.DEPENDENCY}],command:"".concat(tc," ").concat(tv," up -f ").concat(tS.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tC({type:eE.CLI,packages:[{name:tc,type:ey.DEPENDENCY},{name:ty,type:ey.DEPENDENCY}],command:"".concat(tc," ").concat(tv," down -f ").concat(tS.MIGRATE_MONGO_CONFIG)}),commitLint:tC({type:eE.CLI,packages:[{name:tt,type:ey.DEV_DEPENDENCY},{name:tn,type:ey.DEV_DEPENDENCY}],command:"".concat(tr," --edit ").concat(tS.GIT_COMMIT_MSG," --config ").concat(tS.COMMITLINT_CONFIG)}),lintStaged:tC({type:eE.CLI,packages:[{name:ts,type:ey.DEV_DEPENDENCY}],command:"".concat(ti," --config ").concat(tS.LINT_STAGED_CONFIG)}),configureGitHook:tC({type:eE.STRING,command:"".concat(tu," config core.hooksPath ").concat(tS.GIT_HOOK)}),build:tC({type:eE.STRING,command:"".concat(tl," run --if-present build")}),pnpmInstallStandard:tC({type:eE.STRING,command:"".concat(tl," install --ignore-scripts")}),pnpmInstallLegacy:tC({type:eE.STRING,command:"".concat(tl," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:tC({type:eE.STRING,command:"".concat(tl," install --ignore-scripts --force")}),pnpmPruneStore:tC({type:eE.STRING,command:"".concat(tl," store prune")}),pnpmCleanCache:tC({type:eE.STRING,command:"".concat(tl," cache delete")})};var t_=en();function tI(e){return i(function(){var t,n,r,s;return x(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,ev("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:s=i.sent();return[2,ec(s)];case 4:return[2]}})})()}M(tI,"getLatestPackageVersion");function tN(e){return i(function(){var t,n,r,s,i,o,a,c,u,l,d,p,f,E,m,g,h,y,v,S,O,C,D,_;return x(this,function(I){switch(I.label){case 0:I.trys.push([0,2,,3]);if(!e){if(eG(tS.PACKAGE_JSON)){t=eA(tS.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,s=t.version,i=s===void 0?"":s;return[2,{success:!0,result:{name:r,currentVersion:i,latestVersion:i,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:tS.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!eG(tS.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];o=eA(tS.PACKAGE_JSON),a=o.name,c=o.version,u=c===void 0?"":c,l=o.dependencies,d=l===void 0?{}:l,p=o.devDependencies,f=p===void 0?{}:p;if(e.name===a)return[2,{success:!0,result:{name:a,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:tS.PACKAGE_JSON,file:o}}];E=e.name in d,m=e.name in f;return[4,tI(e.name)];case 1:g=I.sent();if(!g.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:E,isDevDependency:m,installedPath:"",file:{}}}];if(!E&&!m)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];v=(y=(h=d[e.name])!==null&&h!==void 0?h:f[e.name])!==null&&y!==void 0?y:"",S=eV(t_.CWD,eB,e.name,eW);if(!eG(S))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:E,isDevDependency:m,installedPath:"",file:{}}}];O=eA(S),C=O.version,D=C===void 0?"":C;return[2,v!==D?{success:!0,result:{name:e.name,currentVersion:D||v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:E,isDevDependency:m,installedPath:S,file:O}}:{success:!0,result:{name:e.name,currentVersion:v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:v===g.result,isDependency:E,isDevDependency:m,installedPath:S,file:O}}];case 2:_=I.sent();return[2,ec(_)];case 3:return[2]}})})()}M(tN,"getPackage");function tb(e){return i(function(){var t,n,r,s,i;return x(this,function(o){try{;r=eA(tS.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),eR(tS.PACKAGE_JSON,JSON.stringify(r,null,4)),ea.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){ec(e)}return[2]})})()}M(tb,"updatePackage");function tT(){return i(function(){var e,t,n,r,s,i,o,a,c,u,l,d,p;return x(this,function(f){switch(f.label){case 0:f.trys.push([0,12,,13]);e=[{command:M(function(){return tD.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:M(function(){return tD.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:M(function(){return tD.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tQ("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();ec(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=f.sent();ec(p);return[3,13];case 13:return[2]}})})()}M(tT,"installDependencies");function tA(e,t){return i(function(){var n,r,s,i,o,a,c,u,l,d,p,f,E,m,g,h,y;return x(this,function(v){switch(v.label){case 0:v.trys.push([0,15,,16]);if(!eG(tS.PACKAGE_JSON)){ea.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(tN))];case 1:s=v.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),i=s.filter(function(e){return!e.isInstalled}),o=s.filter(function(e){return!e.isUpToDate}),a=[];(t===null||t===void 0?void 0:t.install)&&i.length>0&&(n=a).push.apply(n,b(i.map(tb))),(t===null||t===void 0?void 0:t.update)&&o.length>0&&(r=a).push.apply(r,b(o.map(tb)));c=a.length>0;if(!c)return[3,6];return[4,Promise.all(a)];case 2:v.sent();return[4,tT()];case 3:v.sent();u=["Running ESLint with auto-fix"];return[4,tD.eslintFix()];case 4:return[4,tQ.apply(void 0,u.concat([v.sent()]))];case 5:c=v.sent();v.label=6;case 6:c;d=true,p=false,f=undefined;v.label=7;case 7:v.trys.push([7,12,13,14]);E=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();v.label=8;case 8:if(!!(d=(m=E.next()).done))return[3,11];g=m.value;return[4,g()];case 9:v.sent();v.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:h=v.sent();p=true;f=h;return[3,14];case 13:try{if(!d&&E.return!=null){E.return()}}finally{if(p){throw f}}return[7];case 14:return[3,16];case 15:y=v.sent();ec(y);return[3,16];case 16:return[2]}})})()}M(tA,"setupPackages");import tR from"node-persist";var tx=en();function tG(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=tR.defaultInstance;if(e)return[3,2];return[4,tR.init({dir:tx.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}M(tG,"initNodePersist");var tP={get:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tG()];case 1:r.sent();return[4,tR.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,ec(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tG()];case 1:r.sent();return[4,tR.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();ec(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tG()];case 1:n.sent();return[4,tR.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tG()];case 1:n.sent();return[4,tR.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(ea.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,ec(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return x(this,function(t){try{return[2,"".concat(tx.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,ec(e,{returnValue:null})]}return[2]})})()}};var tM=en(),tw=eh.promisify(em);function tL(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,tN()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}M(tL,"getPackageName");function tj(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,tL()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,tP.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return x(this,function(n){switch(n.label){case 0:return[4,tP.getLogLink(t)];case 1:e=n.sent();e&&ea.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();ec(n);return[3,5];case 5:return[2]}})})()}M(tj,"saveErrorListToStorage");function tk(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tL()];case 1:e=r.sent();return[4,tP.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,ec(n,{returnValue:[]})];case 4:return[2]}})})()}M(tk,"getStoredErrorLists");function tU(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tL()];case 1:e=n.sent();return[4,tP.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(t);return[3,4];case 4:return[2]}})})()}M(tU,"clearAllErrorLists");function tF(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],E=o.exec(e)||[];var m,g,h,y,v,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===V.Error?V.Error:V.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===V.Error?V.Error:V.Warning,message:(y=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):E.length?t.push({file:"commitlint",type:V.Error,message:(v=E===null||E===void 0?void 0:(l=E[1])===null||l===void 0?void 0:l.trim())!==null&&v!==void 0?v:"",rule:(S=E===null||E===void 0?void 0:(d=E[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tj(t),tM.DEBUG&&n.length&&(ea.warn("Unmatched lines:"),n.forEach(function(e){return ea.info(" ".concat(e))}))}M(tF,"parseTextErrors");function tV(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?V.Error:V.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tj(n)}catch(t){tF(e)}}M(tV,"parseCommandOutput");function tq(e){return i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return x(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tV;n=new AbortController;eg.on("SIGINT",function(){ea.warn("Process interrupted. Terminating..."),n.abort(),eg.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tw(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&ea.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}M(tq,"executeCommand");function tY(e){return{raw:!0,cmd:e}}M(tY,"rawCommand");function tK(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(td," ").concat(tc," ").concat(e5," ").concat(e):"".concat(td," ").concat(e3," ").concat(e)}M(tK,"formatCLI");function tB(e,t){return typeof e=="function"?tK(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tK(e,t):e}M(tB,"formatCommand");function tH(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,tN({name:eK})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=I(e,2),r=t[0],s=t[1];return[r,tB(s,n)]}))]}return[2]}})})()}M(tH,"resolveCommands");function tQ(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);ea.start("".concat(e)),tM.DEBUG&&ea.info("→ ".concat(t));return[4,tq(t)];case 1:r.sent(),ea.success("".concat(e," done."));return[3,3];case 2:n=r.sent();ec(n);return[3,3];case 3:return[2]}})})()}M(tQ,"runCommand");function tW(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:if(!eG(tS.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tD.typescriptCheck()];case 1:return[4,tQ.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=ea.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}M(tW,"checkTypescript");function tJ(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,tD.eslintFix()];case 1:return[4,tQ.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tD.eslintCheck()];case 4:return[4,tQ.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}M(tJ,"checkEslint");function t$(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";ea.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}M(t$,"printIssues");function tX(){return i(function(){return x(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:return[4,tk()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===V.Error}),n=e.filter(function(e){return e.type===V.Warning});!t.length&&!n.length?ea.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(t$("Warnings",n),t$("Errors",t),(t.length>0||n.length>0)&&el.exit(1));return[2]}})})()},0);return[2]})})()}M(tX,"showCheckResult");function tz(){return i(function(){var e,t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,tU()];case 1:s.sent();return[4,tN({name:eK})];case 2:e=s.sent();if(!e.success){ea.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(eK)];return[4,tD.build()];case 3:return[4,tQ.apply(void 0,n.concat([s.sent()]))];case 4:t=s.sent();s.label=5;case 5:t;r=["Executing lint-staged"];return[4,tD.lintStaged()];case 6:return[4,tQ.apply(void 0,r.concat([s.sent()]))];case 7:s.sent(),tX();return[2]}})})()}M(tz,"lintStaged");function tZ(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tD.eslintInspect()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(tZ,"inspectLint");function t0(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,tU()];case 1:e.sent();return[4,Promise.all([tW(),tJ()])];case 2:e.sent(),tX();return[2]}})})()}M(t0,"lintCheck");function t1(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,tU()];case 1:e.sent();return[4,Promise.all([tW(),tJ(!0)])];case 2:e.sent(),tX();return[2]}})})()}M(t1,"lintFix");function t2(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,tU()];case 1:t.sent();e=["Validating commit message"];return[4,tD.commitLint()];case 2:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tX();return[2]}})})()}M(t2,"commitLint");function t4(){return i(function(){var e,t,n,r;return x(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tD.configureGitHook()];case 1:return[4,tQ.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eP(tS.GIT_HOOK);return[4,tH(tO)];case 3:t=s.sent();eR(tS.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ez,"\n");eG(tS.GIT_IGNORE)?eN(tS.GIT_IGNORE,"utf-8").split("\n").includes(ez)||ex(tS.GIT_IGNORE,n):eR(tS.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tD.simpleGitHooks()];case 4:return[4,tQ.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}M(t4,"setupGitHook");function t3(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,tT()];case 1:e.sent();return[4,t4()];case 2:e.sent();return[2]}})})()}M(t3,"ready");function t5(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:eP(tS.NODE_MODULES,tS.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,tD.pnpmPruneStore()];case 1:return[4,tQ.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,tD.pnpmCleanCache()];case 3:return[4,tQ.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,tT()];case 5:n.sent();return[4,t4()];case 6:n.sent();return[2]}})})()}M(t5,"reset");function t8(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tD.nodeModulesInspect()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t8,"inspect");function t6(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tD.testUnit()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t6,"testUnit");function t7(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tD.testE2e()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t7,"testE2E");function t9(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tD.mongoMigrateCreate(e)];case 1:return[4,tQ.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}M(t9,"mongoMigrateCreate");function ne(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tD.mongoMigrateUp()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(ne,"mongoMigrateUp");function nt(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tD.mongoMigrateDown()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(nt,"mongoMigrateDown");(function(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,ep(ed(el.argv)).scriptName(e3).usage("$0 <command> [options]").command("lint","Check code for linting issues",t0).command("lint:fix","Fix linting issues automatically",t1).command("lint:inspect","View active ESLint configuration",tZ).command("lint-staged","Run lint checks on staged files",tz).command("commitlint","Validate commit message format",t2).command("ready","Initialize project and dependencies",t3).command("reset","Reset the project and reinstall dependencies",t5).command("inspect","Analyze installed project dependencies",t8).command("test:unit","Run unit test suite",t6).command("test:e2e","Run end-to-end test suite",t7).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return x(this,function(t){switch(t.label){case 0:if(!e.name){ea.error("Migration name is required.");return[2]}return[4,t9(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",ne).command("mongo:migrate:down","Rollback last MongoDB migration",nt).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(ef.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();ec(e),el.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as nn}from"express";import{NestFactory as nr}from"@nestjs/core";import ns from"body-parser";import ni from"compression";import no from"cookie-parser";import na from"cors";import nc from"express";import nu from"express-session";import nl from"express-useragent";function nd(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return y({origin:M(function(e,r){t||!e||(n===null||n===void 0?void 0:n.includes(e!==null&&e!==void 0?e:""))?r(null,!0):r(new Error("Not allowed by CORS"),!1)},"origin"),credentials:!0},r)}M(nd,"createCorsOptions");function np(e){return na(nd(e))}M(np,"createCors");function nf(e){return nu(e)}M(nf,"createSession");function nE(e){var t=nc();return t.set("trust proxy",1),t.use(no()),t.use(nc.urlencoded({extended:!0})),t.use(ni()),t.use(nl.express()),(e===null||e===void 0?void 0:e.staticFolder)&&t.use(nc.static(e.staticFolder)),t}M(nE,"createExpress");function nm(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,nr.create(e.module)];case 1:r=s.sent();return[2,(r.getHttpAdapter().getInstance().set("trust proxy",1),r.use(nc.urlencoded({extended:!0})),r.use(no()),r.use(ni()),r.use(nl.express()),e.staticFolder&&r.use(nc.static(e.staticFolder)),e.filters&&(t=r).useGlobalFilters.apply(t,b(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,b(e.pipes)),r)]}})})()}M(nm,"createNest");var ng="MONGO_MIGRATE_OPTIONS";import{Collection as nh,Db as ny}from"mongodb";import{Document as nv,Model as nS}from"mongoose";var nO=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(ny);M(nO,"C_Db");var nC=nO,nD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nv);M(nD,"C_Document");var n_=nD,nI=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nS);M(nI,"C_Model");var nN=nI,nb=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nh);M(nb,"C_Collection");var nT=nb;import{format as nA}from"date-fns";import nR from"migrate-mongo";import{Document as nx}from"mongoose";import nG from"mongoose-aggregate-paginate-v2";import nP from"mongoose-paginate-v2";import{v4 as nM}from"uuid";import nw from"unorm";var nL={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},nj=Object.entries(nL).reduce(function(e,t){var n=I(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function nk(e){e=nw.nfkc(e);var t=y({},nL,nj);var n=true,r=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),o;!(n=(o=i.next()).done);n=true){var a=I(o.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return e}M(nk,"regexSearchMapper");function nU(e){return(typeof e==="undefined"?"undefined":T(e))=="object"&&e!==null&&!Array.isArray(e)}M(nU,"isObject");function nF(e){return JSON.parse(JSON.stringify(e))}M(nF,"deepClone");function nV(e,t){return t.reduce(function(e,t){if(e&&(typeof e==="undefined"?"undefined":T(e))=="object"&&t in e)return e[t]},e)}M(nV,"getNestedValue");function nq(e,t,n){if(t.length===0)return e;var r=N(t),s=r[0],i=r.slice(1);if(i.length===0)return S(y({},e),l({},s,n));var o=e[s];return S(y({},e),l({},s,nq((typeof o==="undefined"?"undefined":T(o))=="object"&&o!==null?o:{},i,n)))}M(nq,"setNestedValue");import nY from"crypto-js";import nK from"slugify";var nB=nK.default||nK;function nH(e,t){var n=M(function(e){var n,r;return nB(e!==null&&e!==void 0?e:"",y({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(nU(e)){var r={};var s=true,i=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),c;!(s=(c=a.next()).done);s=true){var u=I(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;o=e}finally{try{if(!s&&a.return!=null){a.return()}}finally{if(i){throw o}}}return r}return n(e)}M(nH,"generateSlug");function nQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return nY.SHA256(e).toString(nY.enc.Hex).slice(0,t)}M(nQ,"generateShortId");var nW={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":T(e))=="object"?f(e,Date)?!1:f(e,Map)||f(e,Set)?e.size===0:f(e,WeakMap)||f(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var nJ={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,n=t===void 0?"string":t;var r=n==="string"?nJ.getDateTime():new Date;return{id:nM(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:nM,unique:!0},isDel:{type:Boolean,default:!1}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n);return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(nJ.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var p=nJ.createSchema({mongoose:t,schema:r,virtuals:u});return nJ.applyPlugins(p,[i&&nP,a&&nG]),nJ.applyMiddlewares(p,d),t.model(n,p)},validator:{isRequired:function e(){return function(e){return i(function(){return x(this,function(t){return[2,!nW.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return i(function(){return x(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!f(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:S(y({},nR),{setConfig:M(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eR(tS.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(e2,"\n");eG(tS.GIT_IGNORE)?eN(tS.GIT_IGNORE,"utf-8").split("\n").includes(e2)||ex(tS.GIT_IGNORE,n):eR(tS.GIT_IGNORE,n)},"setConfig")}),regexify:function e(e,t){if(!e)return{};var n=nF(e);if(!t||t.length===0)return n;var r=true,s=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(r=(a=o.next()).done);r=true){var c=a.value;var u=c.toString().split("."),l=nV(n,u);if(typeof l=="string"&&l.length>0){var d={$regex:".*".concat(nk(l),".*"),$options:"i"};n=nq(n,u,d)}}}catch(e){s=true;i=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(s){throw i}}}return n}},n$=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);w(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t=y({},nJ.createGenericFields(),e);return[4,this.collection.insertOne(t)];case 1:return[2,r.sent().acknowledged?{success:!0,message:"Document created successfully",result:t}:{success:!1,message:"Document creation failed",code:er.INTERNAL_SERVER_ERROR.CODE}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=e.map(function(e){return y({},nJ.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=s.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:t}];case 2:r=s.sent();return[2,ec(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:er.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,ec(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,ec(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,ec(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,ec(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(n$,"MongoController");var nX=n$,nz=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);w(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.findOne(e,t,n);r&&s.populate(r);return[4,s.exec()];case 2:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:er.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,ec(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.find(e,t,n);r&&s.populate(r);i={success:!0};return[4,s.exec()];case 2:return[2,(i.result=c.sent(),i)];case 3:o=c.sent();return[2,ec(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,ec(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=i.sent().map(function(e){return f(e,nx)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:er.NOT_FOUND.CODE}];case 3:s=o.sent();return[2,ec(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:s=o.sent();return[2,ec(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=i.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:er.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=i.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:er.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return i(function(){var n,r,s,i,o;return x(this,function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);n=new Set;r=0;a.label=1;case 1:if(!(r<10))return[3,5];s=nQ(e,r+t);i=!n.has(s);if(!i)return[3,3];n.add(s);return[4,this.model.exists({shortId:s})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:s}];a.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:er.INTERNAL_SERVER_ERROR.CODE}];case 6:o=a.sent();return[2,ec(o)];case 7:return[2]}})}).call(this)}},{key:"createSlugQuery",value:function e(e){var t=e.slug,n=e.field,r=e.isObject,s=e.filter;var i=y({},s!==null&&s!==void 0?s:{});return r?S(y({},i),{$or:[l({},"slug.".concat(n),t),{slugHistory:{$elemMatch:l({},"slug.".concat(n),t)}}]}):S(y({},i),{$or:[{slug:t},{slugHistory:t}]})}},{key:"createUniqueSlug",value:function e(e){return i(function(e){var t,n,r,s,i,o,a;return x(this,function(c){switch(c.label){case 0:t=e.slug,n=e.field,r=e.isObject,s=e.filter;i=nH(t),o=i,a=1;c.label=1;case 1:return[4,this.model.exists(this.createSlugQuery({slug:o,field:n,isObject:r,filter:s}))];case 2:if(!c.sent())return[3,4];o="".concat(i,"-").concat(a++);c.label=3;case 3:return[3,1];case 4:return[2,o]}})}).apply(this,arguments)}},{key:"createSlug",value:function e(e){return i(function(e){var t,n,r,s,o,a,c,u,l,d;return x(this,function(p){switch(p.label){case 0:t=this;n=e.field,r=e.from,s=e.filter;p.label=1;case 1:p.trys.push([1,6,,7]);o=r[n];if(!nU(o))return[3,3];c={success:!0};u=Object.fromEntries;return[4,Promise.all(Object.entries(o).map(function(e){var n=I(e,2),r=n[0],o=n[1];return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,this.createUniqueSlug({slug:o,field:r,isObject:!0,filter:s})];case 1:e=t.sent();return[2,[r,e]]}})}).call(t)}))];case 2:a=(c.result=u.apply(Object,[p.sent()]),c);return[3,5];case 3:l={success:!0};return[4,this.createUniqueSlug({slug:o,field:n,isObject:!1,filter:s})];case 4:a=(l.result=p.sent(),l);p.label=5;case 5:return[2,a];case 6:d=p.sent();return[2,ec(d)];case 7:return[2]}})}).apply(this,arguments)}},{key:"checkSlug",value:function e(e){return i(function(e){var t,n,r,s,i,o,a,c,u,l,d,p,f,E,m,g;return x(this,function(h){switch(h.label){case 0:t=e.slug,n=e.field,r=e.from,s=e.filter;h.label=1;case 1:h.trys.push([1,12,,13]);i=r[n];if(!nU(i))return[3,10];o=true,a=false,c=undefined;h.label=2;case 2:h.trys.push([2,7,8,9]);u=Object.values(i)[Symbol.iterator]();h.label=3;case 3:if(!!(o=(l=u.next()).done))return[3,6];d=l.value;p=nH(d);return[4,this.model.exists(this.createSlugQuery({slug:p,field:n,isObject:!0,filter:s}))];case 4:if(h.sent())return[2,{success:!0,result:!0}];h.label=5;case 5:o=true;return[3,3];case 6:return[3,9];case 7:f=h.sent();a=true;c=f;return[3,9];case 8:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 9:return[2,{success:!0,result:!1}];case 10:E=nH(t);m={success:!0};return[4,this.model.exists(this.createSlugQuery({slug:E,field:n,isObject:!1,filter:s}))];case 11:return[2,(m.result=h.sent()!==null,m)];case 12:g=h.sent();return[2,ec(g)];case 13:return[2]}})}).apply(this,arguments)}},{key:"aggregate",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(nz,"MongooseController");var nZ=nz;import{useServer as n0}from"graphql-ws/use/ws";import{WebSocketServer as n1}from"ws";function n2(e){return new n1({server:e.server,path:e.path})}M(n2,"createWSServer");function n4(e){return n0({schema:e.schema},e.server)}M(n4,"initGraphQLWS");export{eH as BUILD_DIRECTORY,tr as COMMIT_LINT_CLI,tn as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,tt as COMMIT_LINT_PACKAGE_NAME,e3 as CYBERSKILL_CLI,e5 as CYBERSKILL_CLI_PATH,e4 as CYBERSKILL_DIRECTORY,eK as CYBERSKILL_PACKAGE_NAME,nT as C_Collection,nC as C_Db,n_ as C_Document,nN as C_Model,e6 as ESLINT_CLI,tm as ESLINT_INSPECT_CLI,tE as ESLINT_INSPECT_PACKAGE_NAME,e8 as ESLINT_PACKAGE_NAME,eE as E_CommandType,V as E_IssueType,ey as E_PackageType,tu as GIT_CLI,e1 as GIT_COMMIT_EDITMSG,e0 as GIT_HOOK,eX as GIT_IGNORE,ti as LINT_STAGED_CLI,ts as LINT_STAGED_PACKAGE_NAME,tv as MIGRATE_MONGO_CLI,e2 as MIGRATE_MONGO_CONFIG,ty as MIGRATE_MONGO_PACKAGE_NAME,ng as MONGO_MIGRATE_OPTIONS,nX as MongoController,nZ as MongooseController,eB as NODE_MODULES,th as NODE_MODULES_INSPECT_CLI,tg as NODE_MODULES_INSPECT_PACKAGE_NAME,eW as PACKAGE_JSON,eJ as PACKAGE_LOCK_JSON,tS as PATH,e9 as PLAYWRIGHT_PACKAGE_NAME,tl as PNPM_CLI,td as PNPM_EXEC_CLI,eZ as PNPM_LOCK_YAML,eQ as PUBLIC_DIRECTORY,nn as Router,tp as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tf as SIMPLE_GIT_HOOK_CLI,ez as SIMPLE_GIT_HOOK_JSON,e$ as TSCONFIG_JSON,ta as TSC_CLI,to as TSC_PACKAGE_NAME,tc as TSX_CLI,te as VITEST_CLI,e7 as VITEST_PACKAGE_NAME,eY as WORKING_DIRECTORY,nG as aggregatePaginate,ex as appendFileSync,ns as bodyParser,ec as catchError,tU as clearAllErrorLists,tD as command,eM as copySync,eu as createApolloServer,np as createCors,nd as createCorsOptions,nE as createExpress,tO as createGitHooksConfig,nm as createNest,nf as createSession,n2 as createWSServer,nc as express,j as expressMiddleware,tB as formatCommand,eC as fs,tI as getLatestPackageVersion,tN as getPackage,tk as getStoredErrorLists,n4 as initGraphQLWS,tT as installDependencies,eV as join,ea as log,eD as lstatSync,eI as mkdirSync,nJ as mongo,nP as mongoosePaginate,ek as path,eG as pathExistsSync,tY as rawCommand,eN as readFileSync,eA as readJsonSync,e_ as readdirSync,eP as removeSync,eF as resolve,tH as resolveCommands,eU as resolveWorkingPath,tQ as runCommand,tA as setupPackages,eT as statSync,tP as storage,ei as throwError,eb as unlinkSync,tb as updatePackage,eR as writeFileSync};
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,c,"next",e)}function c(e){s(o,r,i,a,c,"throw",e)}a(undefined)})}}function o(e,t,n){t=d(t);return D(e,R()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function u(e,t,n){if(t)c(e.prototype,t);if(n)c(e,n);return e}function l(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function p(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)_(e,t)}function f(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function E(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function m(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(){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 y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){l(e,t,n[t])})}return e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{v(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function O(e,t){if(e==null)return{};var n=C(e,t);var r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++){r=i[s];if(t.indexOf(r)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;n[r]=e[r]}}return n}function C(e,t){if(e==null)return{};var n={};var r=Object.keys(e);var s,i;for(i=0;i<r.length;i++){s=r[i];if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function D(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return r(e)}function _(e,t){_=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return _(e,t)}function I(e,n){return t(e)||m(e,n)||A(e,n)||g()}function N(e){return t(e)||E(e)||A(e)||g()}function b(e){return n(e)||E(e)||A(e)||h()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function A(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(R=function(){return!!e})()}function x(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var G=Object.defineProperty;var P=function(e,t,n){return t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};var M=function(e,t){return G(e,"name",{value:t,configurable:!0})};var w=function(e,t,n){return P(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,n)};import{ApolloServer as L}from"@apollo/server";import{expressMiddleware as j}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as k}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as U,ApolloServerPluginLandingPageProductionDefault as F}from"@apollo/server/plugin/landingPage/default";var V=function(e){return e.Error="error",e.Warning="warning",e}({});import q from"chalk";import Y from"consola";import{GraphQLError as K}from"graphql";var B=".cyberskill-storage";import H from"@dotenvx/dotenvx";import{bool as Q,cleanEnv as W,str as J}from"envalid";import $ from"os";import X from"path";import z from"process";var Z=function(e){return e.PRODUCTION="production",e.STAGING="staging",e.DEVELOPMENT="development",e}({});var ee=!1;function et(){z.env.NODE_ENV!==Z.PRODUCTION&&!ee&&(H.config(),ee=!0)}M(et,"loadEnvFile");function en(){et();var e=W(z.env,{CWD:J({default:z.cwd()}),DEBUG:Q({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:J({default:X.join($.homedir(),B)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}M(en,"getEnv");var er={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 es=en();function ei(e){var t=e.message,n=e.status,r=n===void 0?er.INTERNAL_SERVER_ERROR:n,s=e.type,i=s===void 0?"graphql":s;var o;var a=(o=t!==null&&t!==void 0?t:r.MESSAGE)!==null&&o!==void 0?o:"Internal server error";throw i==="graphql"?new K(a,{extensions:{code:r.CODE}}):new Error(a)}M(ei,"throwError");es.DEBUG||(Y.level=4);function eo(e){var t=q[e];return typeof t=="function"?t:q.green}M(eo,"chalkKeyword");var ea={silent:Y.silent,level:Y.level,fatal:Y.fatal,error:Y.error,warn:Y.warn,log:Y.log,info:Y.info,success:Y.success,ready:Y.ready,start:Y.start,box:Y.box,debug:Y.debug,trace:Y.trace,verbose:Y.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){Y.box(q.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;Y.log("".concat(q.gray("File:")," ").concat(q.blue("".concat(t).concat(r?":".concat(r):"")))),s&&Y.log(" ".concat(eo(n)("Rule:")," ").concat(s)),Y.log(" ".concat(eo(n)("Message:")," ").concat(i))}),Y.box(eo(n)("".concat(e," : ").concat(t.length))),Y.log(q.gray("─".repeat(40)))}};function ec(e,t){var n=t!==null&&t!==void 0?t:{},r=n.shouldLog,s=r===void 0?!0:r,i=n.returnValue,o=n.callback,a=f(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return s&&ea.error(a.message),o&&typeof o=="function"&&o(a),i||{success:!1,message:a.message,code:er.INTERNAL_SERVER_ERROR.CODE}}M(ec,"catchError");function eu(e){return new L(y({schema:e.schema,plugins:[e.isDev?U():F(),k({httpServer:e.server})].concat(b(e.drainServer?[{serverWillStart:function t(){return i(function(){return x(this,function(t){return[2,{drainServer:function t(){return i(function(){var t;return x(this,function(n){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),ea.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}M(eu,"createApolloServer");import el from"process";import{hideBin as ed}from"yargs/helpers";import ep from"yargs/yargs";var ef={name:"@cyberskill/shared",type:"module",version:"1.190.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"},"./config":{types:"./dist/config/index.d.ts",import:"./dist/config/index.js",require:"./dist/config/index.cjs"},"./config/commitlint":{types:"./dist/config/commitlint/index.d.ts",import:"./dist/config/commitlint/index.js",require:"./dist/config/commitlint/index.cjs"},"./config/env":{types:"./dist/config/env/index.d.ts",import:"./dist/config/env/index.js",require:"./dist/config/env/index.cjs"},"./config/eslint":{types:"./dist/config/eslint/index.d.ts",import:"./dist/config/eslint/index.js",require:"./dist/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/config/graphql-codegen/index.d.ts",import:"./dist/config/graphql-codegen/index.js",require:"./dist/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/config/lint-staged/index.d.ts",import:"./dist/config/lint-staged/index.js",require:"./dist/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/config/vitest/index.d.ts",import:"./dist/config/vitest/index.js",require:"./dist/config/vitest/index.cjs"},"./constant":{types:"./dist/constant/index.d.ts",import:"./dist/constant/index.js",require:"./dist/constant/index.cjs"},"./node":{types:"./dist/node/index.d.ts",import:"./dist/node/index.js",require:"./dist/node/index.cjs"},"./node/apollo-server":{types:"./dist/node/apollo-server/index.d.ts",import:"./dist/node/apollo-server/index.js",require:"./dist/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/node/cli/index.d.ts",import:"./dist/node/cli/index.js",require:"./dist/node/cli/index.cjs"},"./node/command":{types:"./dist/node/command/index.d.ts",import:"./dist/node/command/index.js",require:"./dist/node/command/index.cjs"},"./node/express":{types:"./dist/node/express/index.d.ts",import:"./dist/node/express/index.js",require:"./dist/node/express/index.cjs"},"./node/fs":{types:"./dist/node/fs/index.d.ts",import:"./dist/node/fs/index.js",require:"./dist/node/fs/index.cjs"},"./node/log":{types:"./dist/node/log/index.d.ts",import:"./dist/node/log/index.js",require:"./dist/node/log/index.cjs"},"./node/mongo":{types:"./dist/node/mongo/index.d.ts",import:"./dist/node/mongo/index.js",require:"./dist/node/mongo/index.cjs"},"./node/package":{types:"./dist/node/package/index.d.ts",import:"./dist/node/package/index.js",require:"./dist/node/package/index.cjs"},"./node/path":{types:"./dist/node/path/index.d.ts",import:"./dist/node/path/index.js",require:"./dist/node/path/index.cjs"},"./node/storage":{types:"./dist/node/storage/index.d.ts",import:"./dist/node/storage/index.js",require:"./dist/node/storage/index.cjs"},"./node/ws":{types:"./dist/node/ws/index.d.ts",import:"./dist/node/ws/index.js",require:"./dist/node/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/index.css":{import:"./dist/react/index.css",require:"./dist/react/index.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./util":{types:"./dist/util/index.d.ts",import:"./dist/util/index.js",require:"./dist/util/index.cjs"}},typesVersions:{"*":{config:["dist/config/index.d.ts"],constant:["dist/constant/index.d.ts"],node:["dist/node/index.d.ts"],react:["dist/react/index.d.ts"],typescript:["dist/typescript/index.d.ts"],util:["dist/util/index.d.ts"]}},bin:{cyberskill:"dist/node/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"tsup --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},dependencies:{"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.2","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.0","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",sass:"1.89.2",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"7.0.0",ws:"8.18.2",yargs:"18.0.0"},devDependencies:{"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.3","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4","esbuild-sass-plugin":"3.3.1",eslint:"9.29.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",playwright:"1.53.1",postcss:"8.5.6","postcss-modules":"6.0.1","simple-git-hooks":"2.13.0",tsup:"8.5.0",tsx:"4.20.3",typescript:"5.8.3",vitest:"3.2.4"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"}};var eE=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as em}from"child_process";import eg from"process";import*as eh from"util";var ey=function(e){return e.DEPENDENCY="dependencies",e.DEV_DEPENDENCY="devDependencies",e.PEER_DEPENDENCY="peerDependencies",e.BUNDLE_DEPENDENCY="bundleDependencies",e.OPTIONAL_DEPENDENCY="optionalDependencies",e}({});import ev from"node-fetch";import eS from"fs-extra";import eO from"path";var eC=eS,eD=eS.lstatSync,e_=eS.readdirSync,eI=eS.mkdirSync,eN=eS.readFileSync,eb=eS.unlinkSync,eT=eS.statSync,eA=eS.readJsonSync;function eR(e,t,n){eS.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(eR,"writeFileSync");function ex(e,t,n){eS.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}M(ex,"appendFileSync");function eG(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return eS.pathExistsSync(e)})}M(eG,"pathExistsSync");function eP(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eG(e)&&eS.removeSync(e)})}M(eP,"removeSync");function eM(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.extensions,s=O(n,["extensions"]);eS.copySync(e,t,y({filter:M(function(e){return eT(e).isDirectory()||!r||r.length===0?!0:r.includes(eO.extname(e))},"filter")},s))}M(eM,"copySync");import ew from"fs-extra";import eL from"path";var ej=en(),ek=eL;function eU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ek).resolve.apply(r,[ej.CWD].concat(b(t)))}M(eU,"resolveWorkingPath");function eF(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ek).resolve.apply(r,b(t))}M(eF,"resolve");function eV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ek).join.apply(r,b(t))}M(eV,"join");var eq=en(),eY=eq.CWD,eK="@cyberskill/shared",eB="node_modules",eH="dist",eQ="public",eW="package.json",eJ="package-lock.json",e$="tsconfig.json",eX=".gitignore",ez=".simple-git-hooks.json",eZ="pnpm-lock.yaml",e0=".git/hooks/",e1=".git/COMMIT_EDITMSG",e2=".migrate-mongo.config.js",e4=function(){var e=ew.readJsonSync(eU(eW)).name===eK?eY:eV(eY,eB,eK);return eV(e,eH)}(),e3="cyberskill",e5="src/node/cli/index.ts",e6="eslint",e8="eslint",e7="vitest",e9="playwright",te="vitest",tt="@commitlint/cli",tn="@commitlint/config-conventional",tr="commitlint",ts="lint-staged",ti="lint-staged",to="typescript",ta="tsc",tc="tsx",tu="git",tl="pnpm",td="pnpm exec",tp="simple-git-hooks",tf="simple-git-hooks",tE="@eslint/config-inspector",tm="eslint-config-inspector",tg="node-modules-inspector",th="node-modules-inspector",ty="migrate-mongo",tv="./node_modules/migrate-mongo/bin/migrate-mongo",tS={CYBERSKILL_DIRECTORY:e4,WORKING_DIRECTORY:eY,PUBLIC_DIRECTORY:eU(eQ),TS_CONFIG:eU(e$),GIT_IGNORE:eU(eX),GIT_HOOK:eU(e0),GIT_COMMIT_MSG:eU(e1),SIMPLE_GIT_HOOKS_JSON:eU(ez),PACKAGE_JSON:eU(eW),PACKAGE_LOCK_JSON:eU(eJ),PNPM_LOCK_YAML:eU(eZ),NODE_MODULES:eU(eB),MIGRATE_MONGO_CONFIG:eU(e2),LINT_STAGED_CONFIG:eU("".concat(e4,"/config/lint-staged/index.js")),COMMITLINT_CONFIG:eU("".concat(e4,"/config/commitlint/index.js")),VITEST_UNIT_CONFIG:eU("".concat(e4,"/config/vitest/vitest.unit.js")),VITEST_UNIT_SETUP_CONFIG:eU("".concat(e4,"/config/vitest/vitest.unit.setup.js")),VITEST_E2E_CONFIG:eU("".concat(e4,"/config/vitest/vitest.e2e.js"))};function tO(e){var t=e.isCurrentProject;return y({"pre-commit":ti,"commit-msg":tr},t&&{"pre-push":tY("".concat(tu," pull"))})}M(tO,"createGitHooksConfig");function tC(e){var t=e.type,n=e.packages,r=e.command;var s=n===null||n===void 0?void 0:n.reduce(function(e,t){return e.some(function(e){return e.name===t.name})||e.push(t),e},[]);return function(){return i(function(){var e;return x(this,function(n){switch(n.label){case 0:switch(t){case eE.CLI:return[3,1];case eE.STRING:return[3,4]}return[3,5];case 1:e=s===null||s===void 0?void 0:s.length;if(!e)return[3,3];return[4,tA(s,{install:!0})];case 2:e=n.sent();n.label=3;case 3:return[2,(e,tB(tY("".concat(td," ").concat(r))))];case 4:return[2,tB(tY(r))];case 5:throw new Error("Unsupported command type");case 6:return[2]}})})()}}M(tC,"buildCommand");var tD={simpleGitHooks:tC({type:eE.CLI,packages:[{name:tp,type:ey.DEV_DEPENDENCY}],command:tf}),eslintInspect:tC({type:eE.CLI,packages:[{name:tE,type:ey.DEV_DEPENDENCY}],command:tm}),nodeModulesInspect:tC({type:eE.CLI,packages:[{name:tg,type:ey.DEV_DEPENDENCY}],command:th}),eslintCheck:tC({type:eE.CLI,packages:[{name:e6,type:ey.DEV_DEPENDENCY}],command:"".concat(e8," ").concat(tS.WORKING_DIRECTORY," --no-cache")}),eslintFix:tC({type:eE.CLI,packages:[{name:e6,type:ey.DEV_DEPENDENCY}],command:"".concat(e8," ").concat(tS.WORKING_DIRECTORY," --fix --no-cache")}),typescriptCheck:tC({type:eE.CLI,packages:[{name:to,type:ey.DEV_DEPENDENCY}],command:"".concat(ta," -p ").concat(tS.TS_CONFIG," --noEmit")}),testUnit:tC({type:eE.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(te," --config ").concat(tS.VITEST_UNIT_CONFIG)}),testE2e:tC({type:eE.CLI,packages:[{name:e7,type:ey.DEV_DEPENDENCY}],command:"".concat(te," --config ").concat(tS.VITEST_E2E_CONFIG)}),mongoMigrateCreate:M(function(e){return tC({type:eE.CLI,packages:[{name:tc,type:ey.DEPENDENCY},{name:ty,type:ey.DEPENDENCY}],command:"".concat(tc," ").concat(tv," create ").concat(e," -f ").concat(tS.MIGRATE_MONGO_CONFIG)})()},"mongoMigrateCreate"),mongoMigrateUp:tC({type:eE.CLI,packages:[{name:tc,type:ey.DEPENDENCY},{name:ty,type:ey.DEPENDENCY}],command:"".concat(tc," ").concat(tv," up -f ").concat(tS.MIGRATE_MONGO_CONFIG)}),mongoMigrateDown:tC({type:eE.CLI,packages:[{name:tc,type:ey.DEPENDENCY},{name:ty,type:ey.DEPENDENCY}],command:"".concat(tc," ").concat(tv," down -f ").concat(tS.MIGRATE_MONGO_CONFIG)}),commitLint:tC({type:eE.CLI,packages:[{name:tt,type:ey.DEV_DEPENDENCY},{name:tn,type:ey.DEV_DEPENDENCY}],command:"".concat(tr," --edit ").concat(tS.GIT_COMMIT_MSG," --config ").concat(tS.COMMITLINT_CONFIG)}),lintStaged:tC({type:eE.CLI,packages:[{name:ts,type:ey.DEV_DEPENDENCY}],command:"".concat(ti," --config ").concat(tS.LINT_STAGED_CONFIG)}),configureGitHook:tC({type:eE.STRING,command:"".concat(tu," config core.hooksPath ").concat(tS.GIT_HOOK)}),build:tC({type:eE.STRING,command:"".concat(tl," run --if-present build")}),pnpmInstallStandard:tC({type:eE.STRING,command:"".concat(tl," install --ignore-scripts")}),pnpmInstallLegacy:tC({type:eE.STRING,command:"".concat(tl," install --ignore-scripts --legacy-peer-deps")}),pnpmInstallForce:tC({type:eE.STRING,command:"".concat(tl," install --ignore-scripts --force")}),pnpmPruneStore:tC({type:eE.STRING,command:"".concat(tl," store prune")}),pnpmCleanCache:tC({type:eE.STRING,command:"".concat(tl," cache delete")})};var t_=en();function tI(e){return i(function(){var t,n,r,s;return x(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,ev("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,{success:!0,result:r}];case 3:s=i.sent();return[2,ec(s)];case 4:return[2]}})})()}M(tI,"getLatestPackageVersion");function tN(e){return i(function(){var t,n,r,s,i,o,a,c,u,l,d,p,f,E,m,g,h,y,v,S,O,C,D,_;return x(this,function(I){switch(I.label){case 0:I.trys.push([0,2,,3]);if(!e){if(eG(tS.PACKAGE_JSON)){t=eA(tS.PACKAGE_JSON),n=t.name,r=n===void 0?"":n,s=t.version,i=s===void 0?"":s;return[2,{success:!0,result:{name:r,currentVersion:i,latestVersion:i,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:tS.PACKAGE_JSON,file:t}}]}return[2,{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}]}if(!eG(tS.PACKAGE_JSON))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];o=eA(tS.PACKAGE_JSON),a=o.name,c=o.version,u=c===void 0?"":c,l=o.dependencies,d=l===void 0?{}:l,p=o.devDependencies,f=p===void 0?{}:p;if(e.name===a)return[2,{success:!0,result:{name:a,currentVersion:u,latestVersion:u,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:tS.PACKAGE_JSON,file:o}}];E=e.name in d,m=e.name in f;return[4,tI(e.name)];case 1:g=I.sent();if(!g.success)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:E,isDevDependency:m,installedPath:"",file:{}}}];if(!E&&!m)return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===ey.DEPENDENCY,isDevDependency:e.type===ey.DEV_DEPENDENCY,installedPath:"",file:{}}}];v=(y=(h=d[e.name])!==null&&h!==void 0?h:f[e.name])!==null&&y!==void 0?y:"",S=eV(t_.CWD,eB,e.name,eW);if(!eG(S))return[2,{success:!0,result:{name:e.name,currentVersion:"",latestVersion:g.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:E,isDevDependency:m,installedPath:"",file:{}}}];O=eA(S),C=O.version,D=C===void 0?"":C;return[2,v!==D?{success:!0,result:{name:e.name,currentVersion:D||v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:E,isDevDependency:m,installedPath:S,file:O}}:{success:!0,result:{name:e.name,currentVersion:v,latestVersion:g.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:v===g.result,isDependency:E,isDevDependency:m,installedPath:S,file:O}}];case 2:_=I.sent();return[2,ec(_)];case 3:return[2]}})})()}M(tN,"getPackage");function tb(e){return i(function(){var t,n,r,s,i;return x(this,function(o){try{;r=eA(tS.PACKAGE_JSON),s=(t=r.dependencies)!==null&&t!==void 0?t:{},i=(n=r.devDependencies)!==null&&n!==void 0?n:{};e.isDependency?s[e.name]=e.latestVersion:e.isDevDependency&&(i[e.name]=e.latestVersion),eR(tS.PACKAGE_JSON,JSON.stringify(r,null,4)),ea.info('Updated "'.concat(e.name,'" to version ').concat(e.latestVersion))}catch(e){ec(e)}return[2]})})()}M(tb,"updatePackage");function tT(){return i(function(){var e,t,n,r,s,i,o,a,c,u,l,d,p;return x(this,function(f){switch(f.label){case 0:f.trys.push([0,12,,13]);e=[{command:M(function(){return tD.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:M(function(){return tD.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:M(function(){return tD.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tQ("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();ec(l);return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:return[3,13];case 12:p=f.sent();ec(p);return[3,13];case 13:return[2]}})})()}M(tT,"installDependencies");function tA(e,t){return i(function(){var n,r,s,i,o,a,c,u,l,d,p,f,E,m,g,h,y;return x(this,function(v){switch(v.label){case 0:v.trys.push([0,15,,16]);if(!eG(tS.PACKAGE_JSON)){ea.error("package.json not found. Aborting setup.");return[2]}return[4,Promise.all(e.map(tN))];case 1:s=v.sent().filter(function(e){return e.success&&!!e.result&&!e.result.isCurrentProject}).map(function(e){return e.result}),i=s.filter(function(e){return!e.isInstalled}),o=s.filter(function(e){return!e.isUpToDate}),a=[];(t===null||t===void 0?void 0:t.install)&&i.length>0&&(n=a).push.apply(n,b(i.map(tb))),(t===null||t===void 0?void 0:t.update)&&o.length>0&&(r=a).push.apply(r,b(o.map(tb)));c=a.length>0;if(!c)return[3,6];return[4,Promise.all(a)];case 2:v.sent();return[4,tT()];case 3:v.sent();u=["Running ESLint with auto-fix"];return[4,tD.eslintFix()];case 4:return[4,tQ.apply(void 0,u.concat([v.sent()]))];case 5:c=v.sent();v.label=6;case 6:c;d=true,p=false,f=undefined;v.label=7;case 7:v.trys.push([7,12,13,14]);E=((l=t===null||t===void 0?void 0:t.callbacks)!==null&&l!==void 0?l:[])[Symbol.iterator]();v.label=8;case 8:if(!!(d=(m=E.next()).done))return[3,11];g=m.value;return[4,g()];case 9:v.sent();v.label=10;case 10:d=true;return[3,8];case 11:return[3,14];case 12:h=v.sent();p=true;f=h;return[3,14];case 13:try{if(!d&&E.return!=null){E.return()}}finally{if(p){throw f}}return[7];case 14:return[3,16];case 15:y=v.sent();ec(y);return[3,16];case 16:return[2]}})})()}M(tA,"setupPackages");import tR from"node-persist";var tx=en();function tG(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=tR.defaultInstance;if(e)return[3,2];return[4,tR.init({dir:tx.CYBERSKILL_STORAGE_DIRECTORY})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}M(tG,"initNodePersist");var tP={get:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tG()];case 1:r.sent();return[4,tR.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,ec(n,{returnValue:null})];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tG()];case 1:r.sent();return[4,tR.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();ec(n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tG()];case 1:n.sent();return[4,tR.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tG()];case 1:n.sent();return[4,tR.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(ea.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,ec(t,{returnValue:[]})];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return x(this,function(t){try{return[2,"".concat(tx.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,ec(e,{returnValue:null})]}return[2]})})()}};var tM=en(),tw=eh.promisify(em);function tL(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,tN()];case 1:e=t.sent();return[2,e.success?e.result.name:Date.now().toString()]}})})()}M(tL,"getPackageName");function tj(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:if(e.length===0)return[2];return[4,tL()];case 1:t=r.sent();r.label=2;case 2:r.trys.push([2,4,,5]);return[4,tP.set(t,e)];case 3:r.sent(),setTimeout(function(){return i(function(){var e;return x(this,function(n){switch(n.label){case 0:return[4,tP.getLogLink(t)];case 1:e=n.sent();e&&ea.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},0);return[3,5];case 4:n=r.sent();ec(n);return[3,5];case 5:return[2]}})})()}M(tj,"saveErrorListToStorage");function tk(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tL()];case 1:e=r.sent();return[4,tP.get(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:[]];case 3:n=r.sent();return[2,ec(n,{returnValue:[]})];case 4:return[2]}})})()}M(tk,"getStoredErrorLists");function tU(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,tL()];case 1:e=n.sent();return[4,tP.remove(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();ec(t);return[3,4];case 4:return[2]}})})()}M(tU,"clearAllErrorLists");function tF(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],E=o.exec(e)||[];var m,g,h,y,v,S;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===V.Error?V.Error:V.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(g=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===V.Error?V.Error:V.Warning,message:(y=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):E.length?t.push({file:"commitlint",type:V.Error,message:(v=E===null||E===void 0?void 0:(l=E[1])===null||l===void 0?void 0:l.trim())!==null&&v!==void 0?v:"",rule:(S=E===null||E===void 0?void 0:(d=E[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):n.push(e.trim())}}),t.length&&tj(t),tM.DEBUG&&n.length&&(ea.warn("Unmatched lines:"),n.forEach(function(e){return ea.info(" ".concat(e))}))}M(tF,"parseTextErrors");function tV(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?V.Error:V.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tj(n)}catch(t){tF(e)}}M(tV,"parseCommandOutput");function tq(e){return i(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return x(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tV;n=new AbortController;eg.on("SIGINT",function(){ea.warn("Process interrupted. Terminating..."),n.abort(),eg.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tw(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&ea.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}M(tq,"executeCommand");function tY(e){return{raw:!0,cmd:e}}M(tY,"rawCommand");function tK(e,t){return(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(td," ").concat(tc," ").concat(e5," ").concat(e):"".concat(td," ").concat(e3," ").concat(e)}M(tK,"formatCLI");function tB(e,t){return typeof e=="function"?tK(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tK(e,t):e}M(tB,"formatCommand");function tH(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,tN({name:eK})];case 1:t=s.sent();if(t.success){n={isCurrentProject:t.result.isCurrentProject},r=typeof e=="function"?e(n):e;return[2,Object.fromEntries(Object.entries(r).map(function(e){var t=I(e,2),r=t[0],s=t[1];return[r,tB(s,n)]}))]}return[2]}})})()}M(tH,"resolveCommands");function tQ(e,t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);ea.start("".concat(e)),tM.DEBUG&&ea.info("→ ".concat(t));return[4,tq(t)];case 1:r.sent(),ea.success("".concat(e," done."));return[3,3];case 2:n=r.sent();ec(n);return[3,3];case 3:return[2]}})})()}M(tQ,"runCommand");function tW(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:if(!eG(tS.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tD.typescriptCheck()];case 1:return[4,tQ.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=ea.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}M(tW,"checkTypescript");function tJ(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,tD.eslintFix()];case 1:return[4,tQ.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tD.eslintCheck()];case 4:return[4,tQ.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}M(tJ,"checkEslint");function t$(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";ea.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}M(t$,"printIssues");function tX(){return i(function(){return x(this,function(e){setTimeout(function(){return i(function(){var e,t,n;return x(this,function(r){switch(r.label){case 0:return[4,tk()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===V.Error}),n=e.filter(function(e){return e.type===V.Warning});!t.length&&!n.length?ea.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(t$("Warnings",n),t$("Errors",t),(t.length>0||n.length>0)&&el.exit(1));return[2]}})})()},0);return[2]})})()}M(tX,"showCheckResult");function tz(){return i(function(){var e,t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,tU()];case 1:s.sent();return[4,tN({name:eK})];case 2:e=s.sent();if(!e.success){ea.error("Failed to retrieve package information. Aborting lint-staged.");return[2]}t=e.result.isCurrentProject;if(!t)return[3,5];n=["Building package: ".concat(eK)];return[4,tD.build()];case 3:return[4,tQ.apply(void 0,n.concat([s.sent()]))];case 4:t=s.sent();s.label=5;case 5:t;r=["Executing lint-staged"];return[4,tD.lintStaged()];case 6:return[4,tQ.apply(void 0,r.concat([s.sent()]))];case 7:s.sent(),tX();return[2]}})})()}M(tz,"lintStaged");function tZ(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tD.eslintInspect()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(tZ,"inspectLint");function t0(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,tU()];case 1:e.sent();return[4,Promise.all([tW(),tJ()])];case 2:e.sent(),tX();return[2]}})})()}M(t0,"lintCheck");function t1(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,tU()];case 1:e.sent();return[4,Promise.all([tW(),tJ(!0)])];case 2:e.sent(),tX();return[2]}})})()}M(t1,"lintFix");function t2(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,tU()];case 1:t.sent();e=["Validating commit message"];return[4,tD.commitLint()];case 2:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tX();return[2]}})})()}M(t2,"commitLint");function t4(){return i(function(){var e,t,n,r;return x(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tD.configureGitHook()];case 1:return[4,tQ.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eP(tS.GIT_HOOK);return[4,tH(tO)];case 3:t=s.sent();eR(tS.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ez,"\n");eG(tS.GIT_IGNORE)?eN(tS.GIT_IGNORE,"utf-8").split("\n").includes(ez)||ex(tS.GIT_IGNORE,n):eR(tS.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,tD.simpleGitHooks()];case 4:return[4,tQ.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}M(t4,"setupGitHook");function t3(){return i(function(){return x(this,function(e){switch(e.label){case 0:return[4,tT()];case 1:e.sent();return[4,t4()];case 2:e.sent();return[2]}})})()}M(t3,"ready");function t5(){return i(function(){var e,t;return x(this,function(n){switch(n.label){case 0:eP(tS.NODE_MODULES,tS.PNPM_LOCK_YAML);e=["Pruning pnpm store"];return[4,tD.pnpmPruneStore()];case 1:return[4,tQ.apply(void 0,e.concat([n.sent()]))];case 2:n.sent();t=["Clearing pnpm cache"];return[4,tD.pnpmCleanCache()];case 3:return[4,tQ.apply(void 0,t.concat([n.sent()]))];case 4:n.sent();return[4,tT()];case 5:n.sent();return[4,t4()];case 6:n.sent();return[2]}})})()}M(t5,"reset");function t6(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tD.nodeModulesInspect()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t6,"inspect");function t8(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tD.testUnit()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t8,"testUnit");function t7(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tD.testE2e()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(t7,"testE2E");function t9(e){return i(function(){var t;return x(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,tD.mongoMigrateCreate(e)];case 1:return[4,tQ.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}M(t9,"mongoMigrateCreate");function ne(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,tD.mongoMigrateUp()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(ne,"mongoMigrateUp");function nt(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,tD.mongoMigrateDown()];case 1:return[4,tQ.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}M(nt,"mongoMigrateDown");(function(){return i(function(){var e;return x(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,ep(ed(el.argv)).scriptName(e3).usage("$0 <command> [options]").command("lint","Check code for linting issues",t0).command("lint:fix","Fix linting issues automatically",t1).command("lint:inspect","View active ESLint configuration",tZ).command("lint-staged","Run lint checks on staged files",tz).command("commitlint","Validate commit message format",t2).command("ready","Initialize project and dependencies",t3).command("reset","Reset the project and reinstall dependencies",t5).command("inspect","Analyze installed project dependencies",t6).command("test:unit","Run unit test suite",t8).command("test:e2e","Run end-to-end test suite",t7).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return i(function(){return x(this,function(t){switch(t.label){case 0:if(!e.name){ea.error("Migration name is required.");return[2]}return[4,t9(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",ne).command("mongo:migrate:down","Rollback last MongoDB migration",nt).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(ef.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();ec(e),el.exit(1);return[3,3];case 3:return[2]}})})()})();import{Router as nn}from"express";import{NestFactory as nr}from"@nestjs/core";import ns from"body-parser";import ni from"compression";import no from"cookie-parser";import na from"cors";import nc from"express";import nu from"express-session";import nl from"express-useragent";function nd(e){var t=e.isDev,n=e.whiteList,r=O(e,["isDev","whiteList"]);return y({origin:M(function(e,r){t||!e||(n===null||n===void 0?void 0:n.includes(e!==null&&e!==void 0?e:""))?r(null,!0):r(new Error("Not allowed by CORS"),!1)},"origin"),credentials:!0},r)}M(nd,"createCorsOptions");function np(e){return na(nd(e))}M(np,"createCors");function nf(e){return nu(e)}M(nf,"createSession");function nE(e){var t=nc();return t.set("trust proxy",1),t.use(no()),t.use(nc.urlencoded({extended:!0})),t.use(ni()),t.use(nl.express()),(e===null||e===void 0?void 0:e.staticFolder)&&t.use(nc.static(e.staticFolder)),t}M(nE,"createExpress");function nm(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:return[4,nr.create(e.module)];case 1:r=s.sent();return[2,(r.getHttpAdapter().getInstance().set("trust proxy",1),r.use(nc.urlencoded({extended:!0})),r.use(no()),r.use(ni()),r.use(nl.express()),e.staticFolder&&r.use(nc.static(e.staticFolder)),e.filters&&(t=r).useGlobalFilters.apply(t,b(e.filters)),e.pipes&&(n=r).useGlobalPipes.apply(n,b(e.pipes)),r)]}})})()}M(nm,"createNest");var ng="MONGO_MIGRATE_OPTIONS";import{Collection as nh,Db as ny}from"mongodb";import{Document as nv,Model as nS}from"mongoose";var nO=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(ny);M(nO,"C_Db");var nC=nO,nD=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nv);M(nD,"C_Document");var n_=nD,nI=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nS);M(nI,"C_Model");var nN=nI,nb=/*#__PURE__*/function(e){"use strict";p(t,e);function t(){a(this,t);return o(this,t,arguments)}return t}(nh);M(nb,"C_Collection");var nT=nb;import{format as nA}from"date-fns";import nR from"migrate-mongo";import{Document as nx}from"mongoose";import nG from"mongoose-aggregate-paginate-v2";import nP from"mongoose-paginate-v2";import{v4 as nM}from"uuid";import nw from"unorm";var nL={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},nj=Object.entries(nL).reduce(function(e,t){var n=I(t,2),r=n[0],s=n[1];return e[r.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function nk(e){e=nw.nfkc(e);var t=y({},nL,nj);var n=true,r=false,s=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),o;!(n=(o=i.next()).done);n=true){var a=I(o.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){r=true;s=e}finally{try{if(!n&&i.return!=null){i.return()}}finally{if(r){throw s}}}return e}M(nk,"regexSearchMapper");function nU(e){return(typeof e==="undefined"?"undefined":T(e))=="object"&&e!==null&&!Array.isArray(e)}M(nU,"isObject");function nF(e){return JSON.parse(JSON.stringify(e))}M(nF,"deepClone");function nV(e,t){return t.reduce(function(e,t){if(e&&(typeof e==="undefined"?"undefined":T(e))=="object"&&t in e)return e[t]},e)}M(nV,"getNestedValue");function nq(e,t,n){if(t.length===0)return e;var r=N(t),s=r[0],i=r.slice(1);if(i.length===0)return S(y({},e),l({},s,n));var o=e[s];return S(y({},e),l({},s,nq((typeof o==="undefined"?"undefined":T(o))=="object"&&o!==null?o:{},i,n)))}M(nq,"setNestedValue");import nY from"crypto-js";import nK from"slugify";var nB=nK.default||nK;function nH(e,t){var n=M(function(e){var n,r;return nB(e!==null&&e!==void 0?e:"",y({lower:(n=t===null||t===void 0?void 0:t.lower)!==null&&n!==void 0?n:!0,locale:(r=t===null||t===void 0?void 0:t.locale)!==null&&r!==void 0?r:"vi"},t))},"slugifyWithOptions");if(nU(e)){var r={};var s=true,i=false,o=undefined;try{for(var a=Object.entries(e)[Symbol.iterator](),c;!(s=(c=a.next()).done);s=true){var u=I(c.value,2),l=u[0],d=u[1];r[l]=n(d)}}catch(e){i=true;o=e}finally{try{if(!s&&a.return!=null){a.return()}}finally{if(i){throw o}}}return r}return n(e)}M(nH,"generateSlug");function nQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return nY.SHA256(e).toString(nY.enc.Hex).slice(0,t)}M(nQ,"generateShortId");var nW={isEmpty:function e(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":T(e))=="object"?f(e,Date)?!1:f(e,Map)||f(e,Set)?e.size===0:f(e,WeakMap)||f(e,WeakSet)?!0:ArrayBuffer.isView(e)?e.byteLength===0:Object.keys(e).length===0:!1},isValidIP:function e(e){var t=e.split(".");return t.length===4&&t.every(function(e){return/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255})?!0:/^(([a-f\d]{1,4}:){7}[a-f\d]{1,4}|((?:[a-f\d]{1,4}:){1,7}:)|((?:[a-f\d]{1,4}:){1,6}:[a-f\d]{1,4})|::)$/i.test(e)}};var nJ={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,n=t===void 0?"string":t;var r=n==="string"?nJ.getDateTime():new Date;return{id:nM(),isDel:!1,createdAt:r,updatedAt:r}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var n=t.method,r=t.pre,s=t.post;n&&r&&e.pre(n,r),n&&s&&e.post(n,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:nM,unique:!0},isDel:{type:Boolean,default:!1}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,n=e.schema,r=e.virtuals,s=r===void 0?[]:r,i=e.standalone,o=i===void 0?!1:i;var a=new t.Schema(n);return s.forEach(function(e){var t=e.name,n=e.options,r=e.get;var s=a.virtual(t,n);r&&s.get(r)}),o||a.add(nJ.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,n=e.name,r=e.schema,s=e.pagination,i=s===void 0?!1:s,o=e.aggregate,a=o===void 0?!1:o,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!n)throw new Error("Model name is required.");if(t.models[n])return t.models[n];var p=nJ.createSchema({mongoose:t,schema:r,virtuals:u});return nJ.applyPlugins(p,[i&&nP,a&&nG]),nJ.applyMiddlewares(p,d),t.model(n,p)},validator:{isRequired:function e(){return function(e){return i(function(){return x(this,function(t){return[2,!nW.isEmpty(e)]})})()}},isUnique:function e(e){return function(t){return i(function(){var n;return x(this,function(r){switch(r.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");n={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.exists(n)];case 1:return[2,!r.sent()]}})}).call(this)}},matchesRegex:function e(e){return function(t){return i(function(){return x(this,function(n){if(!Array.isArray(e)||e.some(function(e){return!f(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})})()}}},migrate:S(y({},nR),{setConfig:M(function(e){var t="// This file is automatically generated by the Cyberskill CLI.\nmodule.exports = ".concat(JSON.stringify(e,null,4));eR(tS.MIGRATE_MONGO_CONFIG,t);var n="\n".concat(e2,"\n");eG(tS.GIT_IGNORE)?eN(tS.GIT_IGNORE,"utf-8").split("\n").includes(e2)||ex(tS.GIT_IGNORE,n):eR(tS.GIT_IGNORE,n)},"setConfig")}),regexify:function e(e,t){if(!e)return{};var n=nF(e);if(!t||t.length===0)return n;var r=true,s=false,i=undefined;try{for(var o=t[Symbol.iterator](),a;!(r=(a=o.next()).done);r=true){var c=a.value;var u=c.toString().split("."),l=nV(n,u);if(typeof l=="string"&&l.length>0){var d={$regex:".*".concat(nk(l),".*"),$options:"i"};n=nq(n,u,d)}}}catch(e){s=true;i=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(s){throw i}}}return n}},n$=/*#__PURE__*/function(){"use strict";function e(t,n){a(this,e);w(this,"collection");this.collection=t.collection(n)}u(e,[{key:"createOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t=y({},nJ.createGenericFields(),e);return[4,this.collection.insertOne(t)];case 1:return[2,r.sent().acknowledged?{success:!0,message:"Document created successfully",result:t}:{success:!1,message:"Document creation failed",code:er.INTERNAL_SERVER_ERROR.CODE}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(){var t,n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);t=e.map(function(e){return y({},nJ.createGenericFields(),e)});return[4,this.collection.insertMany(t)];case 1:n=s.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:t}];case 2:r=s.sent();return[2,ec(r)];case 3:return[2]}})}).call(this)}},{key:"findOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.findOne(e)];case 1:t=r.sent();return[2,t?{success:!0,message:"Document found",result:t}:{success:!1,message:"Document not found",code:er.NOT_FOUND.CODE}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"findAll",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Documents retrieved successfully"};return[4,this.collection.find(e).toArray()];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,ec(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0,message:"Count retrieved successfully"};return[4,this.collection.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,ec(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateOne(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document updated successfully",result:n}];case 2:r=s.sent();return[2,ec(r)];case 3:return[2]}})}).call(this)}},{key:"updateMany",value:function e(e,t){return i(function(){var n,r;return x(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,this.collection.updateMany(e,{$set:t})];case 1:n=s.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents updated successfully",result:n}];case 2:r=s.sent();return[2,ec(r)];case 3:return[2]}})}).call(this)}},{key:"deleteOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteOne(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Document deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"deleteMany",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,this.collection.deleteMany(e)];case 1:t=r.sent();return[2,t.deletedCount===0?{success:!1,message:"No documents matched the filter",code:er.INTERNAL_SERVER_ERROR.CODE}:{success:!0,message:"Documents deleted successfully",result:t}];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(n$,"MongoController");var nX=n$,nz=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);w(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.findOne(e,t,n);r&&s.populate(r);return[4,s.exec()];case 2:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(this.getModelName()," found."),code:er.NOT_FOUND.CODE}];case 3:o=c.sent();return[2,ec(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findAll",value:function e(e){return i(function(){var e,t,n,r,s,i,o;var a=arguments;return x(this,function(c){switch(c.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:{},t=a.length>1&&a[1]!==void 0?a[1]:{},n=a.length>2&&a[2]!==void 0?a[2]:{},r=a.length>3?a[3]:void 0;c.label=1;case 1:c.trys.push([1,3,,4]);s=this.model.find(e,t,n);r&&s.populate(r);i={success:!0};return[4,s.exec()];case 2:return[2,(i.result=c.sent(),i)];case 3:o=c.sent();return[2,ec(o)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPaging",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.paginate(e,t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"findPagingAggregate",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.aggregatePaginate(this.model.aggregate(e),t)];case 2:return[2,(n.result=i.sent(),n)];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"count",value:function e(){return i(function(){var e,t,n;var r=arguments;return x(this,function(s){switch(s.label){case 0:e=r.length>0&&r[0]!==void 0?r[0]:{};s.label=1;case 1:s.trys.push([1,3,,4]);t={success:!0};return[4,this.model.countDocuments(e)];case 2:return[2,(t.result=s.sent(),t)];case 3:n=s.sent();return[2,ec(n)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createOne",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.create(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}},{key:"createMany",value:function e(e){return i(function(e){var t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);n={success:!0};return[4,this.model.insertMany(e,t)];case 2:return[2,(n.result=i.sent().map(function(e){return f(e,nx)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateOne",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.model.findOneAndUpdate(e,t,y({new:!0},n)).exec()];case 2:r=o.sent();return[2,r?{success:!0,result:r}:{success:!1,message:"Failed to update ".concat(this.getModelName(),"."),code:er.NOT_FOUND.CODE}];case 3:s=o.sent();return[2,ec(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"updateMany",value:function e(){return i(function(){var e,t,n,r,s;var i=arguments;return x(this,function(o){switch(o.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:{},t=i.length>1&&i[1]!==void 0?i[1]:{},n=i.length>2&&i[2]!==void 0?i[2]:{};o.label=1;case 1:o.trys.push([1,3,,4]);r={success:!0};return[4,this.model.updateMany(e,t,n).exec()];case 2:return[2,(r.result=o.sent(),r)];case 3:s=o.sent();return[2,ec(s)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteOne",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.findOneAndDelete(e,t).exec()];case 2:n=i.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(this.getModelName()," found to delete."),code:er.NOT_FOUND.CODE}];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"deleteMany",value:function e(){return i(function(){var e,t,n,r;var s=arguments;return x(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:{},t=s.length>1&&s[1]!==void 0?s[1]:{};i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.model.deleteMany(e,t).exec()];case 2:n=i.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:er.NOT_FOUND.CODE}:{success:!0,result:n}];case 3:r=i.sent();return[2,ec(r)];case 4:return[2]}})}).apply(this,arguments)}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return i(function(){var n,r,s,i,o;return x(this,function(a){switch(a.label){case 0:a.trys.push([0,6,,7]);n=new Set;r=0;a.label=1;case 1:if(!(r<10))return[3,5];s=nQ(e,r+t);i=!n.has(s);if(!i)return[3,3];n.add(s);return[4,this.model.exists({shortId:s})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:s}];a.label=4;case 4:r++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:er.INTERNAL_SERVER_ERROR.CODE}];case 6:o=a.sent();return[2,ec(o)];case 7:return[2]}})}).call(this)}},{key:"createSlugQuery",value:function e(e){var t=e.slug,n=e.field,r=e.isObject,s=e.filter;var i=y({},s!==null&&s!==void 0?s:{});return r?S(y({},i),{$or:[l({},"slug.".concat(n),t),{slugHistory:{$elemMatch:l({},"slug.".concat(n),t)}}]}):S(y({},i),{$or:[{slug:t},{slugHistory:t}]})}},{key:"createUniqueSlug",value:function e(e){return i(function(e){var t,n,r,s,i,o,a;return x(this,function(c){switch(c.label){case 0:t=e.slug,n=e.field,r=e.isObject,s=e.filter;i=nH(t),o=i,a=1;c.label=1;case 1:return[4,this.model.exists(this.createSlugQuery({slug:o,field:n,isObject:r,filter:s}))];case 2:if(!c.sent())return[3,4];o="".concat(i,"-").concat(a++);c.label=3;case 3:return[3,1];case 4:return[2,o]}})}).apply(this,arguments)}},{key:"createSlug",value:function e(e){return i(function(e){var t,n,r,s,o,a,c,u,l,d;return x(this,function(p){switch(p.label){case 0:t=this;n=e.field,r=e.from,s=e.filter;p.label=1;case 1:p.trys.push([1,6,,7]);o=r[n];if(!nU(o))return[3,3];c={success:!0};u=Object.fromEntries;return[4,Promise.all(Object.entries(o).map(function(e){var n=I(e,2),r=n[0],o=n[1];return i(function(){var e;return x(this,function(t){switch(t.label){case 0:return[4,this.createUniqueSlug({slug:o,field:r,isObject:!0,filter:s})];case 1:e=t.sent();return[2,[r,e]]}})}).call(t)}))];case 2:a=(c.result=u.apply(Object,[p.sent()]),c);return[3,5];case 3:l={success:!0};return[4,this.createUniqueSlug({slug:o,field:n,isObject:!1,filter:s})];case 4:a=(l.result=p.sent(),l);p.label=5;case 5:return[2,a];case 6:d=p.sent();return[2,ec(d)];case 7:return[2]}})}).apply(this,arguments)}},{key:"checkSlug",value:function e(e){return i(function(e){var t,n,r,s,i,o,a,c,u,l,d,p,f,E,m,g;return x(this,function(h){switch(h.label){case 0:t=e.slug,n=e.field,r=e.from,s=e.filter;h.label=1;case 1:h.trys.push([1,12,,13]);i=r[n];if(!nU(i))return[3,10];o=true,a=false,c=undefined;h.label=2;case 2:h.trys.push([2,7,8,9]);u=Object.values(i)[Symbol.iterator]();h.label=3;case 3:if(!!(o=(l=u.next()).done))return[3,6];d=l.value;p=nH(d);return[4,this.model.exists(this.createSlugQuery({slug:p,field:n,isObject:!0,filter:s}))];case 4:if(h.sent())return[2,{success:!0,result:!0}];h.label=5;case 5:o=true;return[3,3];case 6:return[3,9];case 7:f=h.sent();a=true;c=f;return[3,9];case 8:try{if(!o&&u.return!=null){u.return()}}finally{if(a){throw c}}return[7];case 9:return[2,{success:!0,result:!1}];case 10:E=nH(t);m={success:!0};return[4,this.model.exists(this.createSlugQuery({slug:E,field:n,isObject:!1,filter:s}))];case 11:return[2,(m.result=h.sent()!==null,m)];case 12:g=h.sent();return[2,ec(g)];case 13:return[2]}})}).apply(this,arguments)}},{key:"aggregate",value:function e(e){return i(function(){var t,n;return x(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);t={success:!0};return[4,this.model.aggregate(e)];case 1:return[2,(t.result=r.sent(),t)];case 2:n=r.sent();return[2,ec(n)];case 3:return[2]}})}).call(this)}}]);return e}();M(nz,"MongooseController");var nZ=nz;import{useServer as n0}from"graphql-ws/use/ws";import{WebSocketServer as n1}from"ws";function n2(e){return new n1({server:e.server,path:e.path})}M(n2,"createWSServer");function n4(e){return n0({schema:e.schema},e.server)}M(n4,"initGraphQLWS");export{eH as BUILD_DIRECTORY,tr as COMMIT_LINT_CLI,tn as COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME,tt as COMMIT_LINT_PACKAGE_NAME,e3 as CYBERSKILL_CLI,e5 as CYBERSKILL_CLI_PATH,e4 as CYBERSKILL_DIRECTORY,eK as CYBERSKILL_PACKAGE_NAME,nT as C_Collection,nC as C_Db,n_ as C_Document,nN as C_Model,e8 as ESLINT_CLI,tm as ESLINT_INSPECT_CLI,tE as ESLINT_INSPECT_PACKAGE_NAME,e6 as ESLINT_PACKAGE_NAME,eE as E_CommandType,V as E_IssueType,ey as E_PackageType,tu as GIT_CLI,e1 as GIT_COMMIT_EDITMSG,e0 as GIT_HOOK,eX as GIT_IGNORE,ti as LINT_STAGED_CLI,ts as LINT_STAGED_PACKAGE_NAME,tv as MIGRATE_MONGO_CLI,e2 as MIGRATE_MONGO_CONFIG,ty as MIGRATE_MONGO_PACKAGE_NAME,ng as MONGO_MIGRATE_OPTIONS,nX as MongoController,nZ as MongooseController,eB as NODE_MODULES,th as NODE_MODULES_INSPECT_CLI,tg as NODE_MODULES_INSPECT_PACKAGE_NAME,eW as PACKAGE_JSON,eJ as PACKAGE_LOCK_JSON,tS as PATH,e9 as PLAYWRIGHT_PACKAGE_NAME,tl as PNPM_CLI,td as PNPM_EXEC_CLI,eZ as PNPM_LOCK_YAML,eQ as PUBLIC_DIRECTORY,nn as Router,tp as SIMPLE_GIT_HOOKS_PACKAGE_NAME,tf as SIMPLE_GIT_HOOK_CLI,ez as SIMPLE_GIT_HOOK_JSON,e$ as TSCONFIG_JSON,ta as TSC_CLI,to as TSC_PACKAGE_NAME,tc as TSX_CLI,te as VITEST_CLI,e7 as VITEST_PACKAGE_NAME,eY as WORKING_DIRECTORY,nG as aggregatePaginate,ex as appendFileSync,ns as bodyParser,ec as catchError,tU as clearAllErrorLists,tD as command,eM as copySync,eu as createApolloServer,np as createCors,nd as createCorsOptions,nE as createExpress,tO as createGitHooksConfig,nm as createNest,nf as createSession,n2 as createWSServer,nc as express,j as expressMiddleware,tB as formatCommand,eC as fs,tI as getLatestPackageVersion,tN as getPackage,tk as getStoredErrorLists,n4 as initGraphQLWS,tT as installDependencies,eV as join,ea as log,eD as lstatSync,eI as mkdirSync,nJ as mongo,nP as mongoosePaginate,ek as path,eG as pathExistsSync,tY as rawCommand,eN as readFileSync,eA as readJsonSync,e_ as readdirSync,eP as removeSync,eF as resolve,tH as resolveCommands,eU as resolveWorkingPath,tQ as runCommand,tA as setupPackages,eT as statSync,tP as storage,ei as throwError,eb as unlinkSync,tb as updatePackage,eR as writeFileSync};
|
package/dist/react/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,a,i){try{var u=e[a](i);var l=u.value}catch(e){t(e);return}if(u.done){r(l)}else{Promise.resolve(l).then(n,o)}}function a(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var i=e.apply(r,t);function u(e){o(i,n,a,u,l,"next",e)}function l(e){o(i,n,a,u,l,"throw",e)}u(undefined)})}}function i(e,r,t){r=E(r);return y(e,I()?Reflect.construct(r,t||[],E(e).constructor):r.apply(e,t))}function u(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function c(e,r,t){if(r)l(e.prototype,r);if(t)l(e,t);return e}function s(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function f(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)b(e,r)}function d(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var i,u;try{for(t=t.call(e);!(o=(i=t.next()).done);o=true){n.push(i.value);if(r&&n.length===r)break}}catch(e){a=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw u}}return n}function S(){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 m(){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 A(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){s(e,r,t[r])})}return e}function _(e,r){if(e==null)return{};var t=O(e,r);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function O(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function y(e,r){if(r&&(T(r)==="object"||typeof r==="function")){return r}return n(e)}function b(e,r){b=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return b(e,r)}function h(e,t){return r(e)||p(e,t)||N(e,t)||S()}function g(e){return t(e)||v(e)||N(e)||m()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function N(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.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(r,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}function C(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return l([e,r])}}function l(u){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var D=Object.create;var R=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var P=function(e,r,t){return r in e?R(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var U=function(e,r){return R(e,"name",{value:r,configurable:!0})};var x=function(e,r){for(var t in r)R(e,t,{get:r[t],enumerable:!0})},k=function(e,r,t,n){var o=true,a=false,i=undefined;if(r&&(typeof r==="undefined"?"undefined":T(r))=="object"||typeof r=="function")try{var u=function(){var o=c.value;!G.call(e,o)&&o!==t&&R(e,o,{get:function(){return r[o]},enumerable:!(n=L(r,o))||n.enumerable})};for(var l=w(r)[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw i}}}return e};var q=function(e,r,t){return t=e!=null?D(M(e)):{},k(r||!e||!e.__esModule?R(t,"default",{value:e,enumerable:!0}):t,e)},Q=function(e){return k(R({},"__esModule",{value:!0}),e)};var F=function(e,r,t){return P(e,(typeof r==="undefined"?"undefined":T(r))!="symbol"?r+"":r,t)};var j={};x(j,{ApolloErrorComponent:function(){return en},ApolloErrorContext:function(){return er},ApolloErrorProvider:function(){return es},ApolloProvider:function(){return eO},GRAPHQL_URI_DEFAULT:function(){return eS},Loading:function(){return eR},LoadingContext:function(){return ew},LoadingProvider:function(){return eU},NEXT_INTL_DEFAULT_LANGUAGE:function(){return ek},NextIntlContext:function(){return eQ},NextIntlProvider:function(){return e4},Toaster:function(){return ep.Toaster},catchError:function(){return ev},initI18next:function(){return eN},log:function(){return ed},setGlobalApolloErrorCallback:function(){return el},showGlobalApolloError:function(){return ec},storage:function(){return e$},toast:function(){return ep.toast},useApolloError:function(){return ea},useLazyQuery:function(){return ey.useLazyQuery},useLoading:function(){return eG},useMutation:function(){return ey.useMutation},useNextIntl:function(){return eB},useQuery:function(){return ey.useQuery},useStorage:function(){return e0},useSubscription:function(){return ey.useSubscription},useTranslateI18next:function(){return eh},useTranslateNextIntl:function(){return eV},withNextIntl:function(){return eY}});module.exports=Q(j);var z=require("@apollo/client/core/core.cjs"),H=require("@apollo/client/link/core/core.cjs"),B=require("@apollo/client/link/error/error.cjs"),V=require("@apollo/client/link/http/http.cjs"),Y=require("@apollo/client/link/remove-typename/remove-typename.cjs"),W=require("@apollo/client/link/subscriptions/subscriptions.cjs"),J=require("@apollo/client/react/react.cjs"),X=require("@apollo/client/utilities/utilities.cjs"),K=require("graphql-ws"),Z=q(require("react"),1);var $=q(require("react"),1);var ee=require("react"),er=(0,ee.createContext)(void 0);var et={"modal-backdrop":"_modal-backdrop_8fveh_1","modal-content":"_modal-content_8fveh_11","btn-close":"_btn-close_8fveh_22","error-title":"_error-title_8fveh_36","btn-retry":"_btn-retry_8fveh_41","error-details":"_error-details_8fveh_54",main:"_main_8fveh_72",network:"_network_8fveh_75",extra:"_extra_8fveh_78"};function en(){var e=(0,$.use)(er),r=e===null||e===void 0?void 0:e.error;if(!r)return null;var t=U(function(e,r){return(r===null||r===void 0?void 0:r.length)?$.default.createElement("div",null,$.default.createElement("strong",null,e,":"),$.default.createElement("ul",null,r.map(function(e){return $.default.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return $.default.createElement("div",{className:et["modal-backdrop"]},$.default.createElement("div",{className:et["modal-content"]},$.default.createElement("button",{type:"button",className:et["btn-close"],onClick:e.hideError},"✕"),$.default.createElement("div",{className:et["error-title"]},$.default.createElement("button",{type:"button",className:et["btn-retry"],onClick:U(function(){return window.location.reload()},"onClick")},"Reload")," ",r.message),$.default.createElement("div",{className:et["error-details"]},r.networkError&&$.default.createElement("pre",{className:"network"},$.default.createElement("strong",null,"Network Error:")," ",r.networkError.message),t("GraphQL Errors",g(r.graphQLErrors)),t("Protocol Errors",g(r.protocolErrors)),t("Client Errors",g(r.clientErrors)),r.extraInfo&&$.default.createElement("pre",{className:"extra"},$.default.createElement("strong",null,"Extra Info:")," ",JSON.stringify(r.extraInfo,null,4)))))}U(en,"ApolloErrorComponent");var eo=require("react");function ea(){var e=(0,eo.use)(er);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}U(ea,"useApolloError");var ei=q(require("react"),1);var eu=null;function el(e){eu=e}U(el,"setGlobalApolloErrorCallback");function ec(e){eu===null||eu===void 0?void 0:eu(e)}U(ec,"showGlobalApolloError");function es(e){var r=e.children;var t=h((0,ei.useState)(null),2),n=t[0],o=t[1];(0,ei.useEffect)(function(){el(o)},[]);var a=(0,ei.useMemo)(function(){return{error:n,showError:o,hideError:U(function(){return o(null)},"hideError")}},[n]);return ei.default.createElement(er,{value:a},r)}U(es,"ApolloErrorProvider");var eE=require("consola/browser");var ef={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 ed={silent:eE.consola.silent,level:eE.consola.level,fatal:eE.consola.fatal,error:eE.consola.error,warn:eE.consola.warn,log:eE.consola.log,info:eE.consola.info,success:eE.consola.success,ready:eE.consola.ready,start:eE.consola.start,box:eE.consola.box,debug:eE.consola.debug,trace:eE.consola.trace,verbose:eE.consola.verbose};function ev(e,r){var t=r!==null&&r!==void 0?r:{},n=t.shouldLog,o=n===void 0?!0:n,a=t.returnValue,i=t.callback,u=d(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return o&&ed.error(u.message),i&&typeof i=="function"&&i(u),a||{success:!1,message:u.message,code:ef.INTERNAL_SERVER_ERROR.CODE}}U(ev,"catchError");var ep=require("react-hot-toast");var eS="/graphql";var em,eA=(em=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);F(e,"count",0);return e}c(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-n,a=e.operationName||"Unnamed";return ed.info("[Apollo] #".concat(t.count,": ").concat(a," (").concat(o,"ms)")),r})}}]);return r}(H.ApolloLink),U(em,"DevLoggerLink"),em);function e_(e){var r=e.uri,t=e.wsUrl,n=e.customLinks,o=new eA,a=(0,B.onError)(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,o=e.operation;var a=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;ed.error("[GraphQL error] ".concat(a,": ").concat(r,", Location: ").concat(JSON.stringify(t,null,4),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;ed.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t,null,4)))}),t&&ed.error("[Network error]: ".concat(t)),r||n||t){var i,u;var l=(r===null||r===void 0?void 0:(i=r[0])===null||i===void 0?void 0:i.message)||(n===null||n===void 0?void 0:(u=n[0])===null||u===void 0?void 0:u.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",c=new z.ApolloError({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:l,extraInfo:{operation:o}});ep.toast.error(function(e){return Z.default.createElement(Z.default.Fragment,null,l,"\xa0",Z.default.createElement("button",{type:"button",onClick:U(function(){setTimeout(function(){ec(c)},0),ep.toast.dismiss(e.id)},"onClick")},"Show Details"))})}}),i=(0,Y.removeTypenameFromVariables)();r||ed.warn('[Apollo] No GraphQL URI provided — using "'.concat(eS,'" as default'));var u=new V.HttpLink({uri:r!==null&&r!==void 0?r:eS,credentials:"include"}),l=t?new W.GraphQLWsLink((0,K.createClient)({url:t})):H.ApolloLink.empty(),c=d(l,H.ApolloLink)?(0,H.split)(function(e){var r=e.query;var t=(0,X.getMainDefinition)(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},l,u):u;return c===u&&t&&ed.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[o,a,i].concat(g(n!==null&&n!==void 0?n:[]),[c])}U(e_,"createApolloLinks");function eO(e){var r=e.isNextJS,t=e.options,n=e.children,o=e.client,a=e.provider,i=e.cache;var u=t||{},l=u.uri,c=u.wsUrl,s=u.customLinks,E=_(u,["uri","wsUrl","customLinks"]),f=o!==null&&o!==void 0?o:z.ApolloClient;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var v=a||J.ApolloProvider,p=(0,Z.useMemo)(function(){return(0,H.from)(e_({uri:l!==null&&l!==void 0?l:eS,wsUrl:c!==null&&c!==void 0?c:"",customLinks:s!==null&&s!==void 0?s:[]}))},[l,c,s]),S=(0,Z.useMemo)(function(){return d(i,z.InMemoryCache)?i:new z.InMemoryCache},[i]),m=(0,Z.useMemo)(function(){return new f(A({link:p,cache:S},E))},[f,p,S,E]),O=r?Z.default.createElement(v,{makeClient:U(function(){return m},"makeClient")},n):Z.default.createElement(v,{client:m},n);return Z.default.createElement(Z.default.Fragment,null,Z.default.createElement(es,null,O,Z.default.createElement(en,null)),Z.default.createElement(ep.Toaster,{position:"top-right"}))}U(eO,"ApolloProvider");var ey=require("@apollo/client/react/hooks/hooks.cjs");var eb=require("react-i18next"),eh=eb.useTranslation;var eg=q(require("i18next"),1),eT=require("react-i18next");function eN(e){return eg.default.use(eT.initReactI18next).init(e)}U(eN,"initI18next");var eI=q(require("clsx"),1),eC=q(require("react"),1);var eD={overlay:"_overlay_1bty8_1",fullscreen:"_fullscreen_1bty8_1",block:"_block_1bty8_2","overlay-fade-in":"_overlay-fade-in_1bty8_1",container:"_container_1bty8_47",ring:"_ring_1bty8_54",rotate1:"_rotate1_1bty8_1",rotate2:"_rotate2_1bty8_1",rotate3:"_rotate3_1bty8_1",rotate4:"_rotate4_1bty8_1",message:"_message_1bty8_83","text-fade":"_text-fade_1bty8_1"};function eR(e){var r=e.full,t=r===void 0?!1:r,n=e.block,o=n===void 0?!1:n,a=e.className,i=a===void 0?"":a,u=e.message,l=u===void 0?"Loading":u,c=_(e,["full","block","className","message"]);function s(){return eC.default.createElement("div",A({className:eD.container},c),eC.default.createElement("div",{className:eD.ring}),eC.default.createElement("div",{className:eD.ring}),eC.default.createElement("div",{className:eD.ring}),eC.default.createElement("div",{className:eD.ring}),l&&eC.default.createElement("div",{className:eD.message},l))}return U(s,"_renderLoading"),t?eC.default.createElement("div",{className:(0,eI.default)(eD.fullscreen,i)},s()):o?eC.default.createElement("div",{className:(0,eI.default)(eD.block,i)},s()):s()}U(eR,"Loading");var eL=require("react"),ew=(0,eL.createContext)(void 0);var eM=require("react");function eG(){var e=(0,eM.use)(ew);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}U(eG,"useLoading");var eP=q(require("react"),1);function eU(e){var r=e.children;var t=h((0,eP.useState)(!1),2),n=t[0],o=t[1],a=h((0,eP.useState)(!1),2),i=a[0],u=a[1],l=(0,eP.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),u(e)},[]),c=(0,eP.useCallback)(function(){o(!1),u(!1)},[]),s=(0,eP.useMemo)(function(){return{isLoading:n,isGlobalLoading:i,showLoading:l,hideLoading:c}},[n,i,l,c]);return eP.default.createElement(ew,{value:s},n?eP.default.createElement(eR,{full:i}):r)}U(eU,"LoadingProvider");var ex=require("date-fns/locale"),ek={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:ex.enUS,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};var eq=require("react"),eQ=(0,eq.createContext)(void 0);var eF=require("next-intl"),ej=q(require("react"),1);var ez=require("next-intl"),eH=require("react");function eB(){var e=(0,eH.use)(eQ);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}U(eB,"useNextIntl");var eV=ez.useTranslations;function eY(e){var r=U(function(r){var t;var n;var o=eB(),a=o.currentLanguage,i=r.messages,u=r.languages,l="en",c=i[(a===null||a===void 0?void 0:a.value)||l],s=(n=(t=u.find(function(e){return e.value===(a===null||a===void 0?void 0:a.value)}))===null||t===void 0?void 0:t.timezone)!==null&&n!==void 0?n:ek.timezone;return i?ej.default.createElement(eF.NextIntlClientProvider,{locale:(a===null||a===void 0?void 0:a.value)||l,messages:c||null,timeZone:s},ej.default.createElement(e,r)):(ed.warn("Missing messages for language: ".concat((a===null||a===void 0?void 0:a.value)||l)),null)},"PageWithI18n");return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}U(eY,"withNextIntl");var eW=q(require("react"),1);var eJ=require("react");var eX={Date:{is:U(function(e){return d(e,Date)},"is"),serialize:U(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:U(function(e){return new Date(e)},"deserialize")},Map:{is:U(function(e){return d(e,Map)},"is"),serialize:U(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:U(function(e){return new Map(e)},"deserialize")},Set:{is:U(function(e){return d(e,Set)},"is"),serialize:U(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:U(function(e){return new Set(e)},"deserialize")},RegExp:{is:U(function(e){return d(e,RegExp)},"is"),serialize:U(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:U(function(e){var r=e.source,t=e.flags;return new RegExp(r,t)},"deserialize")},BigInt:{is:U(function(e){return(typeof e==="undefined"?"undefined":T(e))=="bigint"},"is"),serialize:U(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:U(function(e){return BigInt(e)},"deserialize")}},eK={serialize:function e(e){return JSON.stringify(e,function(e,r){var t=true,n=false,o=undefined;try{for(var a=Object.keys(eX)[Symbol.iterator](),i;!(t=(i=a.next()).done);t=true){var u=i.value;var l=eX[u];if(l.is(r))return l.serialize(r)}}catch(e){n=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return r})},deserialize:function e(e){return JSON.parse(e,function(e,r){if(r&&(typeof r==="undefined"?"undefined":T(r))=="object"&&"__type"in r&&typeof r.__type=="string"){var t=r.__type,n=eX[t];if(n)return n.deserialize(r.value)}return r})}};var eZ=q(require("localforage"),1);var e$={get:function e(e){return a(function(){var r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eZ.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,ev(r,{returnValue:null})];case 3:return[2]}})})()},set:function e(e,r){return a(function(){var t;return C(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,eZ.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();ev(t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return a(function(){var r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eZ.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();ev(r);return[3,3];case 3:return[2]}})})()},keys:function e(){return a(function(){var e,r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eZ.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,ev(r,{returnValue:[]})];case 3:return[2]}})})()}};function e0(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eK;var n=h((0,eJ.useState)(r),2),o=n[0],i=n[1],u=h((0,eJ.useState)(!1),2),l=u[0],c=u[1];(0,eJ.useEffect)(function(){var n=!0;return U(function(){return a(function(){var o,a,u,l;return C(this,function(s){switch(s.label){case 0:s.trys.push([0,6,7,8]);return[4,e$.get(e)];case 1:o=s.sent();if(!n)return[3,5];if(!(o!==null))return[3,2];a=t.deserialize(o);i(a);return[3,5];case 2:if(!(r!==void 0))return[3,4];u=t.serialize(r);return[4,e$.set(e,u)];case 3:s.sent(),i(r);return[3,5];case 4:i(void 0);s.label=5;case 5:return[3,8];case 6:l=s.sent();ev(l),n&&i(r);return[3,8];case 7:n&&c(!0);return[7];case 8:return[2]}})})()},"loadValue")(),function(){n=!1,c(!1)}},[e,r,t]),(0,eJ.useEffect)(function(){if(!l)return;U(function(){return a(function(){var r,n;return C(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,e$.set(e,r)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:n=a.sent();ev(n);return[3,4];case 4:return[2]}})})()},"saveValue")()},[o,e,t,l]);var s=(0,eJ.useCallback)(function(e){i(function(r){return typeof e=="function"?e(r):e})},[]),E=(0,eJ.useCallback)(function(){return a(function(){var r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e$.remove(e)];case 1:t.sent(),i(void 0);return[3,3];case 2:r=t.sent();ev(r);return[3,3];case 3:return[2]}})})()},[e]);return{value:o,set:s,remove:E}}U(e0,"useStorage");function e1(e){var r=e.children;return eW.default.createElement(eW.default.Fragment,null,r)}U(e1,"LanguageWrapperBase");var e2=eY(e1);function e4(e){var r=e.children,t=e.languages,n=e.messages;var o=e0("lang",t[0]),a=o.value,i=o.set,u=(0,eW.useMemo)(function(){return{languages:t,currentLanguage:a!==null&&a!==void 0?a:ek,setCurrentLanguage:i}},[t,i,a]);return eW.default.createElement(eQ,{value:u},eW.default.createElement(e2,{languages:t,messages:n},r))}U(e4,"NextIntlProvider");0&&(module.exports={ApolloErrorComponent:ApolloErrorComponent,ApolloErrorContext:ApolloErrorContext,ApolloErrorProvider:ApolloErrorProvider,ApolloProvider:ApolloProvider,GRAPHQL_URI_DEFAULT:GRAPHQL_URI_DEFAULT,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NEXT_INTL_DEFAULT_LANGUAGE:NEXT_INTL_DEFAULT_LANGUAGE,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,Toaster:Toaster,catchError:catchError,initI18next:initI18next,log:log,setGlobalApolloErrorCallback:setGlobalApolloErrorCallback,showGlobalApolloError:showGlobalApolloError,storage:storage,toast:toast,useApolloError:useApolloError,useLazyQuery:useLazyQuery,useLoading:useLoading,useMutation:useMutation,useNextIntl:useNextIntl,useQuery:useQuery,useStorage:useStorage,useSubscription:useSubscription,useTranslateI18next:useTranslateI18next,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,a,i){try{var u=e[a](i);var l=u.value}catch(e){t(e);return}if(u.done){r(l)}else{Promise.resolve(l).then(n,o)}}function a(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var i=e.apply(r,t);function u(e){o(i,n,a,u,l,"next",e)}function l(e){o(i,n,a,u,l,"throw",e)}u(undefined)})}}function i(e,r,t){r=E(r);return y(e,I()?Reflect.construct(r,t||[],E(e).constructor):r.apply(e,t))}function u(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function c(e,r,t){if(r)l(e.prototype,r);if(t)l(e,t);return e}function s(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function E(e){E=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return E(e)}function f(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)h(e,r)}function d(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function v(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function p(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var i,u;try{for(t=t.call(e);!(o=(i=t.next()).done);o=true){n.push(i.value);if(r&&n.length===r)break}}catch(e){a=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw u}}return n}function S(){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 m(){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 A(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){s(e,r,t[r])})}return e}function _(e,r){if(e==null)return{};var t=O(e,r);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function O(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,a;for(a=0;a<n.length;a++){o=n[a];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function y(e,r){if(r&&(T(r)==="object"||typeof r==="function")){return r}return n(e)}function h(e,r){h=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return h(e,r)}function g(e,t){return r(e)||p(e,t)||N(e,t)||S()}function b(e){return t(e)||v(e)||N(e)||m()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function N(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.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(r,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}function C(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=u(0),i["throw"]=u(1),i["return"]=u(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return l([e,r])}}function l(u){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var D=Object.create;var R=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var P=function(e,r,t){return r in e?R(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t};var x=function(e,r){return R(e,"name",{value:r,configurable:!0})};var k=function(e,r){for(var t in r)R(e,t,{get:r[t],enumerable:!0})},U=function(e,r,t,n){var o=true,a=false,i=undefined;if(r&&(typeof r==="undefined"?"undefined":T(r))=="object"||typeof r=="function")try{var u=function(){var o=c.value;!G.call(e,o)&&o!==t&&R(e,o,{get:function(){return r[o]},enumerable:!(n=L(r,o))||n.enumerable})};for(var l=w(r)[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(e){a=true;i=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(a){throw i}}}return e};var q=function(e,r,t){return t=e!=null?D(M(e)):{},U(r||!e||!e.__esModule?R(t,"default",{value:e,enumerable:!0}):t,e)},Q=function(e){return U(R({},"__esModule",{value:!0}),e)};var F=function(e,r,t){return P(e,(typeof r==="undefined"?"undefined":T(r))!="symbol"?r+"":r,t)};var j={};k(j,{ApolloErrorComponent:function(){return en},ApolloErrorContext:function(){return er},ApolloErrorProvider:function(){return es},ApolloProvider:function(){return eO},GRAPHQL_URI_DEFAULT:function(){return eS},Loading:function(){return eL},LoadingContext:function(){return eM},LoadingProvider:function(){return ek},NEXT_INTL_DEFAULT_LANGUAGE:function(){return eq},NextIntlContext:function(){return eF},NextIntlProvider:function(){return e3},Toaster:function(){return ep.Toaster},catchError:function(){return ev},initI18next:function(){return eN},log:function(){return ed},setGlobalApolloErrorCallback:function(){return el},showGlobalApolloError:function(){return ec},storage:function(){return e0},toast:function(){return ep.toast},useApolloError:function(){return ea},useLazyQuery:function(){return ey.useLazyQuery},useLoading:function(){return eP},useMutation:function(){return ey.useMutation},useNextIntl:function(){return eV},useQuery:function(){return ey.useQuery},useStorage:function(){return e1},useSubscription:function(){return ey.useSubscription},useTranslateI18next:function(){return eg},useTranslateNextIntl:function(){return eY},withNextIntl:function(){return eW}});module.exports=Q(j);var z=require("@apollo/client/core/core.cjs"),H=require("@apollo/client/link/core/core.cjs"),B=require("@apollo/client/link/error/error.cjs"),V=require("@apollo/client/link/http/http.cjs"),Y=require("@apollo/client/link/remove-typename/remove-typename.cjs"),W=require("@apollo/client/link/subscriptions/subscriptions.cjs"),J=require("@apollo/client/react/react.cjs"),X=require("@apollo/client/utilities/utilities.cjs"),K=require("graphql-ws"),Z=q(require("react"),1);var $=q(require("react"),1);var ee=require("react"),er=(0,ee.createContext)(void 0);var et={"modal-backdrop":"_modal-backdrop_8fveh_1","modal-content":"_modal-content_8fveh_11","btn-close":"_btn-close_8fveh_22","error-title":"_error-title_8fveh_36","btn-retry":"_btn-retry_8fveh_41","error-details":"_error-details_8fveh_54",main:"_main_8fveh_72",network:"_network_8fveh_75",extra:"_extra_8fveh_78"};function en(){var e=(0,$.use)(er),r=e===null||e===void 0?void 0:e.error;if(!r)return null;var t=x(function(e,r){return(r===null||r===void 0?void 0:r.length)?$.default.createElement("div",null,$.default.createElement("strong",null,e,":"),$.default.createElement("ul",null,r.map(function(e){return $.default.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return $.default.createElement("div",{className:et["modal-backdrop"]},$.default.createElement("div",{className:et["modal-content"]},$.default.createElement("button",{type:"button",className:et["btn-close"],onClick:e.hideError},"✕"),$.default.createElement("div",{className:et["error-title"]},$.default.createElement("button",{type:"button",className:et["btn-retry"],onClick:x(function(){return window.location.reload()},"onClick")},"Reload")," ",r.message),$.default.createElement("div",{className:et["error-details"]},r.networkError&&$.default.createElement("pre",{className:"network"},$.default.createElement("strong",null,"Network Error:")," ",r.networkError.message),t("GraphQL Errors",b(r.graphQLErrors)),t("Protocol Errors",b(r.protocolErrors)),t("Client Errors",b(r.clientErrors)),r.extraInfo&&$.default.createElement("pre",{className:"extra"},$.default.createElement("strong",null,"Extra Info:")," ",JSON.stringify(r.extraInfo,null,4)))))}x(en,"ApolloErrorComponent");var eo=require("react");function ea(){var e=(0,eo.use)(er);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}x(ea,"useApolloError");var ei=q(require("react"),1);var eu=null;function el(e){eu=e}x(el,"setGlobalApolloErrorCallback");function ec(e){eu===null||eu===void 0?void 0:eu(e)}x(ec,"showGlobalApolloError");function es(e){var r=e.children;var t=g((0,ei.useState)(null),2),n=t[0],o=t[1];(0,ei.useEffect)(function(){el(o)},[]);var a=(0,ei.useMemo)(function(){return{error:n,showError:o,hideError:x(function(){return o(null)},"hideError")}},[n]);return ei.default.createElement(er,{value:a},r)}x(es,"ApolloErrorProvider");var eE=require("consola/browser");var ef={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 ed={silent:eE.consola.silent,level:eE.consola.level,fatal:eE.consola.fatal,error:eE.consola.error,warn:eE.consola.warn,log:eE.consola.log,info:eE.consola.info,success:eE.consola.success,ready:eE.consola.ready,start:eE.consola.start,box:eE.consola.box,debug:eE.consola.debug,trace:eE.consola.trace,verbose:eE.consola.verbose};function ev(e,r){var t=r!==null&&r!==void 0?r:{},n=t.shouldLog,o=n===void 0?!0:n,a=t.returnValue,i=t.callback,u=d(e,Error)?e:new Error(typeof e=="string"?e:"Unknown error");return o&&ed.error(u.message),i&&typeof i=="function"&&i(u),a||{success:!1,message:u.message,code:ef.INTERNAL_SERVER_ERROR.CODE}}x(ev,"catchError");var ep=require("react-hot-toast");var eS="/graphql";var em,eA=(em=/*#__PURE__*/function(e){f(r,e);function r(){u(this,r);var e;e=i(this,r,arguments);F(e,"count",0);return e}c(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-n,a=e.operationName||"Unnamed";return ed.info("[Apollo] #".concat(t.count,": ").concat(a," (").concat(o,"ms)")),r})}}]);return r}(H.ApolloLink),x(em,"DevLoggerLink"),em);function e_(e){var r=e.uri,t=e.wsUrl,n=e.customLinks,o=new eA,a=(0,B.onError)(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,o=e.operation;var a=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;ed.error("[GraphQL error] ".concat(a,": ").concat(r,", Location: ").concat(JSON.stringify(t,null,4),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;ed.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t,null,4)))}),t&&ed.error("[Network error]: ".concat(t)),r||n||t){var i,u;var l=(r===null||r===void 0?void 0:(i=r[0])===null||i===void 0?void 0:i.message)||(n===null||n===void 0?void 0:(u=n[0])===null||u===void 0?void 0:u.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",c=new z.ApolloError({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:l,extraInfo:{operation:o}});ep.toast.error(function(e){return Z.default.createElement(Z.default.Fragment,null,l,"\xa0",Z.default.createElement("button",{type:"button",onClick:x(function(){setTimeout(function(){ec(c)},0),ep.toast.dismiss(e.id)},"onClick")},"Show Details"))})}}),i=(0,Y.removeTypenameFromVariables)();r||ed.warn('[Apollo] No GraphQL URI provided — using "'.concat(eS,'" as default'));var u=new V.HttpLink({uri:r!==null&&r!==void 0?r:eS,credentials:"include"}),l=t?new W.GraphQLWsLink((0,K.createClient)({url:t})):H.ApolloLink.empty(),c=d(l,H.ApolloLink)?(0,H.split)(function(e){var r=e.query;var t=(0,X.getMainDefinition)(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},l,u):u;return c===u&&t&&ed.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[o,a,i].concat(b(n!==null&&n!==void 0?n:[]),[c])}x(e_,"createApolloLinks");function eO(e){var r=e.isNextJS,t=e.options,n=e.children,o=e.client,a=e.provider,i=e.cache;var u=t||{},l=u.uri,c=u.wsUrl,s=u.customLinks,E=_(u,["uri","wsUrl","customLinks"]),f=o!==null&&o!==void 0?o:z.ApolloClient;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var v=a||J.ApolloProvider,p=(0,Z.useMemo)(function(){return(0,H.from)(e_({uri:l!==null&&l!==void 0?l:eS,wsUrl:c!==null&&c!==void 0?c:"",customLinks:s!==null&&s!==void 0?s:[]}))},[l,c,s]),S=(0,Z.useMemo)(function(){return d(i,z.InMemoryCache)?i:new z.InMemoryCache},[i]),m=(0,Z.useMemo)(function(){return new f(A({link:p,cache:S},E))},[f,p,S,E]),O=r?Z.default.createElement(v,{makeClient:x(function(){return m},"makeClient")},n):Z.default.createElement(v,{client:m},n);return Z.default.createElement(Z.default.Fragment,null,Z.default.createElement(es,null,O,Z.default.createElement(en,null)),Z.default.createElement(ep.Toaster,{position:"top-right"}))}x(eO,"ApolloProvider");var ey=require("@apollo/client/react/hooks/hooks.cjs");var eh=require("react-i18next"),eg=eh.useTranslation;var eb=q(require("i18next"),1),eT=require("react-i18next");function eN(e){return eb.default.use(eT.initReactI18next).init(e)}x(eN,"initI18next");var eI=q(require("clsx"),1),eC=q(require("react"),1);var eD={overlay:"_overlay_1ank4_1",fullscreen:"_fullscreen_1ank4_1",block:"_block_1ank4_2","overlay-fade-in":"_overlay-fade-in_1ank4_1",container:"_container_1ank4_35",ring:"_ring_1ank4_45",rotate1:"_rotate1_1ank4_1",rotate2:"_rotate2_1ank4_1",rotate3:"_rotate3_1ank4_1",rotate4:"_rotate4_1ank4_1",message:"_message_1ank4_69","text-fade":"_text-fade_1ank4_1"};function eR(){if(document.getElementById("noscroll-style"))return;var e=document.createElement("style");e.id="noscroll-style",e.innerHTML="\n .noscroll {\n overflow: hidden !important;\n height: 100vh !important;\n }\n ",document.head.appendChild(e)}x(eR,"injectNoScrollStyle");function eL(e){var r=e.full,t=r===void 0?!1:r,n=e.block,o=n===void 0?!1:n,a=e.className,i=a===void 0?"":a,u=e.message,l=u===void 0?"Loading":u,c=_(e,["full","block","className","message"]);(0,eC.useEffect)(function(){if(t){document.body.classList.add("noscroll");var e=x(function(e){return e.preventDefault()},"handleContextMenu");return document.addEventListener("contextmenu",e),function(){document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",e)}}},[t]),(0,eC.useEffect)(function(){eR()},[]);function s(){return eC.default.createElement("div",A({className:eD.container},c),eC.default.createElement("div",{className:eD.ring}),eC.default.createElement("div",{className:eD.ring}),eC.default.createElement("div",{className:eD.ring}),eC.default.createElement("div",{className:eD.ring}),l&&eC.default.createElement("div",{className:eD.message},l))}return x(s,"_renderLoading"),t?eC.default.createElement("div",{className:(0,eI.default)(eD.fullscreen,i)},s()):o?eC.default.createElement("div",{className:(0,eI.default)(eD.block,i)},s()):s()}x(eL,"Loading");var ew=require("react"),eM=(0,ew.createContext)(void 0);var eG=require("react");function eP(){var e=(0,eG.use)(eM);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}x(eP,"useLoading");var ex=q(require("react"),1);function ek(e){var r=e.children;var t=g((0,ex.useState)(!1),2),n=t[0],o=t[1],a=g((0,ex.useState)(!1),2),i=a[0],u=a[1],l=(0,ex.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),u(e)},[]),c=(0,ex.useCallback)(function(){o(!1),u(!1)},[]),s=(0,ex.useMemo)(function(){return{isLoading:n,isGlobalLoading:i,showLoading:l,hideLoading:c}},[n,i,l,c]);return ex.default.createElement(eM,{value:s},n?ex.default.createElement(eL,{full:i}):r)}x(ek,"LoadingProvider");var eU=require("date-fns/locale"),eq={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:eU.enUS,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};var eQ=require("react"),eF=(0,eQ.createContext)(void 0);var ej=require("next-intl"),ez=q(require("react"),1);var eH=require("next-intl"),eB=require("react");function eV(){var e=(0,eB.use)(eF);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}x(eV,"useNextIntl");var eY=eH.useTranslations;function eW(e){var r=x(function(r){var t;var n;var o=eV(),a=o.currentLanguage,i=r.messages,u=r.languages,l="en",c=i[(a===null||a===void 0?void 0:a.value)||l],s=(n=(t=u.find(function(e){return e.value===(a===null||a===void 0?void 0:a.value)}))===null||t===void 0?void 0:t.timezone)!==null&&n!==void 0?n:eq.timezone;return i?ez.default.createElement(ej.NextIntlClientProvider,{locale:(a===null||a===void 0?void 0:a.value)||l,messages:c||null,timeZone:s},ez.default.createElement(e,r)):(ed.warn("Missing messages for language: ".concat((a===null||a===void 0?void 0:a.value)||l)),null)},"PageWithI18n");return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}x(eW,"withNextIntl");var eJ=q(require("react"),1);var eX=require("react");var eK={Date:{is:x(function(e){return d(e,Date)},"is"),serialize:x(function(e){return{__type:"Date",value:e.toISOString()}},"serialize"),deserialize:x(function(e){return new Date(e)},"deserialize")},Map:{is:x(function(e){return d(e,Map)},"is"),serialize:x(function(e){return{__type:"Map",value:Array.from(e.entries())}},"serialize"),deserialize:x(function(e){return new Map(e)},"deserialize")},Set:{is:x(function(e){return d(e,Set)},"is"),serialize:x(function(e){return{__type:"Set",value:Array.from(e)}},"serialize"),deserialize:x(function(e){return new Set(e)},"deserialize")},RegExp:{is:x(function(e){return d(e,RegExp)},"is"),serialize:x(function(e){return{__type:"RegExp",value:{source:e.source,flags:e.flags}}},"serialize"),deserialize:x(function(e){var r=e.source,t=e.flags;return new RegExp(r,t)},"deserialize")},BigInt:{is:x(function(e){return(typeof e==="undefined"?"undefined":T(e))=="bigint"},"is"),serialize:x(function(e){return{__type:"BigInt",value:e.toString()}},"serialize"),deserialize:x(function(e){return BigInt(e)},"deserialize")}},eZ={serialize:function e(e){return JSON.stringify(e,function(e,r){var t=true,n=false,o=undefined;try{for(var a=Object.keys(eK)[Symbol.iterator](),i;!(t=(i=a.next()).done);t=true){var u=i.value;var l=eK[u];if(l.is(r))return l.serialize(r)}}catch(e){n=true;o=e}finally{try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw o}}}return r})},deserialize:function e(e){return JSON.parse(e,function(e,r){if(r&&(typeof r==="undefined"?"undefined":T(r))=="object"&&"__type"in r&&typeof r.__type=="string"){var t=r.__type,n=eK[t];if(n)return n.deserialize(r.value)}return r})}};var e$=q(require("localforage"),1);var e0={get:function e(e){return a(function(){var r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e$.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,ev(r,{returnValue:null})];case 3:return[2]}})})()},set:function e(e,r){return a(function(){var t;return C(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,e$.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();ev(t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return a(function(){var r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e$.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();ev(r);return[3,3];case 3:return[2]}})})()},keys:function e(){return a(function(){var e,r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e$.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,ev(r,{returnValue:[]})];case 3:return[2]}})})()}};function e1(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eZ;var n=g((0,eX.useState)(r),2),o=n[0],i=n[1],u=g((0,eX.useState)(!1),2),l=u[0],c=u[1];(0,eX.useEffect)(function(){var n=!0;return x(function(){return a(function(){var o,a,u,l;return C(this,function(s){switch(s.label){case 0:s.trys.push([0,6,7,8]);return[4,e0.get(e)];case 1:o=s.sent();if(!n)return[3,5];if(!(o!==null))return[3,2];a=t.deserialize(o);i(a);return[3,5];case 2:if(!(r!==void 0))return[3,4];u=t.serialize(r);return[4,e0.set(e,u)];case 3:s.sent(),i(r);return[3,5];case 4:i(void 0);s.label=5;case 5:return[3,8];case 6:l=s.sent();ev(l),n&&i(r);return[3,8];case 7:n&&c(!0);return[7];case 8:return[2]}})})()},"loadValue")(),function(){n=!1,c(!1)}},[e,r,t]),(0,eX.useEffect)(function(){if(!l)return;x(function(){return a(function(){var r,n;return C(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,e0.set(e,r)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:n=a.sent();ev(n);return[3,4];case 4:return[2]}})})()},"saveValue")()},[o,e,t,l]);var s=(0,eX.useCallback)(function(e){i(function(r){return typeof e=="function"?e(r):e})},[]),E=(0,eX.useCallback)(function(){return a(function(){var r;return C(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,e0.remove(e)];case 1:t.sent(),i(void 0);return[3,3];case 2:r=t.sent();ev(r);return[3,3];case 3:return[2]}})})()},[e]);return{value:o,set:s,remove:E}}x(e1,"useStorage");function e2(e){var r=e.children;return eJ.default.createElement(eJ.default.Fragment,null,r)}x(e2,"LanguageWrapperBase");var e4=eW(e2);function e3(e){var r=e.children,t=e.languages,n=e.messages;var o=e1("lang",t[0]),a=o.value,i=o.set,u=(0,eJ.useMemo)(function(){return{languages:t,currentLanguage:a!==null&&a!==void 0?a:eq,setCurrentLanguage:i}},[t,i,a]);return eJ.default.createElement(eF,{value:u},eJ.default.createElement(e4,{languages:t,messages:n},r))}x(e3,"NextIntlProvider");0&&(module.exports={ApolloErrorComponent:ApolloErrorComponent,ApolloErrorContext:ApolloErrorContext,ApolloErrorProvider:ApolloErrorProvider,ApolloProvider:ApolloProvider,GRAPHQL_URI_DEFAULT:GRAPHQL_URI_DEFAULT,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NEXT_INTL_DEFAULT_LANGUAGE:NEXT_INTL_DEFAULT_LANGUAGE,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,Toaster:Toaster,catchError:catchError,initI18next:initI18next,log:log,setGlobalApolloErrorCallback:setGlobalApolloErrorCallback,showGlobalApolloError:showGlobalApolloError,storage:storage,toast:toast,useApolloError:useApolloError,useLazyQuery:useLazyQuery,useLoading:useLoading,useMutation:useMutation,useNextIntl:useNextIntl,useQuery:useQuery,useStorage:useStorage,useSubscription:useSubscription,useTranslateI18next:useTranslateI18next,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
package/dist/react/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._modal-backdrop_8fveh_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22:hover{color:#f87171}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36{font-size:1.75rem;font-weight:700;margin-bottom:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._main_8fveh_72{color:#fca5a5}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._network_8fveh_75{color:#fde68a}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._extra_8fveh_78{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 ul{padding-left:1rem;color:#fda4af;list-style:disc}.
|
|
1
|
+
._modal-backdrop_8fveh_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22:hover{color:#f87171}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36{font-size:1.75rem;font-weight:700;margin-bottom:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._main_8fveh_72{color:#fca5a5}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._network_8fveh_75{color:#fde68a}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._extra_8fveh_78{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 ul{padding-left:1rem;color:#fda4af;list-style:disc}._overlay_1ank4_1,._fullscreen_1ank4_1,._block_1ank4_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_1ank4_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._fullscreen_1ank4_1,._block_1ank4_2{pointer-events:none}._fullscreen_1ank4_1{position:fixed;inset:0}._block_1ank4_2{position:relative;width:auto;height:auto}._container_1ank4_35{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_1ank4_35 ._ring_1ank4_45{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_1ank4_35 ._ring_1ank4_45:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_1ank4_1 1s linear infinite}._container_1ank4_35 ._ring_1ank4_45:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_1ank4_1 1s linear infinite}._container_1ank4_35 ._ring_1ank4_45:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_1ank4_1 1s linear infinite}._container_1ank4_35 ._ring_1ank4_45:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_1ank4_1 1s linear infinite}._container_1ank4_35 ._message_1ank4_69{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_1ank4_1 2s ease-in-out infinite alternate;word-break:break-word;hyphens:auto}@keyframes _rotate1_1ank4_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_1ank4_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_1ank4_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_1ank4_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_1ank4_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_1ank4_1{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){._ring_1ank4_45,._message_1ank4_69,._overlay_1ank4_1,._fullscreen_1ank4_1,._block_1ank4_2{animation:none!important}}
|